0 Members and 2 Guests are viewing this topic.
global $context, $boarddir, $settings, $options, $scripturl, $user_info, $modSettings;require($boarddir.'/SSI.php');echo'<div style="font-family: verdana, arial, sans-serif;">'; // more stats echo 'Since Aug 25, 08, <b>' isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , ' members</b> joined Omnimaga.<br /><br />Since May 12, 05, <b>' .$modSettings['totalMessages']. ' posts</b> and <b>' .$modSettings['totalTopics']. ' topics</b> were created.<br />(<a href="http://www.omnimaga.org/index.php?action=stats">More Forum Statistics</a>)<br /><br /><a href="http://www.omnimaga.org/index.php?action=downloads;sa=stats">Downloads Statistics</a>';
echo 'Since Aug 25, 08, <b>' . isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , ' members</b> joined Omnimaga.<br /><br />Since May 12, 05, <b>' .$modSettings['totalMessages']. ' posts</b> and <b>' .$modSettings['totalTopics']. ' topics</b> were created.<br />(<a href="http://www.omnimaga.org/index.php?action=stats">More Forum Statistics</a>)<br /><br /><a href="http://www.omnimaga.org/index.php?action=downloads;sa=stats">Downloads Statistics</a>';
Since Aug 25, 08, 272 members joined Omnimaga.Since May 12, 05, CurrentBoardPostCount+56401 posts and CurrentBoardTopics+3126 topics were created.(More Forum Statistics)Downloads Statistics
That said, does anyone know how I would actually display a value that is combined with another? I mean like in TI-BASIC you would do:Disp "Posts since 05:",A+56401,"Topics:",B+3126
However, the other day, I searched during two hours through Google and couldn't even find any relevant result. Is that even possible at all in PHP? In my case, the ' .$modSettings['totalMessages']. ' part of my code would have been like ' .$modSettings['totalMessages'] + 56401. ', but after trial and error, no combinations would work. Seems like PHP doesn't allow two added values to be displayed together.What I want to do is display the current postcount PLUS the old board post count (this one is a fixed number.Basically in pseudo code it would be:QuoteSince Aug 25, 08, 272 members joined Omnimaga.Since May 12, 05, CurrentBoardPostCount+56401 posts and CurrentBoardTopics+3126 topics were created.(More Forum Statistics)Downloads StatisticsIs it even possible to do such thing? Since my researches failed could anyone direct me how?
echo 'Since Aug 25, 08, ', (isset($modSettings['memberCount']) ? $modSettings['memberCount'] : modSettings['totalMembers']), ' members joined Omnimaga.';echo 'Since May 12, 05, ', $modSettings['totalMessages']+56401 ,' posts and ', $modSettings['totalTopics']+3126, ' topics were created.';// the rest of the page
Quote from: DJ Omnimaga on February 05, 2010, 06:50:18 pmThat said, does anyone know how I would actually display a value that is combined with another? I mean like in TI-BASIC you would do:Disp "Posts since 05:",A+56401,"Topics:",B+3126echo command in PHP has the same behaviours as the Disp TI-BASIC command when comes to commas.Example:Ti-BASIC:Disp "One string","another",A,BPHP:echo "One string","another",$A,$BQuote from: DJ Omnimaga on February 05, 2010, 06:50:18 pmHowever, the other day, I searched during two hours through Google and couldn't even find any relevant result. Is that even possible at all in PHP? In my case, the ' .$modSettings['totalMessages']. ' part of my code would have been like ' .$modSettings['totalMessages'] + 56401. ', but after trial and error, no combinations would work. Seems like PHP doesn't allow two added values to be displayed together.What I want to do is display the current postcount PLUS the old board post count (this one is a fixed number.Basically in pseudo code it would be:QuoteSince Aug 25, 08, 272 members joined Omnimaga.Since May 12, 05, CurrentBoardPostCount+56401 posts and CurrentBoardTopics+3126 topics were created.(More Forum Statistics)Downloads StatisticsIs it even possible to do such thing? Since my researches failed could anyone direct me how? Yes, it is possible.The pseudo code to PHP code: (I tried to predicted where to get the values from the code you gave)Code: [Select]echo 'Since Aug 25, 08, ', (isset($modSettings['memberCount']) ? $modSettings['memberCount'] : modSettings['totalMembers']), ' members joined Omnimaga.';echo 'Since May 12, 05, ', $modSettings['totalMessages']+56401 ,' posts and ', $modSettings['totalTopics']+3126, ' topics were created.';// the rest of the page
global $context, $boarddir, $settings, $options, $scripturl, $user_info, $modSettings;require($boarddir.'/SSI.php');echo'<div style="font-family: verdana, arial, sans-serif;">';echo 'Since Aug 25, 08, ', (isset($modSettings['memberCount']) ? $modSettings['memberCount'] : modSettings['totalMembers']), ' members joined Omnimaga.';echo 'Since May 12, 05, ', $modSettings['totalMessages']+56401 ,' posts and ', $modSettings['totalTopics']+3126, ' topics were created.<br />(<a href="http://www.omnimaga.org/index.php?action=stats">More Forum Statistics</a>)<br /><br /><a href="http://www.omnimaga.org/index.php?action=downloads;sa=stats">Downloads Statistics</a>';