View Full Version : Remove ability to unfreeze?
SilverDragonTears
08-17-2011, 07:33 PM
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)
else if($act == "freeze"){
Replace with:
else if($act == "freeze"){
$group = getgroup();
$cancp = cancp($group);
if($cancp == "yes"){
Find: (Around line 607)
else{
$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;
}
}
Add after:
//Allow only admins to freeze/unfreeze
else{
$article_title = $err_nofrzperm;
$article_content = $err_nofrzperm_text;
}
}
Open: lang/lang.php
Find: (Around line 50)
$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:
$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)
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:
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)
$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:
$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!!
ipengu
08-18-2011, 07:19 AM
Yea never did an introduction as I'd have not much to say, my site is currently not public till my artists get some more things drawn and I get a response from someone about something else.
Also I'm far from being great at php/mysql, I just pick things up (like how the script works for most part) quick then branch off it. I'm definitely more of a marketing/advertising type of person or the one that just manages all the business. But if a boss can't get their hands dirty sometimes theres just no fun in it.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.