Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-14-2012, 02:14 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 9,103
schepers12 is on a distinguished road
Default place the money amount user has where you want to

hello all, i saw some people on this board wanted to have a separate money bar for the script (saw it in a very old post), well, here it is~ :3c

instructions provided in the board aswell the zip file~



please don't shoot me if i did something wrong, i'm a human and i do make mistakes, so please back-up your adoptables site before you start~!

It works for me though.. :3c


instructions below:

replace he original functions "getlinks, getsidebar" by these 3 functions in the main function file by this:
PHP Code:
function getlinks(){
$isloggedin $GLOBALS['isloggedin'];
if(
$isloggedin == "yes"){
//This function gets the links for the top bar from the database 
// We will be getting our links from the database...
    
$links "<div class='ddmenu'>\n
             "
;
             
    
$stmt $GLOBALS['adopts']->select("links", array(), "linkparent < 1 ORDER BY id ASC");
        
    while (
$category $stmt->fetchObject()) {
        
$links .= "\n <a class='hide' href='{$category->linkurl}'>{$category->linktext}</a><br />
               \n"
;
        
$stmt2 $GLOBALS['adopts']->select("links", array(), "linkparent='{$category->id}' ORDER BY id ASC");
        while(
$item $stmt2->fetchObject()){
            
$links .= "&nbsp; - &nbsp; <a href='{$item->linkurl}' title='{$item->linktext}'>{$item->linktext}</a><br />";      
        }
        
$links .= "
              \n"
;
    }
    
    
$links .= "\n";
} else {
    
$links "Please login or register first!";
}
    return 
$links;

--------------------------------
--IF YOU HAVE THE HOUSE MOD INSTALLED, ADD THIS FUNCTION (under the getlinks function):
--
PHP Code:
function getmoney() {
    
$isloggedin $GLOBALS['isloggedin'];
    
$loggedinname $GLOBALS['loggedinname'];
    if(
$isloggedin == "yes") {
        
$sideba "- You have {$GLOBALS['money']} {$GLOBALS['settings']['cost']}. <a href='donate.php'>Donate to users</a>";
        
$sideba .= "<br />- you have {$GLOBALS['houses']} houses. <a href='houses.php'>Buy more houses</a>";
    } else { 
$sideba ""; }
    return 
$sideba;

--------------------------------
--OTHERWISE, USE THIS:
PHP Code:
function getmoney() {
    
$isloggedin $GLOBALS['isloggedin'];
    
$loggedinname $GLOBALS['loggedinname'];
    if(
$isloggedin == "yes") {
        
$sideba "You have {$GLOBALS['money']} {$GLOBALS['settings']['cost']}. <a href='donate.php'>Donate to users</a>";
    } else { 
$sideba ""; }
    return 
$sideba;

--------------------------------

PHP Code:
function getsidebar() {
    
//This function determines what shows in the side bar of the template
    
$isloggedin $GLOBALS['isloggedin'];
    
$loggedinname $GLOBALS['loggedinname'];
    if(
$isloggedin == "yes") {
        
$msgctr "<a href='messages.php'>Messages</a>";        
        
$data $GLOBALS['adopts']->select("messages", array(), "touser='{$loggedinname}' and status='unread'")->fetchAll();

        if(
count($data) > 0) {
            
$msgctr "<a href='messages.php'>Messages <b>(".count($data).")</b></a>";
        }
        
$sidebar "
        <strong>Your links:</strong><br />
        <ul><li><a href='adopt.php'>Adopt New Pets</a></li>
        <li><a href='pound.php'>Acquire Pounded Pets</a></li>
        <li><a href='myadopts.php'>Manage Adoptables</a></li>
        <li><a href='account.php'>Go to My Account</a></li>
        <li>
{$msgctr}
        <li><a href='changestyle.php'>Change Theme</a></li>
        <li><a href='logout.php'>Log Out</a></li>"
;



    
$wpath =$GLOBALS['houses'];
    
$housing $wpath;
    
$sidebar.= "<li><a href='houses.php'>you have {$housing} houses</a></li>";
        
$row $GLOBALS['adopts']->select("users", array(), "username='{$loggedinname}' and usergroup='1'")->fetchObject();        
        if(
is_object($row)) $sidebar .= "<li><a href='admincp/index.php'>Admin Center</a></li><br />";

        
$row1 $GLOBALS['adopts']->select("online", array(), "username != 'Visitor'")->fetchAll();
        
$total1 count($row1);
        
$row2 $GLOBALS['adopts']->select("online", array(), "username = 'Visitor'")->fetchAll();
        
$total2 count($row2);
        
$sidebar .= "<a href='online.php'>This site has {$total1} members and {$total2} guests online.</a></ul>";
    }
    else {
        
$sidebar "<b><u>Member Login:</u></b><br />
        <form name='form1' method='post' action='login.php'>
          <p>Username: 
            <input name='username' type='text' id='username'>
        </p>
          <p>Password: 
        <p>    <input name='password' type='password' id='password'>
        </p>
          <p>
            <input type='submit' name='Submit' value='Log In'>
          </p>
        </form>Don't have an account?<br /><a href='register.php'>Register Free</a><br /><a href='forgotpass.php'>Forgot Password?</a>"
;
        
$row1 $GLOBALS['adopts']->select("online", array(), "username != 'Visitor'")->fetchAll();
        
$total1 count($row1);
        
$row2 $GLOBALS['adopts']->select("online", array(), "username = 'Visitor'")->fetchAll();
        
$total2 count($row2);
        
$sidebar .= "<br />This site currently has {$total1} members and {$total2} guests.";

    }
    return 
$sidebar;

_____________________________


then add the -modified- template "elements" in the templates folder, replace the original (difference with original is that the center is 800px wide in this mod)

______________________________
last:
replace the function showpage (almost at the end of the functions file) by this:


PHP Code:
function showpage($title$content$date) {
    
$theme $GLOBALS['usersettings']['theme'];
    if (
$theme == ''$theme grabanysetting("theme");
    
$acpthemeurl "../templates/acp/template.html";
    
$themeurl "templates/{$theme}/template.html";
    
$patterns = array("/:ARTICLETITLE:/","/:ARTICLECONTENT:/""/:ARTICLEDATE:/""/:BROWSERTITLE:/""/:SITENAME:/""/:SLOGAN:/""/:LINKSBAR:/""/:SIDEFEED:/""/:MONEY:/""/:ADS:/");
    
// if we have said we are in an admin area, don't show ads and show admin links
    
if (defined("SUBDIR") and SUBDIR == "AdminCP") {
        
$replacements = array($title$content$dategrabanysetting("browsertitle")." ".$titlegrabanysetting("sitename"), grabanysetting("slogan"), getadmlinks(), getsidebar(), getmoney(), "");
         
$template file_get_contents($acpthemeurl);
    }
    else {
        
$replacements = array($title$content$dategrabanysetting("browsertitle")." ".$titlegrabanysetting("sitename"), grabanysetting("slogan"), getlinks(), getsidebar(),getmoney(), getads("any"));
         
$template file_get_contents($themeurl);
    }
    
// now that we have our stuff, let's start making it all into a webpage

    
$template =  preg_replace($patterns$replacements$template);
    return 
$template;

this modification is compatible with MYS 1.3.1
and provided by me~ :3
i hope you will enjoy this mod~ ^^
Attached Files
File Type: zip seperate money bar.zip (111.1 KB, 3 views)
__________________
~
Reply With Quote
  #2  
Old 11-18-2012, 01:47 PM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 12,564
draugluin is on a distinguished road
Default

great !!!!

but I think, there's a little mistake in function getmoney. I've missed the r

Quote:
function getmoney() {
-- $isloggedin = $GLOBALS['isloggedin'];
-- $loggedinname = $GLOBALS['loggedinname'];
-- if($isloggedin == "yes") {
-- $sidebar = "You have {$GLOBALS['money']} {$GLOBALS['settings']['cost']}. <a href='donate.php'>Donate to users</a>";
-- } else { $sidebar = ""; }
-- return $sidebar;
--}
but with "r" it works.

thank you
Reply With Quote
  #3  
Old 11-19-2012, 03:32 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 9,103
schepers12 is on a distinguished road
Default

it's not an mistake, since it's a seperate variable, which is only used in this function, and it's called in the
Code:
:MONEY:
function in the template~ ;)
__________________
~
Reply With Quote
  #4  
Old 11-19-2012, 10:41 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 491,911
Hall of Famer is on a distinguished road
Default

Yeah, it really does not matter how you name your variable. The template finds patterns begins and ends with colon :, and replace them with php variables.

Anyway in Mys v1.3.3 or v1.3.4 I plan to make all GUI components into modules. This way you can manage their location on the screen with ease.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


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
Limit amount of clicks per day SilverDragonTears Questions and Supports 15 11-29-2011 12:50 PM
Pyrkagias is in the place. Pyrkagias Newcomer Center 5 09-06-2011 09:17 PM
amount of users currently online Tony Suggestions and Feature Requests 1 02-06-2011 11:20 PM
Dunno how to make my own site. (not sure if this is the right place) Thalia Questions and Supports 1 06-16-2010 02:57 PM
No place to enter Ad Code Tequila Questions and Supports 7 04-20-2009 07:25 PM


All times are GMT -5. The time now is 01:18 AM.

Currently Active Users: 777 (0 members and 777 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636