Do you guys have a top posters block made up?Im looking for one w/o the forum posts just with stats/avatars ect. it would be awsome if it could be added onto my scrolling forums block at the bottom,i dont know if its possible or not.
i actually have your scrolling forums block but it doesnt list top posters,.its from an old forum that you updated n made work for someone.,i like the style of the block and would like to keep it.,I guess what im saying is can you take my block and add top posters say at the bottom of it?
And under that in (( GREEN )) is what im trying to incorperate into my current scrolling block. What you see in (( GREEN )) is actually a non scrolling block and i tried to eliminate all but the top posters part of the code so i could maybe paste it into my current block but its still leaving some of the unwanted stuff on.
Hope your catching my drift lol. Like i said im new to this i know a little but not enough.
Joined: Dec 02, 2006 Posts: 1364 Location: Texas, USA
Posted:
Mon May 02, 2011 7:12 am
Here is a quick redo of an old top posters block. Have not tested much, but in theory could be used as side or center block, although the styling may need to be adjusted depending on theme and whether used as side or center. Ideally you would remove the inline styling and place in your style.css, but for now, try this.
Only registered users can see links on this board! Get registered or login to the forums!
Yup thats basically what i want..Now i have 2 questions,.,.1) Can it be made to display only the top 5 instead?Right now its displaying 9.
2) can this in any way be added into my current scrolling forums block to display at the bottom of it?
Code:
<?php
/*
DHTML Scrolling Forum Block
Written By: gotcha
http://nukecoder.com
Cross browser Marquee II is from http://dynamicdrive.com/
Please do not remove their copyright notice.
Released August 2007
*/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'
function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+5))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+5+"px"
}
function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
Joined: Dec 02, 2006 Posts: 1364 Location: Texas, USA
Posted:
Mon May 02, 2011 3:26 pm
try this
Only registered users can see links on this board! Get registered or login to the forums!
I would suggest uploading a blank.gif for those who don't have an avatar (or may not someday in the future) to:
modules/Forums/images/avatars/blank.gif
modules/Forums/images/avatars/gallery/blank.gif
Thanks i have a blank.gif,.im in the middle of looking for a good avatar pack atm..,
As far as the block you linked me,I dunno if you used my code or not but its the same forum scroller i have but i modified mine to display center.,Also its scrolling the top posters i want the top posters stationed at the bottom not scrolling..
Joined: Dec 02, 2006 Posts: 1364 Location: Texas, USA
Posted:
Tue May 03, 2011 2:26 pm
I didn't notice you had customized the block, but I recognized it and used a copy I already had. If you look at the block in a decent text editor like notepad++ it's pretty easy to see the code i added.
Code:
// top posters
// number of top posters
$a = 5;
// make all avatars same width
$avatar_width = 50;
$result=$db->sql_query('SELECT user_id, username, user_posts, user_avatar, points FROM '.$user_prefix.'_users ORDER BY user_posts DESC LIMIT 0,'.$a);
while(list($user_id, $username, $user_posts, $user_avatar, $user_points) = $db->sql_fetchrow($result)) {
$content .= '<div style="float:left;width:140px;margin:10px 8px 10px 0;"><table cellpadding="0" cellspacing="5" border="0">';
$content .= '<tr>';
$content .= '<td align="center">';
if (preg_match('/http(s?):\/\//', $user_avatar)) {
$content .= '<a href="modules.php?name=Your_Account&op=userinfo&username='.$username.'"><img src="'.$user_avatar.'" border ="0" width="'.$avatar_width.'" /></a></td>';
}else{
$content .= '<a href="modules.php?name=Your_Account&op=userinfo&username='.$username.'"><img src="modules/Forums/images/avatars/'.$user_avatar.'" border="0" width="'.$avatar_width.'" /></a></td>';
}
$content .= '<td align="left"><a href="modules.php?name=Your_Account&op=userinfo&username='.$username.'">'.$username.'</a><br />';
$content .= '<a href="forums.html&file=search&search_author='.$username.'">'.$user_posts.'</a><br /><sup>Points: <strong>'.$user_points.'</strong> </sup></td>';
$content .= '</tr>';
$content .= '</table></div>';
}
$content .= '<div style="clear:both;height:1px;"> </div>';
// end top posters
I would paste it right before ?> in your modified block
After some more editing i got it.,The one you gave me was also scrolling the posters.,
here's the finished block if you gys want it or any one wants a scrolling forum with top posters..Thanks for all your help.
Code:
<?php
/*
DHTML Scrolling Forum Block
Written By: gotcha
http://nukecoder.com
Cross browser Marquee II is from http://dynamicdrive.com/
Please do not remove their copyright notice.
Released August 2007
*/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'
function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+5))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+5+"px"
}
function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum