Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
snyper
Hangin' Around



Joined: Nov 18, 2010
Posts: 28

PostPosted: Sat Apr 30, 2011 1:22 am Reply with quote

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.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun May 01, 2011 5:35 pm Reply with quote

Our scrolling forums block includes the top posters (configurable) but I take it that's not what you want. I don't know of any other.
 
View user's profile Send private message
snyper







PostPosted: Sun May 01, 2011 10:38 pm Reply with quote

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?
 
snyper







PostPosted: Sun May 01, 2011 11:10 pm Reply with quote

See heres my scrolling forum block (( in RED ))

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.


Image
 
Raven







PostPosted: Mon May 02, 2011 1:09 am Reply with quote

Have you tried using the RavenNuke (tm) forum scrolling block like what's on the home page of this site?
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Mon May 02, 2011 7:12 am Reply with quote

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! ]
 
View user's profile Send private message Visit poster's website
snyper







PostPosted: Mon May 02, 2011 12:59 pm Reply with quote

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();
}


define("_BBFORUM_TOTTOPICS","Topics ");
define("_BBFORUM_TOTPOSTS","Posts ");
define("_BBFORUM_TOTVIEWS","Views ");
define("_BBFORUM_TOTREPLIES","Replies ");
define("_BBFORUM_TOTMEMBERS","Members");
define("_BBFORUM_FORUM","Forums");
define("_BBFORUM_SEARCH","Search");

$theme = get_theme();
$post_image = "themes/$theme/forums/images/icon_latest_reply.gif";
global $prefix, $user_prefix, $db, $sitename, $user, $cookie, $group_id;

$content .= '
<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

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


</script>
';

$content .= '
<div id="marqueecontainer" style="position: relative ; width: 216px; height: 0px; overflow: hidden; padding: 100px;padding-right: 300px;"  padding-left: 244px;" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: relative; width: 250%;">
';

$content .= '<br /><center><a href="modules.php?name = Forums"><b>'.$sitename.' Forums</b></a><br /><br /></center>';

$sql = "SELECT
t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name,
f.forum_id, u.username, u.user_id, p.poster_id, p.post_time FROM
 ".$prefix."_bbtopics t, ".$prefix."_bbforums f,
 ".$prefix."_bbposts p, ".$user_prefix."_users u WHERE
 p.post_id = t.topic_last_post_id AND u.user_id = p.poster_id
 AND t.forum_id=f.forum_id AND f.auth_view=0
 ORDER BY t.topic_last_post_id DESC
 LIMIT 10";
$result1 = $db->sql_query($sql);
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result1))
{
  $content .= '
  <div style="border-bottom: 1px dotted #000000; padding-bottom: 5px; padding-top: 5px;">
  <img src="'.$post_image.'" alt="" border="0" />
  <a href="forums.html?amp;file=viewtopic&amp;p='.$topic_last_post_id.'#'.$topic_last_post_id.'" title="'.$topic_title.'"><strong>'.$topic_title.'</strong></a><br />
  <span class="content"><em>Last post by
  <a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username='.$username.'" title="'.$username.'">'.$username.'</a>
  in <a href="forums.html?amp;file=viewforum&amp;f='.$forum_id.'" title="'.$forum_name.'">'.$forum_name.'</a> on
  '.date("m/d/Y h:i a", $post_time).'</em></span>
  </div>
  ';
 
}

$content .= '
<div style="text-align:center; padding-top: 8px;"><a href="forums.html" title="Forum Index">Forum Index</a></div>
</div>
</div>

<div style="padding-top: 8px;">
  <div style="float:left;">
    <a href="forums.html">Forum Index</a><br />
    <a href="forums.html?file=search">Forum Search</a><br />
  </div>
  <div style="float:right; text-align: right;">
    <span id="fast" style="cursor: pointer;" onClick="copyspeed=copyspeed+1; mqs=marqueespeed; marqueespeed=copyspeed"><img src="images/mini_up.png" alt="" title="Faster" /></span><br />
    <span id="slow" style="cursor: pointer;" onClick="copyspeed=copyspeed-1; mqs=marqueespeed; marqueespeed=copyspeed"><img src="images/mini_down.png" alt="" title="Slower" /></span>
  </div>
</div>
';


?>
 
spasticdonkey







PostPosted: Mon May 02, 2011 3:26 pm Reply with quote

try this [ Only registered users can see links on this board! Get registered or login! ]

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
 
snyper







PostPosted: Tue May 03, 2011 12:46 pm Reply with quote

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..
 
spasticdonkey







PostPosted: Tue May 03, 2011 2:26 pm Reply with quote

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&amp;op=userinfo&amp;username='.$username.'"><img src="'.$user_avatar.'" border ="0" width="'.$avatar_width.'" /></a></td>';
}else{
$content .= '<a href="modules.php?name=Your_Account&amp;op=userinfo&amp;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&amp;op=userinfo&amp;username='.$username.'">'.$username.'</a><br />';
$content .= '<a href="modules.php?name=Forums&amp;file=search&amp;search_author='.$username.'">'.$user_posts.'</a><br /><sup>Points:&nbsp;<strong>'.$user_points.'</strong>&nbsp;</sup></td>';
$content .= '</tr>';
$content .= '</table></div>';
}
$content .= '<div style="clear:both;height:1px;">&nbsp;</div>';
// end top posters


I would paste it right before ?> in your modified block
 
snyper







PostPosted: Tue May 03, 2011 3:12 pm Reply with quote

After some more editing i got it.,The one you gave me was also scrolling the posters.,


Image


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();
}


define("_BBFORUM_TOTTOPICS","Topics ");
define("_BBFORUM_TOTPOSTS","Posts ");
define("_BBFORUM_TOTVIEWS","Views ");
define("_BBFORUM_TOTREPLIES","Replies ");
define("_BBFORUM_TOTMEMBERS","Members");
define("_BBFORUM_FORUM","Forums");
define("_BBFORUM_SEARCH","Search");

$theme = get_theme();
$post_image = "themes/$theme/forums/images/icon_latest_reply.gif";
global $prefix, $user_prefix, $db, $sitename, $user, $cookie, $group_id;




$content .= '
<script type="text/javascript">


/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

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


</script>
';

$content .= '
<div id="marqueecontainer" style="position: relative ; width: 216px; height: 0px; overflow: hidden; padding: 100px;padding-right: 300px;"  padding-left: 244px;" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: relative; width: 250%;">
';

$content .= '<br /><center><a href="modules.php?name = Forums"><b>'.$sitename.' Forums</b></a><br /><br /></center>';

$sql = "SELECT
t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name,
f.forum_id, u.username, u.user_id, p.poster_id, p.post_time FROM
 ".$prefix."_bbtopics t, ".$prefix."_bbforums f,
 ".$prefix."_bbposts p, ".$user_prefix."_users u WHERE
 p.post_id = t.topic_last_post_id AND u.user_id = p.poster_id
 AND t.forum_id=f.forum_id AND f.auth_view=0
 ORDER BY t.topic_last_post_id DESC
 LIMIT 10";
$result1 = $db->sql_query($sql);
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result1))
{
  $content .= '
  <div style="border-bottom: 1px dotted #000000; padding-bottom: 5px; padding-top: 5px;">
  <img src="'.$post_image.'" alt="" border="0" />
  <a href="modules.php?name=Forums&amp;file=viewtopic&amp;p='.$topic_last_post_id.'#'.$topic_last_post_id.'" title="'.$topic_title.'"><strong>'.$topic_title.'</strong></a><br />
  <span class="content"><em>Last post by
  <a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username='.$username.'" title="'.$username.'">'.$username.'</a>
  in <a href="modules.php?name=Forums&amp;file=viewforum&amp;f='.$forum_id.'" title="'.$forum_name.'">'.$forum_name.'</a> on
  '.date("m/d/Y h:i a", $post_time).'</em></span>
  </div>
  ';
 
}

$content .= '
<div style="text-align:center; padding-top: 8px;"><a href="modules.php?name=Forums" title="Top Posters">Top Posters</a></div>
</div>
</div>

<div style="padding-top: 8px;">
  <div style="float:left;">
    <a href="">Top Posters</a><br />
    <a href="modules.php?name=Forums&file="></a><br />
  </div>
  <div style="float:top; text-align: right;">
    <span id="fast" style="cursor: pointer;" onClick="copyspeed=copyspeed+1; mqs=marqueespeed; marqueespeed=copyspeed"><img src="images/mini_up.png" alt="" title="Faster" /></span><br />
    <span id="slow" style="cursor: pointer;" onClick="copyspeed=copyspeed-1; mqs=marqueespeed; marqueespeed=copyspeed"><img src="images/mini_down.png" alt="" title="Slower" /></span>
  </div>
</div>
';
// 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&amp;op=userinfo&amp;username='.$username.'"><img src="'.$user_avatar.'" border ="0" width="'.$avatar_width.'" /></a></td>';
}else{
$content .= '<a href="modules.php?name=Your_Account&amp;op=userinfo&amp;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&amp;op=userinfo&amp;username='.$username.'">'.$username.'</a><br />';
$content .= '<a href="forums.html?amp;file=search&amp;search_author='.$username.'">'.$user_posts.'</a><br /><sup>Points:&nbsp;<strong>'.$user_points.'</strong>&nbsp;</sup></td>';
$content .= '</tr>';
$content .= '</table></div>';
}
$content .= '<div style="clear:both;height:1px;">&nbsp;</div>';
// end top posters

?>
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Wed May 04, 2011 1:04 am Reply with quote

can you zip it. too much blank spaces.
 
View user's profile Send private message
snyper







PostPosted: Wed May 04, 2011 4:16 pm Reply with quote

Sure,.,.,.,.


www.fulltimerealty.net/xas/scroller.rar
 
hicuxunicorniobestbuildpc







PostPosted: Thu May 05, 2011 4:07 am Reply with quote

Thanks I will test this one.
 
snyper







PostPosted: Thu May 05, 2011 7:00 am Reply with quote

Im sure you will find some stuff you will have to clean up but its working with no errors for me.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©