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: 223
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 223
Total: 223

Author Topic: Latest comments  (Read 33062 times)

0 Members and 1 Guest are viewing this topic.

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Latest comments
« Reply #30 on: March 13, 2008, 03:46:00 pm »
Thank you SmartMouse...I am hopeful I can make the PHP article work....

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 spurry

  • Member
  • *
  • Posts: 29
    • View Profile
Re: Latest comments
« Reply #31 on: March 24, 2008, 10:37:05 am »
hello i have tryed this code in every block i have and in a article and nothing works, i no it will be me so could any one tell me where i am going rong please

thanks

Offline smartmouse

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

Offline trifox

  • Member
  • *
  • Posts: 32
    • View Profile
    • fractalforums.com
Re: Latest comments
« Reply #33 on: June 07, 2008, 06:22:12 am »
hi there, i was in need of such a component also, i modified the query, so that it does not need to query for the username on each user!
and i added a table around,

Latest Item may be found here:
http://prollcoder.com/index.php?option=com_content&task=view&id=25&Itemid=1

Item in action:
http://www.fractalforums.com/index.php?action=gallery

and here is the sourcecode:
Code: [Select]
function ssi_lastcom ()
 {
global $scripturl,$db_prefix;
echo '<center><script type="text/javascript"><!-- google_ad_client = "pub-4885104155050142"; /* 728x90, Erstellt 05.03.08 */ google_ad_slot = "0199758893"; google_ad_width = 728; google_ad_height = 90; //-->  </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></center>  ';
  $query="SELECT comment,memberName,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename     
FROM     
{$db_prefix}gallery_comment as comments     
RIGHT JOIN     
({$db_prefix}gallery_pic as pics,      {$db_prefix}members as members)       
ON       
(pics.ID_PICTURE =comments.ID_PICTURE       AND       members.ID_MEMBER=comments.ID_MEMBER       )       ORDER BY comments.date       DESC       LIMIT 10";

$request = db_query($query, __FILE__, __LINE__);   
while ($row = mysql_fetch_assoc($request))
{
echo '<table border="0" width="100%">   
<tr> <td colspan=2>
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '">     <small>on <b>', parse_bbc($row['title'],1) , '</b></small>     <small>by ', $row['memberName'], '</small></a>
</td></tr><tr>     
<td calign="top" width="68">
     <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/0/',$row['thumbfilename'].'" width="64" ></a>
</td><td valign="top"><small>', parse_bbc($row['comment'],1) , '</small> <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>view</small></a>
<td> </tr>       
<tr><td colspan="2"><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td colspan="2"><hr></td></tr>
</table>';
}   
mysql_free_result($request);     

}
« Last Edit: June 07, 2008, 06:23:47 am by trifox »

Offline Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #34 on: December 11, 2011, 11:16:05 am »
Is it possible to use these codes for SMF 2.0.1 and the latest version of Tiny Portal? I only get a blank block, but maybe I'm doing something wrong. If not, where can I find a code for "Latest comments from the gallery" block?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Latest comments
« Reply #35 on: December 12, 2011, 07:45:40 pm »
Updated to 2.0x call ssicom

Code: [Select]

function ssi_lastcom()
 {
global $scripturl, $smcFunc;

  $query="SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename     
FROM     
{db_prefix}gallery_comment as comments     
RIGHT JOIN     
({db_prefix}gallery_pic as pics,      {db_prefix}members as members)       
ON       
(pics.ID_PICTURE =comments.ID_PICTURE       AND       members.ID_MEMBER=comments.ID_MEMBER       )       ORDER BY comments.date       DESC       LIMIT 10";

$request = $smcFunc['db_query']('', $query);   
while ($row = $smcFunc['db_fetch_assoc']($request))
{
echo '<table border="0" width="100%">   
<tr> <td colspan=2>
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '">     <small>on <b>', parse_bbc($row['title'],1) , '</b></small>     <small>by ', $row['real_name'], '</small></a>
</td></tr><tr>     
<td calign="top" width="68">
     <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/',$row['thumbfilename'].'" width="64" alt="" ></a>
</td><td valign="top"><small>', parse_bbc($row['comment'],1) , '</small> <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>view</small></a>
<td> </tr>       
<tr><td colspan="2"><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td colspan="2"><hr></td></tr>
</table>';
}   
$smcFunc['db_free_result']($request);     

}
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 Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #36 on: December 13, 2011, 10:45:09 am »
Thanks a lot SMFHacks!  :)

Unfortunately I'm doing something wrong, because my block doesn't show anything.

I put ssi_lastcom(); in a php block?

I also put the code for 2.0x in SSI.php?

Below is the end of my SSI-file. Is it something wrong there??

Code: [Select]
foreach ($attachments as $attach)
echo '
<tr>
<td>', $attach['file']['link'], '</td>
<td>', $attach['member']['link'], '</td>
<td align="center">', $attach['file']['downloads'], '</td>
<td>', $attach['file']['filesize'], '</td>
</tr>';
echo '
</table>';
}

function ssi_lastcom()
 {
global $scripturl, $smcFunc;

  $query="SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename     
FROM     
{db_prefix}gallery_comment as comments     
RIGHT JOIN     
({db_prefix}gallery_pic as pics,      {db_prefix}members as members)       
ON       
(pics.ID_PICTURE =comments.ID_PICTURE       AND       members.ID_MEMBER=comments.ID_MEMBER       )       ORDER BY comments.date       DESC       LIMIT 10";

$request = $smcFunc['db_query']('', $query);   
while ($row = $smcFunc['db_fetch_assoc']($request))
{
echo '<table border="0" width="100%">   
<tr> <td colspan=2>
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '">     <small>on <b>', parse_bbc($row['title'],1) , '</b></small>     <small>by ', $row['real_name'], '</small></a>
</td></tr><tr>     
<td calign="top" width="68">
     <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/',$row['thumbfilename'].'" width="64" alt="" ></a>
</td><td valign="top"><small>', parse_bbc($row['comment'],1) , '</small> <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>view</small></a>
<td> </tr>       
<tr><td colspan="2"><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td colspan="2"><hr></td></tr>
</table>';
}   
$smcFunc['db_free_result']($request);     

}

?>

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Latest comments
« Reply #37 on: December 13, 2011, 11:34:11 am »
It looks right anything in the forums error log.
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 Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #38 on: December 13, 2011, 11:50:30 am »
I can't find anything in the error log that seems to help. I got this.....

Fil: /customers/d/7/7/hellasforum.net/httpd.www/Themes/default/languages/TPortal.english.php (tp_below sub template - eval?)
Linje: 285

....a lot of times.

I use version 3.0.22 of Gallery Pro.


Offline Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #39 on: December 13, 2011, 11:53:51 am »
Now I got this error:


Feil i databasen: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename
FROM
smf_gallery_comment as comments
RIGHT JOIN
(smf_gallery_pic as pics, smf_members as members)
ON
(pics.ID_PICTURE =comments.ID_PICTURE AND members.ID_MEMBER=comments.ID_MEMBER ) ORDER BY comments.date DESC LIMIT 10

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Latest comments
« Reply #40 on: December 13, 2011, 11:57:16 am »
Retry this
Code: [Select]
function ssi_lastcom()
 {
global $scripturl, $smcFunc;

  $query="SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename     
FROM     
({db_prefix}gallery_comment as comments,
{db_prefix}gallery_pic as pics)
LEFT JOIN {db_prefix}members as members)  on     (members.ID_MEMBER=comments.ID_MEMBER )
WHERE  pics.ID_PICTURE =comments.ID_PICTURE ORDER BY comments.date       DESC       LIMIT 10";

$request = $smcFunc['db_query']('', $query);   
while ($row = $smcFunc['db_fetch_assoc']($request))
{
echo '<table border="0" width="100%">   
<tr> <td colspan=2>
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '">     <small>on <b>', parse_bbc($row['title'],1) , '</b></small>     <small>by ', $row['real_name'], '</small></a>
</td></tr><tr>     
<td calign="top" width="68">
     <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/',$row['thumbfilename'].'" width="64" alt="" ></a>
</td><td valign="top"><small>', parse_bbc($row['comment'],1) , '</small> <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>view</small></a>
<td> </tr>       
<tr><td colspan="2"><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td colspan="2"><hr></td></tr>
</table>';
}   
$smcFunc['db_free_result']($request);     

}
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 Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #41 on: December 13, 2011, 02:02:10 pm »
Still doesn't work for me.  :(

I got this error:

Feil (error) i databasen: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') on (members.ID_MEMBER=comments.ID_MEMBER )
WHERE pics.ID_PICTURE =comm' at line 5

SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename
FROM
(smf_gallery_comment as comments,
smf_gallery_pic as pics)
LEFT JOIN smf_members as members) on (members.ID_MEMBER=comments.ID_MEMBER )
WHERE pics.ID_PICTURE =comments.ID_PICTURE ORDER BY comments.date DESC LIMIT 10
Aktiver filtrering: Bare vise feilene fra denne filen
File: /customers/d/7/7/hellasforum.net/httpd.www/SSI.php
Line: 1981

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Latest comments
« Reply #42 on: December 13, 2011, 02:10:55 pm »
Reply
Code: [Select]
function ssi_lastcom()
 {
global $scripturl, $smcFunc;

  $query="SELECT comment,real_name,title, comments.date, comments.ID_MEMBER, comments.ID_PICTURE,thumbfilename     
FROM     
({db_prefix}gallery_comment as comments,
{db_prefix}gallery_pic as pics
LEFT JOIN {db_prefix}members as members)  on     (members.ID_MEMBER=comments.ID_MEMBER )
WHERE  pics.ID_PICTURE =comments.ID_PICTURE ORDER BY comments.date       DESC       LIMIT 10";

$request = $smcFunc['db_query']('', $query);   
while ($row = $smcFunc['db_fetch_assoc']($request))
{
echo '<table border="0" width="100%">   
<tr> <td colspan=2>
<a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '">     <small>on <b>', parse_bbc($row['title'],1) , '</b></small>     <small>by ', $row['real_name'], '</small></a>
</td></tr><tr>     
<td calign="top" width="68">
     <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/',$row['thumbfilename'].'" width="64" alt="" ></a>
</td><td valign="top"><small>', parse_bbc($row['comment'],1) , '</small> <a style="text-decoration: none;" href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><small>view</small></a>
<td> </tr>       
<tr><td colspan="2"><small>[', timeformat($row['date']), ']</small></td></tr>
<tr><td colspan="2"><hr></td></tr>
</table>';
}   
$smcFunc['db_free_result']($request);     

}
This should work now.
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 Dylert

  • Member
  • *
  • Posts: 45
    • View Profile
    • Hellasforum
Re: Latest comments
« Reply #43 on: December 13, 2011, 02:49:05 pm »
Hm, it doesn't work for me.

I have put the new code in the SSI file and uploaded it to the server.

I add a new PHP block (left block) in TinyPortal.
In the body area i write ssi_lastcom();

The block is still empty. If I make a top or bottom block my entire frontpage shows up in the block.  :)

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Latest comments
« Reply #44 on: December 13, 2011, 06:37:34 pm »
At a loss now try to do a test function like
Code: [Select]
function ssi_test()
{
 echo 'test';
}
And see if it does anything.
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/

 

Related Topics

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

+- 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