SimplePortal

Support => English Support => Topic started by: Aw06 on September 10, 2008, 01:57:47 AM

Title: Top Posters Block
Post by: Aw06 on September 10, 2008, 01:57:47 AM
How can i chage the format of the numbers in the Top posters Block ..

I wanna change

1- to 1.
Title: Re: Top Posters Block
Post by: Nathaniel on September 10, 2008, 02:03:39 AM
Find this code from your 'SPortal.php' file (it occurs twice, you will need to change both):
Code: [Select]
<td>' . $member['list'] . '-</td>
Replace with this code:
Code: [Select]
<td>' . $member['list'] . '</td>
Title: Re: Top Posters Block
Post by: Aw06 on September 10, 2008, 02:48:10 AM
 :'( :'(

That didnt go well, change it ... then i notice my avatar gone .... and when try to replace it page goes blank ....

seeing like 8 pages in the error log all related to SPortal.php

Code: [Select]
2: Cannot modify header information - headers already sent by (output started at /home/adrianw/public_html/forum/Sources/SPortal.php:3259)
/home/adrianw/public_html/forum/Sources/Load.php
1975

Im gonna change it back to the original code  :'(

Ediittttt ..........

Replaced SPortal.php with original, problem seems fixed now .. guess i will stick with 1- lol
Title: Re: Top Posters Block
Post by: Nathaniel on September 10, 2008, 03:01:15 AM
Um, that is a really small edit. It shouldn't cause any of those errors that you were refering to...

If you post your 'SPortal.php' file (as an attachment) then I can make the edit for you. ;)
Title: Re: Top Posters Block
Post by: Aw06 on September 10, 2008, 03:07:28 AM
I made the edit exactly how you had it, except you left out the dot (.) ... ill live with the dash instead of the dot  >:-D
Title: Re: Top Posters Block
Post by: [SiNaN] on September 10, 2008, 03:57:17 AM
You should exactly do what LHVWB said. That dot there is to concatenate strings in PHP.
Title: Re: Top Posters Block
Post by: Manu on September 10, 2008, 04:46:43 AM
I made the change once too and it works fine, no errors or something else.
Take a look at our Top Poster Block. ;)

My code in the SPortal.php is this:
Code: [Select]
echo '<table>';
foreach ($top_posters as $member)
{
if (!empty($member['avatar']['href']))
echo ' <tr>
<td>' . $member['list'] . '.</td>
<td><img src="' . $member['avatar']['href'] . '" alt="" width="35" /></td><td>&nbsp;</td>
<td>' . $member['link'] . '<br />' . $member['posts'] . $txt['sp-tposterpost'] . '</td>
</tr>';
else
echo ' <tr>
<td>' . $member['list'] . '.</td>
<td>&nbsp;</td><td>&nbsp;</td>
<td>' . $member['link'] . '<br />' . $member['posts'] . $txt['sp-tposterpost'] . '</td>
</tr>';
}
echo '</table>';
Title: Re: Top Posters Block
Post by: Aw06 on September 10, 2008, 08:07:49 AM
You should exactly do what LHVWB said. That dot there is to concatenate strings in PHP.

I think the dot has to be there,  ;P
Title: Re: Top Posters Block
Post by: Nathaniel on September 10, 2008, 08:32:52 AM
The dots have to be there '.' , but you can remove the hyphin '-' .
Title: Re: Top Posters Block
Post by: Manu on September 10, 2008, 09:33:19 AM
I think the dot has to be there,  ;P

The original code is this: <td>' . $member['list'] . '-</td>
I changed only the - before </td> to a dot and in our Top Poster Block you see now
1. instead of 1-
SimplePortal 2.3.8 © 2008-2024, SimplePortal