View Single Post
  #38  
Old 09-30-2006, 02:26 AM
Spikeman Spikeman is offline
 
Join Date: Aug 2006
Location: UK
Posts: 203
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is marquee.php, it should work ok, I need to clean the code up some, just need to find a spare 10mins which always turns into an hour

Code:
<?php
// you may edit the below to suit your own needs

define('MARQUEE_SPEED', '2');
define('MARQUEE_WIDTH', '100%');
define('MARQUEE_HEIGHT', '145');
define('MARQUEE_NAME', 'Latest Posts');
define('THREAD_LIMIT', '20');

// no need to change anything below this line :)


error_reporting(E_ALL & ~E_NOTICE);
require ('global.php');

?>
<!-- Scrolling Marquee -->
<body bgcolor="#91BEDE" text="#000000" rightmargin="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<marquee id="threadticker" direction=up scrollAmount=<?php echo MARQUEE_SPEED; ?> style="width:<?php echo MARQUEE_WIDTH; ?>;height:<?php echo MARQUEE_HEIGHT; ?>;border:0px solid black;
padding:0px" onMouseover="this.scrollAmount=0" onMouseout="this.scrollAmount=<?php echo MARQUEE_SPEED; ?>">

<table border=0 cellpadding=4 cellspacing=0 width="<?php echo MARQUEE_WIDTH; ?>"> 
<tr>

<td colspan=3>
<font size=2 face="Verdana, Arial, sans-serif, Helvetica, Times">
<b><a href="<?php echo $bburl; ?>"><?php echo MARQUEE_NAME; ?></b></font>
</td>
</tr>

<?php

// connect to the database and pull the info we need.

$threads = $db->query_read("
SELECT threadid, forumid, title, replycount, lastposter, postuserid, postusername 
FROM " . TABLE_PREFIX . "thread AS thread 
ORDER BY thread.lastpost DESC LIMIT 10");

while ($thread = $db->fetch_array($threads)) {

// make sure the user has the permission to view the current thread.
$forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"]; {
 

// if he can, go ahead and output the goods.

    $postctr++;
    if ($thread['replycount'] == 0) {
      $numreplies = "No Replies";
    }
    elseif ($thread['replycount'] == 1) {
      $numreplies = "Reply";
    } 
    else {
     $numreplies = $thread['replycount'];
     $numreplies .= " Replies";	
    }

    echo "<tr>\n";
    echo "<td width=\"$marquee_width\" style=\"border-bottom: 1px inset #000000; background-color: #4C6CA4\" onMouseover=\"this.style.backgroundColor='#607DAE';\" onMouseOut=\"this.style.backgroundColor='#4C6CA4';\">\n";
    echo "<font size=1 face=\"Verdana, Arial, sans-serif, Helvetica, Times\">\n";
    echo "<b><a href=\"$bburl/forums/showthread.php?s=&threadid=" . $thread['threadid'] . "\" target='_blank'>" . $thread['title'] . "</a></b><br>\n";
    echo "Started by: <a href=\"$bburl/forums/member.php?s=&action=getinfo&username=" . $thread['postusername'] . "\" target='_blank'>" . $thread['postusername'] . "</a><br>\n";
    echo "Last Post by: <a href=\"$bburl/forums/member.php?s=&action=getinfo&username=" . $thread['lastposter'] . "\" target='_blank'>" . $thread['lastposter'] . "</a><br>\n";
    echo $numreplies;
    echo "\n</font>\n";
    echo "</td>\n</tr>\n\n";
        
  }
}
?>

</marquee>

<!-- End Scrolling Marquee -->
I thought it just easier to cut and paste and replace entire contents of file.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01410 seconds
  • Memory Usage 1,785KB
  • 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