MyBB Community Forums

Full Version: Show newest memer at top of index Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to edit the index page to show "welcoming our newest member (XXXXXX)" at the top of the page, I tried referencing the stats page by copying the code to the index page but its not showing anything. 

	<p> welcoming our newest member!</p>
	<table  border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="trow1">
{$lang->newest_member} {$stats['newest_user']}<br />
</td>
</tr>
</table>	
	<br>

This is how it looks but it's just showing a blank box.
I didn't want to copy the code for the stats box on the bottom of the page up because it moves the entire stats box.
If anyone would like to look themselves our website is http://www.divinity-os.com
Right now our website is limited to users only so you will need to login to access the forums
username: Visitor
Password: Password (Capital "P")



I'm relatively new at this and self taught everything that I do know so your help is greatly appreciated!
I think you should see in the index.php for this code

{$lang->newest_member} {$stats['newest_user']}

You have to add those code to your index.php file, which is will call that code to show on your index
The code I referenced above is directly from the index.php file, I've already added it, it's just showing blank.
Can you post your code that referenced to this code

{$lang->newest_member} {$stats['newest_user']}

In index.php here?
Oh! I didn't enter it directly into the index.php file. I entered it into the index template on the theme in the adminCP

I'm not familiar with PHP at all so everything that I'm looking at in the php file is a different language to me, I have no idea where I should throw this in.
Yes, to show that code you have to add in spesific templates like index templates. But you have to remember that the code in your templates is from your php file. So the point is you have to find that code and add it to your index.php file
Is there a specific place to add the code in? I tried to add it in at the end. I know next to nothing about PHP, and ended up taking down my index page. Here is the code for the index page and please just let me know where to add it in! Thanks! 

[index.php]
Just add it at the end of the file before this code

$plugins->run_hooks('index_end');
when I do that it just breaks the index page, Error 500

 
But I did find this so is there a way to reference this in the template.
// Check who's the newest member.
	if(!$stats['lastusername'])
	{
		$newestmember = $lang->nobody;;
	}
	else
	{
		$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
	}
I'm sorry it's my false, you don't have to add that code in your code, it's already in there somewhere. Just put this code to your index templates

{$newestmember} > this for the username only
{$lang->stats_newestuser} > this for the full text
Let me know if it is work
Pages: 1 2