Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-16-2014, 02:09 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 137,188
Kyttias is on a distinguished road
Default

+Bump plus more examples of possibilities:

(If using the $cash variable set in the above post!)
Code:
{if $cash < 7777}User has more than 7777 currency!{/if}
{if $cash > 7777}User has less than 7777 currency!{/if}
Adding in a user's online variable to classes/class_template.php:
PHP Code:
$online $mysidia->db->select("online", array(), "username != 'Visitor'")->rowCount();
$this->assign("online","{$online} Users Online"); 
To be used like (this will link to a page that shows who is online):
Code:
<a href="{$home}online">{$online}</a>
Another possible use:
Code:
{if $online > 50}More than 50 users online!{/if}
{if $online < 10}Less than 10 users online!{/if}
You could also use these (in addition to the two variables above to check for users online) in classes/class_template.php:
PHP Code:
$guests $mysidia->db->select("online", array(), "username = 'Visitor'")->rowCount();
$this->assign("population","{$online} Users Online + {$guests} Guests"); 
Then you would use {$population} to print out something like "10 Users Online + 5 Guests". Perhaps it'd look nice in a footer, if that fits your site? This could also be used in an 'if' statement if you wanted something to happen if you had a certain number of guests online at once! Get creative. ^^

And back into classes/class_template.php, you can set up messages to display at specific times of the day (server time - good for promo codes people can't cheat and use their computer's clock to get):

PHP Code:
$now = new DateTime();        
$hrs $now->format('G');
if (
$hrs >  0$msg "<b>After Hours Promo Code:</b> PC0000"// After midnight
if ($hrs >  5$msg "<b>Dawn Promo Code:</b> PC0005"// After 5am
if ($hrs >  7$msg "<b>Morning Promo Code:</b> PC0507"// After 7am
if ($hrs 12$msg "<b>Afternoon Promo Code:</b> PC0712"// After noon
if ($hrs 17$msg "<b>Evening Promo Code:</b> PC1217"// After 5pm
if ($hrs 22$msg "<b>Dusk Promo Code:</b> PC1722"// After 10pm
$this->assign("timemsg",$msg); 
These would be displayed with {$timemsg}.

Keep it mind that you can infinitely combine if statements with Smarty in your template. So imagine something with a 20% chance of happening only if it is between noon and five and there are less than x amount of people online.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tips for theme? Abronsyth Templates and Themes 6 01-03-2013 06:04 PM
Any tips for writing a TOS? Kesstryl Feedback and Suggestions 5 03-30-2012 06:37 PM
Some Site Planning Tips Tequila Tutorials and Tips 2 04-08-2011 09:17 AM
Templates CrystalShards Suggestions and Feature Requests 1 07-18-2009 12:48 PM
templates aroymart Questions and Supports 15 02-18-2009 01:46 PM


All times are GMT -5. The time now is 06:04 AM.

Currently Active Users: 2392 (0 members and 2392 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636