View Single Post
  #1  
Old 01-31-2013, 09:27 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help Converting This Code

Hi,

I have some code from my friend's forum, I am unsure why it won't work for my forum and I guess it's because this could be for vB 3 and I run 4.2.0.

Code:
$siteposts = $db->query_read("
SELECT thread.lastposter, thread.lastpost, thread.views, thread.open, thread.forumid, thread.replycount, thread.threadid, thread.pollid, thread.title, user.username, user.userid, user.usergroupid, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid FROM " . TABLE_PREFIX . "thread as thread
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter) WHERE forumid NOT IN (30, 3, 13, 15, 34, 16, 31, 81, 82, 17, 18, 19, 20, 22, 80, 79, 21, 69, 70, 71, 72, 73, 24, 25, 32, 85, 84, 86, 87) ORDER BY lastpost DESC LIMIT 0, 19");
while($latest = $db->fetch_array($siteposts))
{

$latest['title'] = str_replace($hidechar, " ", $latest['title']);

if (strlen($latest['title']) > 29)
{
$latest['title'] = substr($latest['title'], 0, 29) . '...';
}
else
{
$latest['title'] = $latest['title'];
}

$latest['title'] = htmlspecialchars($latest['title']);
$trans = array("&" => "&");
$latest['title'] = strtr($latest['title'], $trans);
$latest['replycount'] = number_format($latest['replycount']);
$lastest[musername] = fetch_musername($latest);
$lastest[musername] = $db->escape_string($lastest['musername']);
$date = date("g:i a",$latest['lastpost']);
$div = '<div style="border-bottom: 1px dotted #5080a6; padding: 2px;">';
$enddiv = '</div>';
$ci = '<img src="http://.png"; alt="" class="inlineimg">';

$latest_downloads .= "
$div
<div style='font-size: 11px;'><font color='#ce6262'>&bull;</font> <a href='showthread.php?t=$latest[threadid]' title='$latest[title]' style='font-size: 10px;'><b>$latest[title]</b></a></div>
<div style='padding-top: 1px; padding-bottom: 1px;'><a href='member.php?u=$latest[userid]' style='font-size: 9px;'>Posted by $latest[musername]</a></div>
<div style='padding-top: 1px; padding-bottom: 2px; font-size: 7pt;'>
<span>$ci <font color='#8A478F'><b>$latest[replycount] Comments</b></font></span>
$enddiv
</div>";
Thanks.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01205 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete