Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 185
Total: 185

Author Topic: Latest comments  (Read 33005 times)

0 Members and 1 Guest are viewing this topic.

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #15 on: March 11, 2008, 01:05:13 pm »
Oh...OK. I got it working now.

Only problem is I have the same issue as you regarding the ID.

Here is what I return:

Quote
Man that is one lucky lady. lol
Scritto da: 6

Nice HDR too. Thanks.
Scritto da: 1

Very Nice.
Scritto da: 1

Test Comment
Scritto da: 2

Is this the one that won the socalled wet t-shirt contest?
Scritto da: 233

Still...what about having the image itself? I put this into a PHP article...and that HAS GREAT potential!!! If we can add an image.

Wally
« Last Edit: March 11, 2008, 01:08:34 pm by rumboogy »
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #16 on: March 11, 2008, 01:29:36 pm »
Smartmouse...check your forum error log...you probably have errors. I hope you can get this to work.

Mr. Hacks...I put this into a PHP article and can see the utility of having the ability to post this into maybe a table through a php article. I would like to have it show the image(s) though. Below is an example of what I am talking about...

Here is a PHP article with the ssi_lastcom function. http://www.arkansasbiker.net/index.php?page=45

Wally
« Last Edit: March 11, 2008, 05:09:54 pm by rumboogy »
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #17 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?

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #18 on: March 11, 2008, 04:21:38 pm »
Quote
Anyway what about adding image (rumboogy's idea) and fixing ID with member name? Who can help us?
And putting all that in a table.  ;D

I will try the code again...and see what happens. For what it is worth (and I am a NOTHING coder)...I did try several things to get the REAL NAME to show up...obviously nothing I did succeeded.   >:(

Here is the code used in a PHP article:  http://www.arkansasbiker.net/index.php?page=45

Thanks Smartmouse...your efforts are appreciated.

Wally
« Last Edit: March 11, 2008, 05:10:33 pm by rumboogy »
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #19 on: March 11, 2008, 04:24:41 pm »
No errors with that script SmartMouse...good work. Just need to finish it.

Thanks,

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #20 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?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Latest comments
« Reply #21 on: March 11, 2008, 07:41:35 pm »
First issue you would need to do a join with the members table and grab the realName field.

2. Change  $row['date'] to timeformat($row['date'])
Which will use SMF's function.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #22 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 ;)

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #23 on: March 11, 2008, 08:02:21 pm »
Smartmouse...post the code if you don't mind....Thanks.

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #24 on: March 11, 2008, 08:33:09 pm »
OK...got as far as you have...even made the table show the border.

Now all we need is the NAME and if we could get the image to appear...WOW.

Mr. Hacks...I feel this ssi_lastcom could actually help promote the galleries and inspire more comments. Very nice!!
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #25 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 ;)

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #26 on: March 12, 2008, 03:59:14 am »
I tried this on my higher volume website and just realized I was really wanting it to list all comments this way. I like the last comments too, but this is what I had in mind when I asked Mr. Hacks about a couple of months ago...this is exactly what I was looking for...only for ALL COMMENTS (and the image of course. But your work has definitely inspired me.

THanks.

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #27 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);
}

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #28 on: March 12, 2008, 03:53:37 pm »
Here it is in a PHP article:  http://www.arkansasbiker.net/index.php?page=45

I still think (for a PHP article) that showing the image would enhance this little GEM even more.

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline smartmouse

  • Member
  • *
  • Posts: 21
    • View Profile
Re: Latest comments
« Reply #29 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
« Last Edit: March 13, 2008, 02:26:16 am by smartmouse »

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4062 Views
Last post March 26, 2007, 12:18:01 pm
by brianjw
4 Replies
6726 Views
Last post August 19, 2008, 08:56:54 pm
by bluedevil
5 Replies
6962 Views
Last post September 05, 2008, 02:32:18 pm
by MoreBloodWine
13 Replies
9605 Views
Last post September 18, 2008, 10:56:56 pm
by Boomslanger
4 Replies
3740 Views
Last post December 03, 2012, 11:02:10 am
by Jonas1975

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal