Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2011, 01:01 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: 490,699
Hall of Famer is on a distinguished road
Default Create/Edit/Delete user's owned adoptables through acp!

Well I've finished this modification after several hours of work last night. This version of Create/Edit/Delete user's individual pets does not have pagination when showing a list of adoptables to edit though, which will be added later. It is projected to be a new feature available in Mysidia Adoptables v1.2.0 too, incase you wonder.

This Mod is a lot easier to install and use than my previous custom scripts. All you have to do is to download the two files cadopt.php and eadopt.php, and then edit admin.php just a little bit. The script files are attached at the end of this post, just place them in the root folder of Mysidia Adoptables(the same directory as doadopt.php and myadopts.php). To edit admin.php, find the following lines below:

PHP Code:
    else if($do == "groups"){

    
//******************************************************************************************************
    // USERGROUP MANAGEMENT PAGE HERE >>>
    //******************************************************************************************************
    
    
if($more == ""){

    
// No action specified for the usergroups, so show some basic information...

    
$article_title "Manage Usergroups";
    
$article_content "This page allows you to manage the usergroups available to you and your site's users.  
    Usergroups are a powerful feature as they determine who can access what parts of the site and which functions they can use.
    Here you can create and manage administrative user groups, artist user groups, donator user groups, custom user groups, and more.
    Use the table below to edit existing usergroups, or click the link below to create a custom usergroup.<br><br>
    <b><a href='admin.php?set=users&do=groups&more=new'><img src='templates/icons/add.gif' border=0> Create a New Usergroup</a></b><p></p><table width='680' border='1'><tr>
    <td><strong>Group ID:</strong></td>
    <td><strong>Group Name: </strong></td>
    <td><strong>Can Adopt Pets: </strong></td>
    <td><strong>Can Use PM System: </strong></td>
    <td><strong>Can Access Admin CP: </strong></td>
    <td><strong>Edit:</strong></td>
    <td><strong>Delete:</strong></td>
  </tr>"

Add above:

PHP Code:
  else if($do == "adoptables"){
    if(
$more == ""){
          
$article_title "Manage Adoptables";
        
$article_content "This page allows you to manage each adoptable owned by users registered on your site. Only admins who can edit users and usergroups can carry out this task.
        Use the table below to edit existing adoptables, or click the link below to create a new adoptable for a user.<br><br>
    <b><a href='admin.php?set=users&do=adoptables&more=new'><img src='templates/icons/add.gif' border=0> Create a New Owned Adoptables</a></b><p></p><table width='680' border='1'><tr>
    <td><strong>Adoptables ID:</strong></td>
    <td><strong>Adoptables Type: </strong></td>
    <td><strong>Adoptables Name: </strong></td>
    <td><strong>Adoptables Owner: </strong></td>
    <td><strong>Adoptables Gender: </strong></td>
    <td><strong>Edit:</strong></td>
    <td><strong>Delete:</strong></td>
    </tr>"
;

 
// Get the adoptables from the database...

    
$query "SELECT * FROM ".$prefix."owned_adoptables";
    
$result mysql_query($query);
    
$num mysql_numrows($result);

    
//Loop out code
    
$i=0;
    while (
$i $num) {

            
$aid=@mysql_result($result,$i,"aid");
            
$type=@mysql_result($result,$i,"type"); 
            
$name=@mysql_result($result,$i,"name");
            
$totalclicks=@mysql_result($result,$i,"totalclicks");
            
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
            
$usealternates=@mysql_result($result,$i,"usealternates");
            
$isfrozen=@mysql_result($result,$i,"isfrozen");
            
$owner=@mysql_result($result,$i,"owner");
            
$gender=@mysql_result($result,$i,"gender");

    
$editimage "<a href='admin.php?set=users&do=adoptables&more=edit&evenmore=".$aid."'><img src='templates/icons/cog.gif' border=0></a>";
    
$deleteimage "<a href='admin.php?set=users&do=adoptables&more=delete&evenmore=".$aid."'><img src='templates/icons/delete.gif' border=0></a>";
    

    
// Finally we can show this table to the user...

    
$article_content $article_content."<tr>
    <td>"
.$aid."</td>
    <td>"
.$type."</td>
    <td><div align='center'>"
.$name."</div></td>
    <td><div align='center'>"
.$owner."</div></td>
    <td><div align='center'>"
.$gender."</div></td>
    <td><div align='center'>"
.$editimage."</div></td>
    <td><div align='center'>"
.$deleteimage."</div></td>
  </tr>"
;
    
    

    
$i++;
    }

    
$article_content $article_content."</table>";
    
    }   

else if(
$more == "new"){

         
// We are now creating a new adoptable 
         
$article_title "Create an adoptable for a user";
         
$article_content "This page allows you to create a new adoptable for a given user on your site.
         Please fill in the form below and hit the <i>Create Adoptable</i> button below when you're ready to create this adoptable.
         <form name='form1' method='post' action='cadopt.php'>
         <p><u><strong>Create A New Adoptable For a User:</strong></u></p>
         <p><strong>Basic Information: </strong></p>
         <p>Adoptable Type: 
         <input name='type' type='text' id='type'>
         <br>
         <p>Adoptable Name: 
         <input name='name' type='text' id='name'>
         <br>
         <p>Adoptable Owner: 
         <input name='owner' type='text' id='owner'>
         <br>
         <p>Adoptable Clicks: 
         <input name='clicks' type='text' id='clicks'>
         <br>
         <p>Adoptable Level: 
         <input name='level' type='text' id='level'>
         <br>
         <p>Use Alternative?
         <input name='usealternates' type='text' id='usealternates'>
         <br>
         <p>Adoptable Gender
         <input name='gender' type='text' id='gender'>
         <br>
         <p>
         <input type='submit' name='Submit' value='Create This Adoptable'> 
         </p>
         <p>&nbsp; </p>
         </form>"
;
      }   

      else if(
$more == "edit"){
          
// We are editing an existing owned adoptable.
          // $evenmore is the adoptable ID...
      
          
$aid $evenmore;
 
          
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$aid'";
          
$result mysql_query($query);
          
$num mysql_numrows($result);
  
          if(
$num 0){
          
// This owned adoptable exists, so fetch some basic information...   

          
$article_title "Owned Adoptables Editor - Editing ".$aid."'s Data";
          
$article_content "Here you can edit this owned adoptable using the form below.<br>";

          
//Loop out code
          
$i=0;
            while (
$i 1) {

            
$aid=@mysql_result($result,$i,"aid");
            
$type=@mysql_result($result,$i,"type"); 
            
$name=@mysql_result($result,$i,"name");
            
$totalclicks=@mysql_result($result,$i,"totalclicks");
            
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
            
$usealternates=@mysql_result($result,$i,"usealternates");
            
$isfrozen=@mysql_result($result,$i,"isfrozen");
            
$owner=@mysql_result($result,$i,"owner");
            
$gender=@mysql_result($result,$i,"gender");

            
$i++;
            }

          
$article_content $article_content."<form name='form1' method='post' action='eadopt.php'>
          <p>Change Adoptable's Type: 
          <input name='type' type='text' id='type' value='"
.$type."'>
          </p>
          <p>Change Adoptable's Name: 
          <input name='name' type='text' id='name' value='"
.$name."'>
          </p>
          <p>Change Adoptable's Owner: 
          <input name='owner' type='text' id='owner' value='"
.$owner."'>
          </p>
          <p>Change Adoptable's total clicks: 
          <input name='totalclicks' type='text' id='totalclicks' value='"
.$totalclicks."'>
          </p>
          <p>Change Adoptable's current level: 
          <input name='currentlevel' type='text' id='currentlevel' value='"
.$currentlevel."'>
          </p> 
          <p>Change Adoptable's gender: 
          <input name='gender' type='text' id='gender' value='"
.$gender."'>
          </p> 
          <input name='aid' type='hidden' id='aid' value='"
.$aid."'>
          <p>
          <input type='submit' name='Submit' value='Submit'>
          </p>
          </form>"
;
        } 
      } 
 
     else if(
$more == "delete"){
        
$aid $evenmore;

        
// We are deleting an owned adoptable...

        
$query "DELETE FROM ".$prefix."owned_adoptables WHERE aid='".$evenmore."'";
          
mysql_query($query);

        
$article_title "Adoptable Deleted";
        
$article_content "This owned adoptable has been deleted successfully.";
    

        } 

  } 
Next, find the following codes a few lines after the last one:

PHP Code:
</p></form><b><a href='admin.php?set=users&do=groups'><img src='templates/icons/fr.gif' border=0Manage Usergroups and Permissions</a></b><br><table width='302' border='1'>
  <
tr>
    <
td width='100'><strong>Username:</strong></td>
    <
td width='60'><strong>Email:</strong></td>
    <
td width='60'><strong>Usergroup:</strong></td>
    <
td width='32'><strong>Edit:</strong></td>
    <
td width='50'><strong>Delete:</strong></td>
  </
tr>"; 
Add above:

PHP Code:
   </p></form><b><a href='admin.php?set=users&do=adoptables'><img src='templates/icons/fr.gif' border=0Manage User's Owned Adoptables</a></b><br><table width='302' border='1'> 
I also attached my version of admin.php, for those of you who havent edited that script on your own server. Report to me if it does not work out for you, and I will see what I can do to help you.

The create/edit/delete user's individual pets page can be accessed by clicking on Edit User's tab in acp. A few screenshots are attached below for reference:

Screenshot1: The Edit Users/Usergroups/OwnedAdoptables page:



Screenshot2: The subpage of Create/Edit/Delete user's individual pets:


Screenshot3: Creating new owned adoptables


Screenshot4: Editing existing owned adoptables


Screenshot5: Deleted an owned adoptable successfully
Attached Files
File Type: php cadopt.php (6.2 KB, 11 views)
File Type: php eadopt.php (7.0 KB, 11 views)
File Type: php admin.php (86.7 KB, 4 views)
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #2  
Old 01-21-2011, 02:34 PM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 38,548
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

Looks good Famer!
Reply With Quote
  #3  
Old 01-21-2011, 02:55 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: 490,699
Hall of Famer is on a distinguished road
Default

Thank you for your comments Kaeliah, this is my first script to be used by Mysidia Adoptables official releases. ^^ Too bad I still cant figure out the trick of pagination. XD
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 01-21-2011, 09:50 PM
Kyris Kyris is offline
Member
 
Join Date: Jan 2011
Posts: 34
Gender: Female
Credits: 5,722
Kyris is on a distinguished road
Default

Have you been reading my mind?! XD I've been trying to look around for a feature to add a specific pet to an owner :)
Reply With Quote
  #5  
Old 01-22-2011, 04:25 AM
Kyris Kyris is offline
Member
 
Join Date: Jan 2011
Posts: 34
Gender: Female
Credits: 5,722
Kyris is on a distinguished road
Default

Question ^^ When creating an adoptable for the user, how do you link the pet image in the form?
Reply With Quote
  #6  
Old 01-23-2011, 10:16 PM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,837
fadillzzz is an unknown quantity at this point
Default

As far as I know, the mod supposed to add the image based on what adoptables type is given by the admin
Reply With Quote
  #7  
Old 01-24-2011, 12:03 AM
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: 490,699
Hall of Famer is on a distinguished road
Default

Well Kyris, the adoptables images should be pre-defined when you create an adoptable species an its levels. Remember this one is for admins to create/edit/delete user's individual pets, not species.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #8  
Old 01-24-2011, 03:45 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: 490,699
Hall of Famer is on a distinguished road
Default

Update: fadillzzz helped me add pagination to the script, it works pretty well. Thank you so much dude, the finalized version is ready to be released now. Just download this new admin.php file and replace your old one with it, keep in mind that you will have to manually change things back if you've made any other modifications in your admin.php file. Enjoy.
Attached Files
File Type: php admin.php (86.7 KB, 2 views)
__________________


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
Creating a "Faction" for adoptables/owned adoptables Vaporman87 Questions and Supports 1 03-04-2014 04:38 PM
Can't delete adoptables from the site. Please help! Elanorae Questions and Supports 1 08-12-2013 02:12 PM
Can not edit adoptables level GuardiansWish Questions and Supports 9 12-06-2012 06:11 PM
can edit specific adoptables in the AdminPanel ? kratosvr Questions and Supports 1 08-13-2011 03:59 AM
Edit/ delete shoutbox posts rickasawr Suggestions and Feature Requests 4 05-05-2011 05:17 PM


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

Currently Active Users: 683 (0 members and 683 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