vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help Converting This Code (https://vborg.vbsupport.ru/showthread.php?t=294629)

Black Snow 01-31-2013 09:27 PM

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.

kh99 02-01-2013 01:03 PM

I don't see anything in that that's version-specific, and there's not enough context to know why it doesn't work (I didn't inspect it for bugs, but since you said it works on your friend's site I'm assuming that's not the problem).


All times are GMT. The time now is 09:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01191 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete