|
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
1
« 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
« on: March 13, 2008, 04:34:03 pm »
Where to paste this code? Can i see a demo?
3
« 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! I still think (for a PHP article) that showing the image would enhance this little GEM even more. Ask it to SMFHacks
4
« 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! ...and i get rid of underline text! Have a look! It is better than previous code! 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
« 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
7
« on: March 11, 2008, 07:39:55 pm »
Here is the code that include a table and the timestamp.
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
« 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 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
« 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:
ssi_lastcom(); It works.
10
« on: March 11, 2008, 08:51:56 am »
Ehm.. it is the same code posted by SMFHacks. Anyway how to fix my problem?
11
« on: March 11, 2008, 08:49:35 am »
My friend help me and now it works. Here is the working code:
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
« on: March 10, 2008, 10:20:13 am »
I'm here again!
I tried my best to write this:
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
« on: January 20, 2008, 05:47:23 pm »
Anyone (maybe a programmer) can help me?
15
« on: January 17, 2008, 10:57:44 am »
Please some one can help me to create a php module that show latest comments?
|
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
|
|
|