Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Remove ability to unfreeze? (http://www.mysidiaadoptables.com/forum/showthread.php?t=2313)

SilverDragonTears 08-17-2011 07:33 PM

Remove ability to unfreeze?
 
I really need this b.c with my 5 egg limit they can freeze and egg and then adopt one and then unfreeze it and then have 6 eggs...

not cool >.>

ipengu 08-17-2011 08:21 PM

Not fine tuned, very basic.


Open: myadopts.php

Find: (Around line 516)
PHP Code:

else if($act == "freeze"){ 

Replace with:
PHP Code:

else if($act == "freeze"){

$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){ 

Find: (Around line 607)
PHP Code:

else{

$article_title $err_idnoexist;
$article_content $err_idnoexist_text;

}




Add after:
PHP Code:

//Allow only admins to freeze/unfreeze
else{

$article_title $err_nofrzperm;
$article_content $err_nofrzperm_text;

}



Open: lang/lang.php

Find: (Around line 50)
PHP Code:

$err_idnoexist "Invalid Adoptable ID Specified";
$err_idnoexist_text "The ID specified does not match any adoptable in our system.  Sorry.  If you wish, you can <a href='adopt.php'>adopt a pet</a>."

Add After:
PHP Code:

$err_nofrzperm "No Permission";
$err_nofrzperm_text "You do not have correct permission to do this action. <a href='javascript:history.go(-1)'>Click here to go back.</a>"

I'd also suggest removing the link.

This just fully removes the freeze/unfreeze to everyone but people whom can use admin cp. If you want them ability to freeze, but not unfreeze its honestly a matter of skipping the first chunk and just putting it lower down in the freeze section of myadopts.php

SilverDragonTears 08-17-2011 08:40 PM

Before I read this I just removed the unfreeze link and tweaked some other things... so I guess it's working.

Can you help me with disallowing frozen abandoned pets to show up in the pound?

ipengu 08-17-2011 08:48 PM

Decided to do it up quick before I go to work, for freeze but no unfreeze unless they can see admin cp


Open: myadopts.php
Find: (Around line 549)
PHP Code:

if($isfrozen == "yes"){

$status "<img src='templates/icons/freeze.gif'> Frozen<br>";
$go "<a href='myadopts.php?act=freeze&id=".$id."&more=unfreeze'><img src='templates/icons/unfreeze.gif' border=0> Unfreeze This Adoptable</a>";


Replace with:
PHP Code:

if($isfrozen == "yes"){

$group getgroup();
$cancp cancp($group);

if(
$cancp == "yes"){
$status "<img src='templates/icons/freeze.gif'> Frozen<br>";
$go "<a href='myadopts.php?act=freeze&id=".$id."&more=unfreeze'><img src='templates/icons/unfreeze.gif' border=0> Unfreeze This Adoptable</a>";
}
else{
$status "<img src='templates/icons/freeze.gif'> Frozen<br>";
$go "You are not allowed to unfreeze this adoptable. <a href='javascript:history.go(-1)'>Click here to go back.</a>";
}



Let's also remind them when they are going to freeze the adoptable that they will not be able to unfreeze it

Open: lang/lang.php
Find: (Around line 95)
PHP Code:

$lang_freeze_warning "<img src='templates/icons/warning.gif'> <b>WARNING:</b> Freezing an adoptable REJECTS any clicks that the adoptable receives while it is frozen.  
Users who click on this adoptable while it is frozen will see a message stating that their click DID NOT COUNT towards this adoptable's leveling.  By enabling 
a freeze on this adoptable you are essentially rejecting all further clicks until the adoptable is unfrozen.  In addition, some management features of this adoptable may be disabled until you unfreeze it."


Replace with:
PHP Code:

$lang_freeze_warning "<img src='templates/icons/warning.gif'> <b>WARNING:</b> <FONT COLOR='red'><b>You will not be able to unfreeze this adoptable after you have frozen it.</b></FONT> Freezing an adoptable REJECTS any clicks that the adoptable receives while it is frozen.  
Users who click on this adoptable while it is frozen will see a message stating that their click DID NOT COUNT towards this adoptable's leveling.  By enabling 
a freeze on this adoptable you are essentially rejecting all further clicks until the adoptable is unfrozen.  In addition, some management features of this adoptable may be disabled until you unfreeze it."



ipengu 08-17-2011 08:50 PM

Well removing the link will work for the most part, but if someone happen to remember the link to freeze/unfreeze a pet they could easily manually enter it into the url bar. I don't have time to look at the pound script or how it shows the adoptables, but I'll work after I get out of work tomorrow morning, I don't guarantee anything on that though, I may or may not be able to mess with it enough. If it deals with messing with more than a few files I likely won't bother with it as it then becomes more work than its worth to repost all the steps

SilverDragonTears 08-17-2011 09:21 PM

Ok I followed your steps =) Feel more comfortable with it now =)

Nemesis 08-17-2011 09:53 PM

Really glad to have someone as helpful as ipengu, though i dont think you have introduced yourself.

And SDT your members are little basterds lol:D

SilverDragonTears 08-17-2011 10:06 PM

bahahahahahaha!! Not all of them =) Any idea how to fix the abandoned thing Nem?

Nemesis 08-17-2011 10:29 PM

sorry but no. I really want to help though, so I am currently learning php, then i'll have to figure out the script. then we will see what i can do but don't expect help from me till like after Christmas when i can be of help.

SilverDragonTears 08-17-2011 10:33 PM

eh. i'm sure i'll get it eventually. just been overloaded with coding my site lately... gets tiring.

ETA:
*does happy dance*

I did it!! I did it!! Yea you know I did it!!


All times are GMT -5. The time now is 02:10 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.