Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[Hack]Admins can change his Class.
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-12-11 09:04:17
You are alone, and you want to test some codes, you're tired by edit your class in PHPMyadmin, you need this mod!

This mod allow to change your account to any class you want, and back to your admin status. Usefull to test perms in code, etc...

Let's go:

In PHPMyAdmin run this query:

ALTER TABLE `users` ADD `changemode` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no';
Now let's go to edits:



Edit blocks/login_block.php



Find:


end_block();





Add above:





if ($CURUSER["changemode"]=="yes") {

print("<form name='mod_form_1' method=post action=changemode.php>\n");

$actualclass=$CURUSER['class'];

$class = "<option value=0>--- Nothing Selected ----</option>\n";

$query = mysql_query("SELECT group_id,level FROM groups ORDER BY level") or die;



while ($result = mysql_fetch_array($query))

$class .= "<option value=$result[group_id]" . ($actualclass == $result['group_id'] ? " selected" : "") . ">$result[level]</option>\n";



print("<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=red><b>Class Change</b></font><br/><br/><select name=class>\n$class\n</select>");

print("<br/><br/><center><input type=submit class=buton value='Submit'></center>");

print("</form>");

}

else

print("<input type=hidden name=class value=$actualclass>");

print("</form>");





Edit account-details.php



Find:



print("<tr><td>Forum Banned: </td><td align=left><input name=forumbanned value=yes type=radio" . ($forumbanned ? " checked" : "") . ">Yes <input name=forumbanned value=no type=radio" . (!$forumbanned ? " checked" : "") . ">No</td></tr>\n");





Add After:





if ($CURUSER["class"] == 7){

 print("<tr><td>Can Change Class?: </td><td align=left><input name=changemode value=yes type=radio" . ($changemode ? " checked" : "") . ">Yes <input name=changemode value=no type=radio" . (!$changemode ? " checked" : "") . ">No</td></tr>\n");

}





Note: Assuming that you have the admin class 7, if not you have to change te 7 by your admin class ID



Then Find:





$forumbanned = $user["forumbanned"] == 'yes';





Add After:





$changemode = $user["changemode"] == 'yes';







Edit admin-modtask.php



Find:





$forumbanned = $_POST["forumbanned"];





Add After:





$changemode = $_POST["changemode"];





In the query find:





forumbanned='$forumbanned',





Add after:





changemode='$changemode',



upload attached file to your root directory.

Tell me if i forget something.

Enjoy.

How to use: Edit your user in account-details.php and set teh "Can change class" to yes, you can make that to any user you want to give this feature. Use it carrefully!



Screens:





[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=3257"]changemode.php[/url]
changemode.php
Download
Unknown User
2008-12-11 15:26:04
i cannot promote myself once dmoeting wont let me re promote

aghh my bad sorry, i had to change 7 to 9 in userclass.. works great thank you very much for this.

oh, owner still has to go into database to set change class to yes in databse.
Unknown User
2008-12-11 21:39:44
No if you're admin you have juste to edit yourself and put the changenode to yes.
Unknown User
2008-12-13 14:08:05
very usefull hack  :D

thanks a lot nightmare :D
Unknown User
2008-12-16 01:02:04
You welcome AzuriS I think lot of people doesn't understand what this hack realy does   :D   :D
Unknown User
2008-12-16 17:09:45
This will ease me many things.

Thank you for this mod

*Cela va me facilit
Unknown User
2008-12-24 06:50:21
thnx m8!  usefull mod!

change mode works fine but i have a litle prob.......the change mod i made it from php my admin and not from profile as you have in img.

if i mist something teel me to fix it................and something else that option can be into a block?
Unknown User
2008-12-28 21:45:36
Dont understand what you mean
Unknown User
2009-02-18 22:52:08
"nightmare, post: 50842":
Dont understand what you mean
I believe what world meant was that you have to set changemode to yes for yourself (and any other admins) in phpmyadmin rather than in account-details.php, because its not possible to amend users at your own level. No worries... its simple enough to sort.

Brilliant hack tho thanks  :lol:

Not sure how useful it is to put the radio button in everyones account details.php tho, altho the mod itself is extremely useful.

One hiccup with it tho...  if you select "nothing selected" it sets you to pre-confirmed status and throws you offsite   ;)

May be worth warning people of that
Unknown User
2009-02-28 20:09:24
Great hack- bye bye test account lol. works a treat on tt2.05
Unknown User
2009-03-15 02:06:59
Big thanks for this mod...

Works well on tt 2.05 :rolleyes:
Unknown User
2009-07-18 13:19:48
Working perfect.

Just wonder one thing.

Let
Unknown User
2009-07-18 15:44:25
Thanks for that mod :)
Unknown User
2009-07-18 17:54:43
look at this

	if ($CURUSER["class"] > $user["class"]){

print("<tr><td>Class</td><td align=left><select name=class>\n");

$maxclass = $CURUSER["class"];

for ($i = 1; $i < $maxclass; ++$i)

print("<option value=$i" . ($user["class"] == $i ? " selected" : "") . ">$prefix" . get_user_class_name($i) . "\n");

print("</select></td></tr>\n");

}


u cud incorporate this from account details this makes it show them one less then they are i think...
Unknown User
2013-04-14 09:55:58
TT  2-svn

account-details

find
if ($CURUSER["class"] == 7){
 print("<tr><td>Can Change Class?: </td><td align=left><input name=changemode value=yes type=radio" . ($changemode ? " checked" : "") . ">Yes <input name=changemode value=no type=radio" . (!$changemode ? " checked" : "") . ">No</td></tr>n");
}

change

if ($CURUSER["class"] == 7){
   print("<tr><td>".T_("Can_Change-Class")." </td><td align=left><input name=changemode value=yes type=radio" . ($changemode ? " checked" : "") . ">Yes <input name=changemode value=no type=radio" . (!$changemode ? " checked" : "") . ">No</td></tr>n");
}

admin-modtasks

find

$changemode = $_POST["changemode"];


change

$changemode = sqlesc($_POST["changemode"]);


find

changemode='$changemode',


change


changemode=$changemode,

login block


find
print("<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=red><b>Class Change</b></font><br/><br/><select name=class>n$classn</select>");
print("<br/><br/><center><input type=submit class=buton value='Submit'></center>");
print("</form>");
}

change

print("<br/><b>".T_("Can_Change-Class")."</b><br/><select name=class>n$classn</select>");
   print("<br/><br/><center><input type=submit class=buton value='Submit'></center>");
   print("</form>");
}

english.php


add

$LANG["Can_Change-Class"] = "Class Change";



french.php


add


$LANG["Can_Change-Class"] = "Changement de classe";


changemode.php

find

mysql_query

change

SQL_Query_exec
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728