Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 230
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 244
Total: 244

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - smartmouse

Pages: [1] 2
1
Support / Re: Latest comments
« on: March 24, 2008, 03:10:54 pm »
You have to put the code in SSI.php file.
Then you have to create a phpblock and just write ssi_lastcom();.

2
SMF Gallery Lite / Re: Random Image in Block?
« on: March 13, 2008, 04:34:03 pm »
Where to paste this code?
Can i see a demo?

3
Support / Re: Latest comments
« on: March 12, 2008, 06:20:45 pm »
Here it is in a PHP article:  http://www.arkansasbiker.net/index.php?page=45
Very nice!

Quote
I still think (for a PHP article) that showing the image would enhance this little GEM even more.
Ask it to SMFHacks :P

4
Support / Re: Latest comments
« on: March 12, 2008, 12:40:15 pm »
Here is the new code (thanks to my friend) that shows latest 5 comments, with normal date and member name!!
In addition it converts phpBB smileys and add a separator for every comment! ;D
...and i get rid of underline text!

Have a look! It is better than previous code!

Code: [Select]
function ssi_lastcom ()
{
global $scripturl,$db_prefix;
 
$request = db_query("SELECT comment, date, ID_MEMBER, ID_PICTURE FROM {$db_prefix}gallery_comment ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
$nickname = mysql_result(db_query("SELECT memberName FROM {$db_prefix}members WHERE ID_MEMBER = '".$row['ID_MEMBER']."' LIMIT 1", __FILE__, __LINE__),0,0);
echo'
<table border="0">
<tr>
<td valign="top">
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>', parse_bbc($row['comment'],1) , '</small></a>
</td>
</tr>
<tr><td><small>by: ', $nickname, '</small></td></tr>
<tr><td><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td><hr></td></tr>
</table>';
}
mysql_free_result($request);
}

5
Support / Re: Latest comments
« on: March 12, 2008, 02:20:32 am »
Mr. Hacks...I feel this ssi_lastcom could actually help promote the galleries and inspire more comments. Very nice!!

I feel the same. I need this "module" to inspire more comments in my forum... you are right ;)

6
Support / Re: Latest comments
« on: March 11, 2008, 07:51:05 pm »
1. What is JOIN ? ;D
I found this: http://dev.mysql.com/doc/refman/5.0/en/left-join-optimization.html, but i can't understand how to use it :(
I will ask to my friend.

2. It worked!! Thanks ;)

7
Support / Re: Latest comments
« on: March 11, 2008, 07:39:55 pm »
Here is the code that include a table and the timestamp.

Code: [Select]
function ssi_lastcom ()
{
global $scripturl,$db_prefix;
 
$request = db_query("SELECT comment, date, ID_MEMBER, ID_PICTURE FROM {$db_prefix}gallery_comment ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
echo'
<table border="0" class="ssi_table">
<tr>
<td valign="top">
<a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>', $row['comment'], '</a>
<br />by: <strong>', $row['ID_MEMBER'],  '</strong>
<br />[', $row['date'], ']<br /><br /></small>
</td>
</tr>
</table>';
}
mysql_free_result($request);
}

Change table proprieties as you prefer.
The code i posted above have two problems:

- member ID instead of member NAME
- UNIX time instead of NORMAL date

Anyone can fix it?

8
Support / Re: Latest comments
« on: March 11, 2008, 03:42:34 pm »
Yes i get errors in SMF (something like this: Missing argument 1 for ssi_lastcom()). Now i think i fixed it.
Here is the new version :P

Code: [Select]
function ssi_lastcom ()
{
global $scripturl,$db_prefix;
 
$request = db_query("SELECT comment, date, ID_MEMBER, ID_PICTURE FROM {$db_prefix}gallery_comment ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
echo' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>', $row['comment'], '</a><br />Written by: <strong>', $row['ID_MEMBER'],  '<br /><br /></strong></small> ';
}
mysql_free_result($request);
}

Anyway what about adding image (rumboogy's idea) and fixing ID with member name? Who can help us?

9
Support / Re: Latest comments
« on: March 11, 2008, 12:33:04 pm »
I added the code that i posted above at the end of SSI.php file.
Then i create a new block in TPortal and i added the following code:

Code: [Select]
ssi_lastcom();
It works.

10
Support / Re: Latest comments
« on: March 11, 2008, 08:51:56 am »
Ehm.. it is the same code posted by SMFHacks.
Anyway how to fix my problem?

11
Support / Re: Latest comments
« on: March 11, 2008, 08:49:35 am »
My friend help me and now it works. Here is the working code:

Code: [Select]
function ssi_lastcom ($cat)
{
global $scripturl,$db_prefix;
$cat = (int) $cat;
 
$request = db_query("SELECT comment, date, ID_MEMBER, ID_PICTURE FROM {$db_prefix}gallery_comment GROUP BY comment ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request)) {
echo' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>', $row['comment'], '</a><br />Scritto da: <strong>', $row['ID_MEMBER'],  '<br /><br /></strong></small> ';
}
mysql_free_result($request);
}

Now i have to fix just the last thing: how to show member name instead of member id?
It results in messages like "Hello world" written by: 2, instead of "Hello world" written by: John.

Do you understand what i mean? How to fix it?

12
Support / Re: Latest comments
« on: March 10, 2008, 10:20:13 am »
I'm here again!

I tried my best to write this:

Code: [Select]
function ssi_lastcom ($cat)
{
global $scripturl,$db_prefix;
$cat = (int) $cat;

$request = db_query("SELECT comment, date, ID_MEMBER, ID_PICTURE FROM {$db_prefix}gallery_comment GROUP BY comment ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
mysql_free_result($request);
echo' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>', $row['comment'], '</small></a><br />Written by: <strong>', $row['ID_MEMBER'],  ' '
;}

It works, but it shows only 1 comment...
So, do you know how to make it to show more than 1 comment? I write LIMIT 5 but it does not work!
In addition, do you know how to show member name instead of member id ?

13
Support / Re: Latest comments
« on: January 20, 2008, 05:47:23 pm »
Anyone (maybe a programmer) can help me?

14
Support / Re: Latest comments
« on: January 18, 2008, 05:56:26 am »
@admin: can you create a module like this?

http://www.smfhacks.com/index.php/topic,125.msg8845.html#msg8845

I think you can modify it to make it showing latest comments instead of random images.
Am i right or maybe it is more difficult than i think?

I hope can do it.

Thank you.

15
Support / Re: Latest comments
« on: January 17, 2008, 10:57:44 am »
Please some one can help me to create a php module that show latest comments?

Pages: [1] 2

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal