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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-14-2012, 01:14 PM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 7,907
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
 


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 11:50 AM
Pyrkagias is in the place. Pyrkagias Newcomer Center 5 09-06-2011 08:17 PM
amount of users currently online Tony Suggestions and Feature Requests 1 02-06-2011 10: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 01:57 PM
No place to enter Ad Code Tequila Questions and Supports 7 04-20-2009 06:25 PM


All times are GMT -5. The time now is 01:29 PM.

Currently Active Users: 9610 (0 members and 9610 guests)
Threads: 4,080, Posts: 32,024, 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