Need Help Adding Link Variables »  Show posts from    to     

Icy Phoenix


Old Styles Topics - Need Help Adding Link Variables



mort [ Thu 06 Sep, 2012 08:04 ]
Post subject: Re: Need Help Adding Link Variables
You had better get used to looking and learning how to use the CMS, as the details you are after are in here.

/blocks/statistics.php

And please, stop quoting the post above yours (Or the last post), especially when they contain a lot of detail. Use the "Reply" button instead.

Why?

Because I have to go through all this in my quick-view mail-washer just to read your few lines at the bottom.....

Spoiler: [ Show ]


That's why!


juggalo_master [ Thu 06 Sep, 2012 14:28 ]
Post subject: Re: Need Help Adding Link Variables
oh ok. i will look and see if i can find what i am looking for.

should really have a tutorial for new users on how to use the system specially for 2.0.

i have copied this
Code: [Hide]
  1. 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 
  2. 'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''), 
  3. 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 
  4. 'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics), 
  5. in the tpl file: 
  6. <table class="empty-table" width="100%" cellspacing="0" cellpadding="0" border="0"> 
  7. <tr><td><span class="gensmall">{TOTAL_USERS}<br />{NEWEST_USER}<br /><br />{TOTAL_POSTS} {TOTAL_TOPICS}</span></td></tr> 
  8. </table> 
  9.  
  10.  
  11.  
into my php file and it still doesn't show up the posts and topics.

is there something else i need?


mort [ Thu 06 Sep, 2012 23:28 ]
Post subject: Re: Need Help Adding Link Variables
You would possibly need to copy the SQL that queries the information for that data to your php file also.

And you're right about the docs, but I don't think anyone has had the chance to catch up.


juggalo_master [ Fri 07 Sep, 2012 03:45 ]
Post subject: Re: Need Help Adding Link Variables
oh ok. couldn't i had a specific tag to show the information without using php or no?


mort [ Fri 07 Sep, 2012 08:38 ]
Post subject: Re: Need Help Adding Link Variables
No,

You need to have a function that queries the database for the info, then you have to add vars to the queries, then you need to pass those vars to the template like this for example.

Code: [Hide] [Select]
$template->assign_vars(array(
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''),
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
)
);


Then in your template you would have {TOTAL_USERS} to pass the $total_users query to the front-end etc.

Welcome to phpBB code?

And by the way, it's not something I bother with much any more (since Icy Phoenix has changed so dramatically from the last version and I don't want you to think I'm ignoring you), so you'll have to wait for an Icy Phoenix fanatic to assist you further.


juggalo_master [ Fri 07 Sep, 2012 23:57 ]
Post subject: Re: Need Help Adding Link Variables
i did that it didn't work the way i was hoping but i guess i will have to figure it out somehow. if i can take it from phpbb3 template and show it on icy i might be able to figure it out. i am guessing 2.0 just came out.


mort [ Sat 08 Sep, 2012 01:48 ]
Post subject: Re: Need Help Adding Link Variables
Yes, Version 2.* has just been released and is more or less still undergoing beta testing.

I may have given you a bum steer too.

Try this:

Open:

templates/default/default.cfg

Find:

?>

Before add:

Code: [Hide] [Select]
$template->assign_vars(array(
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '', $newest_user, ''),
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
)
);


Template code:

{TOTAL_USERS} {NEWEST_USER} {TOTAL_POSTS} {TOTAL_TOPICS}


juggalo_master [ Sat 08 Sep, 2012 03:49 ]
Post subject: Re: Need Help Adding Link Variables
i get this:

The newest registered user is within topics

this is all that shows nothing else when i use those codes. i tried the way you just mentioned.

how would i go about doing it from a older version maybe i be able to get it to work that way by looking at the old way from the older versions and then convert it to 2.0.


mort [ Sat 08 Sep, 2012 04:26 ]
Post subject: Re: Need Help Adding Link Variables
It's all showing up for me?

Do us a favour,

Take a snapshot of your forum where you want to add this and add a sketch of what you are actually trying to do with all the details you want in it.

Because at the moment it's like working in the dark as some vars, as I explained before - don't work in all locations.


juggalo_master [ Sat 08 Sep, 2012 08:06 ]
Post subject: Re: Need Help Adding Link Variables
jugg i am mostly wanting it to show up right in this block.

i want to add the total posts, users, and topics on that section.

btw the 1.4 million, 21, and 18 isn't my posts. i just started up this script like a few days ago.

those arent the stats of the forum.


mort [ Sat 08 Sep, 2012 08:26 ]
Post subject: Re: Need Help Adding Link Variables
I'm no expert, but I just wasted far too much time trying to work out how IP is now put together.

phpBB3 is something that never interested me (which is the way IP is going), and learning it is something I never wanted to get involved with - - So I'm out of it.



Mighty Gorgon [ Sun 09 Sep, 2012 18:48 ]
Post subject: Re: Need Help Adding Link Variables
Those informations are added to CACHE to avoid excessive MySQL charge.

Here is how you can recall them:

Code: [Hide] [Select]
if (empty($config['max_topics']) || empty($config['max_posts']) || empty($config['max_users']) || empty($config['last_user_id']))
{
board_stats();
}
$total_topics = $config['max_topics'];
$total_posts = $config['max_posts'];
$total_users = $config['max_users'];
$newest_user = $cache->obtain_newest_user();


Remember that you may need to add at least global $db, $cache, $config; if you plan to use those info within a function.


juggalo_master [ Sun 09 Sep, 2012 21:13 ]
Post subject: Re: Need Help Adding Link Variables
thanks mg i was trying to figure out was how to do that. now maybe i be able to figure out how to do other things as well.




Powered by Icy Phoenix