the top posters block dosent show the post count of the top posters,
i decided to change it around so it would...
*cought* backup file first
Open SSI.php
Find:
// Show the top poster's name and profile
function ssi_topPoster($topNumber = 1, $output_method = 'echo')
{
global $db_prefix, $scripturl;
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'posts' => $row['posts']
);
mysql_free_result($request);
// Just return all the top posters.
if ($output_method != 'echo')
return $return;
// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];
echo implode(', ', $temp_array);
}
Replace With:
// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
{
global $db_prefix, $scripturl;
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><font size="1"><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</font><br></td></table>',
);
mysql_free_result($request);
// Just return all the top posters.
if ($output_method != 'echo')
return $return;
// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];
echo implode($temp_array);
}
work like a charm :D
Thanks OnTap :-*
Very very sweet...
Thanks, lots,
-Xarcell
its not really displaying anything... what do i need to do to make it display on the frontpage?
Go to your Block maganger and choose to create an ssi block. Pick the Top Posters and save it :)
thats cool...i was hoping to maybe mix it in with my stats block
how would I show the top 10 posters instead of just 5
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
change the part in bold to 10
no matter what I change it to it always comes back with the top 5
thanks! works well for me!
I want to add block with top posters in a list, how would I do that?
poster one name
poster two name
like that
phpbox
ssi_topPoster(); -- could be Top 3,4,5
Quote from: crip on August 18, 2006, 07:01:35 PM
ssi_topPoster();
adding just that in a php box will do what I want?
Quote from: RebelRose on August 18, 2006, 07:02:43 PM
adding just that in a php box will do what I want?
yep...
by default it will show 3 top posters n post count next to there name...
to make it more than 3 enter the number inside ();
Max, how do I get them to show in a list instead of
poster, poster, poster
poster
I want it to look like
poster
poster
poster
Very first post of this topic you need to change code in SSI.php ;)
(http://www.tinyportal.net/smf/index.php?topic=3671.msg30375#msg30375)
alright thanks I will
That is perfect thank you Max ;)
I just noticed that it changed the Titles on the other blocks to smaller text, is that normal?
Is there anyway we can add avatars above the names?
Quote from: RebelRose on August 18, 2006, 08:04:47 PM
I just noticed that it changed the Titles on the other blocks to smaller text, is that normal?
That should not happen, i will look at the code n see why its doing this.
Quote from: MaxÃ,â,,¢ on August 30, 2006, 11:38:25 AM
Quote from: RebelRose on August 18, 2006, 08:04:47 PM
I just noticed that it changed the Titles on the other blocks to smaller text, is that normal?
That should not happen, i will look at the code n see why its doing this.
Did you figure this out yet Max?
Quote from: RebelRose on September 13, 2006, 07:40:52 PM
Did you figure this out yet Max?
Yup i think so, changed the code at the start of this post.
does it still happen to you?
yes but just one area of front page now, so I guess that is not too bad
Works great for me)) Thanks!
it works Thanks a lot
The blocks below the Top Posters Block still has smaller font than the other blocks. Any fix for this? My forum is located at http://forum.defleppardrocksonline.us
Quote from: christinedlrp on February 17, 2007, 11:04:16 AM
The blocks below the Top Posters Block still has smaller font than the other blocks. Any fix for this? My forum is located at http://forum.defleppardrocksonline.us
same for me - any fix???
You might try removing the font tags in the code.
Quote from: JPDeni on March 12, 2007, 06:56:58 PM
You might try removing the font tags in the code.
That fixed it!! Now if someone could get it to display more than 5 posters, even if you change it to a higher number it will only display 5............. :buck2:
Where are you changing the number? How are you calling the function?
Quote from: JPDeni on March 13, 2007, 01:17:36 AM
Where are you changing the number? How are you calling the function?
I changed the number in the code in SSI.php file, where the original post of this thread said to place the code, and to call it I am using the built in TP function to call it.
I guess one of my failings is that I don't use many of the built-in functions. I prefer to use a php block and write the code myself.
Open TPortalBlocks.template.php. Search for
ssi_topPoster(5);
Change the number there.
Quote from: JPDeni on March 13, 2007, 02:03:57 PM
I guess one of my failings is that I don't use many of the built-in functions. I prefer to use a php block and write the code myself.
Open TPortalBlocks.template.php. Search for
ssi_topPoster(5);
Change the number there.
YEA!! That worked, THANK YOU JPDENI!!
i just put this in a phpbox
Quotessi_topPoster(7);
and worked fine !!!
top 7 posters appeared ;)
I know this topic has not been active in awhile, and I have the block working as posted, but unlike some of the previous posters...I want the font smaller. I am using this in a phpbox...is there a way to control font size there? Also, the names appear to be double spaced...how about single spaced.
I have tried changing it in the SSI, but I guess I am changing it the wrong way...I keep getting errors or no changes.
Thanks,
Wally
The font is controlled by your style.css file of your theme you're using.
Thanks IchBin...I will look in that file.
Wally
Thanks...I looked at the styles.css for the template I am using, and I found this section:
Quote/* A code block - maybe even PHP ;). */
.code
{
color: #000000;
background-color: #dddddd;
font-family: "courier new", "times new roman", monospace;
font-size: x-small;
line-height: 1.3em;
/* Put a nice border around it. */
border: 1px solid #000000;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
/* Don't wrap its contents, and show scrollbars. */
white-space: nowrap;
overflow: auto;
/* Stop after about 24 lines, and just show a scrollbar. */
max-height: 24em;
}
However, no matter what I change the font size to...it does not change.
I am still thinking it needs to be added in the ssi.php file, yes...no?
Quote from: rumboogy on January 03, 2008, 02:19:13 AM
I am still thinking it needs to be added in the ssi.php file, yes...no?
well it depends, the easy way is to just change the font tag in the ssi file or you could make your own css to control this. ;)
Actually, that was my original question...how do you insert a font tag in a php file (proper syntax).
Thanks,
Wally
rumboogy, the code you posted from the style.css file is for the formatting of the BBC code part of posts. By default if a font property is not specified in the code for the snippet, it will use the default font property of the body class (if specified). If not specified, it will be in the div or table class.
Thanks IchBin,
I think I am still lost. I understand that if the font is not specified in the code, it will use the default font in the style.css file...which is the case here (I think), but I don't know how to code a smaller font for this script:
// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
{
global $db_prefix, $scripturl;
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><font size="1"><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</font><br></td></table>',
);
mysql_free_result($request);
// Just return all the top posters.
if ($output_method != 'echo')
return $return;
// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];
echo implode($temp_array);
}
So my question is...is there a way to control font size by adding the font size code in the script. I also want to single space the list.
Sorry to be so dense...
On the left size is the font size I want...on the right is what it presently is...(default size)
Yes, you can add the class="smalltext" to your <td> tag. :)
Thanks IchBin...I will work at it some more...
I had forgot to list the site I was working on...better late than never I guess.
http://www.zumoforums.com (http://www.zumoforums.com)
Thanks,
Wally
I would delete the <font size="1"> and </font> tags as well.
Quote from: JPDeni on March 13, 2007, 02:03:57 PM
I guess one of my failings is that I don't use many of the built-in functions. I prefer to use a php block and write the code myself.
Open TPortalBlocks.template.php. Search for
ssi_topPoster(5);
Change the number there.
Hi,
Where can I find
TPortalBlocks.template.php.
/Themes/default/ folder.
Thanks a lot JPDeni :up:
thank you! works great!
i am so glad i got pointed in this direction...by using the php block and only changing 1 line in the ssi file i got it to work and even decreased the space in between the name and post count but
how do i get rid of the comma ?
You'll have to post the code you used in order for us to know how to alter it. Please use [ code ] tags around your code to make it easier to read.
um...i used the php block and inserted this code:
ssi_topPoster(10);
that is all
Yes, but if you altered it we need to see it.
You said earlier
Quoteonly changing 1 line in the ssi file
We need to know which line you changed and what you changed it to.
Also, it would help if you would give a link to a site where we can see it in action. Often it helps to figure out the source of problems when we can look at the source code of the page.
Sorry about that...totally forgot that part, ok lets see Find it DreamSlayer Artworks (http://www.dreamslayerartworks.com/manor/index.php) and it shows up the same way on all our forums where I made the php block.
first I got this code from the first page of this post ...this is only partially the code on the page for I did the entire code change and it did not work soooooo
then I just replaced the $topNumber from the number to 10 and the 'link' and 'posts' lines from the top section with the 'link' line from bottom section
Look for: (in SSI,php)
// Show the top poster's name and profile
function ssi_topPoster($topNumber = 1, $output_method = 'echo')
{
global $db_prefix, $scripturl;
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
------> 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'posts' => $row['posts']
);
Replace with:
// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber =3, $output_method = 'echo')
{
global $db_prefix, $scripturl;
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
---------> 'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><font size="1"><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</font><br></td></table>',
);
hope that helps...if not I am attaching the ssi.php file also
I amended the SSI.php code to the following:
// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
{
global $db_prefix, $scripturl;
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<tr><td class="smalltext"><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right" class="smalltext">' . $row['posts' ] . '</td></tr>',
);
mysql_free_result($request);
// Just return all the top posters.
if ($output_method != 'echo')
return $return;
// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];
echo implode($temp_array);
echo '</table>';
}
Seems to have fixed the text size, gap between rows and following block title issues 8)
I'm not sure what's going on. Sorry that I missed your post on the 25th. I did look at your site, though, and found a number of issues.
This is what that line from SSI.php should look like, if you want each one to be in its own table:
'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><tr><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</td></tr></table>',
I'm not sure where the comma is coming from. It wasn't in the SSI.php code that you posted. You might need to post the exact code that you're using for the block.
well what i posted is the actual file and what I changed
the actual block in TP mod is a php block
ssi_topPoster(10);
is what it has inserted and nothing else.
I have no idea where that darn comma is coming from either....it is in the blocks that I have for all the forums that have TP and are post count oriented...also in my test forum that has hardly any posting cause it ismy playground to try then add to the manor later.
I wonder if your version of PHP is doing this. I just tried your ssi code and the call in a block on my site and didn't get a comma. Try using this code instead and see if you have a comma.
// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
{
global $db_prefix, $scripturl;
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<tr><td class="smalltext"><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right" class="smalltext">' . $row['posts' ] . '</td></tr>',
);
mysql_free_result($request);
// Just return all the top posters.
if ($output_method != 'echo')
return $return;
// Make a quick array to list the links in.
foreach ($return as $member)
echo $member['link'];
echo '</table>';
}
There is a trailing comma after the 'link' key...
'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><font size="1"><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '"> ' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</font><br></td></table>',
But I wouldn't think it would matter, though.
The comma appears after the closing </table> in the HTML code... but I don't see where it should pop up in the php code.
Also, the implode function doesn't specify a glue separator (but, since 4.3.0, is optional) but I wonder if his server is running a prior version that may default to commas between the elements?
QuoteThe comma appears after the closing </table> in the HTML code
Actually, it's outside the html code. The html is within single quotes. The comma is a separator for the array.
Quote from: IchBinâ,,¢ on June 28, 2008, 10:54:18 PM
I wonder if your version of PHP is doing this. I just tried your ssi code and the call in a block on my site and didn't get a comma. Try using this code instead and see if you have a comma.
I will try the code in one of my forums and let you know if it behaves or not.
I am running version 1.1.5 of SMF with .0983 Tiny Portal, if that helps any
ty so very much for helping this old woman out.
You guys are wonderful to have around ...both problems are now history...you rock!
The code worked beautifully :up:
Very weird.... glad we could help. :)
weird is putting it mildly....this site of mine is so crazy...the blocks that work in one forum won't work in the other like it should and if sometimes i need to go and change a link it may/maynot toally mess up the block where i get nothing but the code instead of hyper links
making it necessary to remake the block or totally delete it and add the links under the nav bar.
not anything about the software or the portal...just gremlins cause it used to be weird even with straight phpbb...lol
thanks tho for being there when i need you all.
Hello again people! And sorry to bring this topic up again. But I was wondering if there is any way to get the Top Posters block to look like this one:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi41.tinypic.com%2F30hlopz.jpg&hash=dba675c80dcf6f091e53a84cced5cee78c08e271)
This isn't from my web. It is from: http://zaccoweb.uni.cc/ (http://zaccoweb.uni.cc/). It uses SimplePortal, but I think there shouldn't be much problem to make something like this.
Please, I would be glad if anyone could help :).
Thanks in advance! :)
I think you'd be better of requesting an additional snippet in the requests board instead of turning this into something its not.
Quote from: IchBinâ„¢ on June 12, 2009, 04:30:35 AM
I think you'd be better of requesting an additional snippet in the requests board instead of turning this into something its not.
Ok then, sorry to post it here.
Thanks for the reply, I'll do it there :)