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
Cross Reference for v2.xx
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / General / General Chat

Unknown User
2008-03-28 23:46:36
Here is a list of common Torrent Trader code usage and there meanings from my knowledge. I will update it when I think of more but I am going to try to list some of the common ones today. some of these are taken from post throughout the site so no

on almost everypage you need this. if you do not have it then you page may not function correctly because it is like a brain for invidual pages:

require_once ("backend/functions.php");
this is if you are going to use bbcode in your page. it is basically a function file for bbcode:




require_once ("backend/bbcode.php");





this is for when you want to hide things from non members. put the code you want to hide in between the { and the }:





if ($CURUSER){   }





this is for when you want to hide things from members and let only non members see it. put the code you want to hide in between the { and the }:





if (!$CURUSER){   }





this is for restricted things to staff panel:





if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

show_error_msg("Error","Sorry you do not have the rights to access this page!",1);

}





this is your typical error message. the message goes in between the quotes:





show_error_msg(" ",1);





this is if you would like to restrict by class. the number is the class number. note the error message does not always have to be in there. you can restrict without the error message. but if you do not use the error message then put the code you want to restrict between the { and the }:





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

show_error_msg("Error","Sorry you do not have the rights to view this page!",1);

}





if you want to restrict certain frames or blocks then wrap the code in this. the number is the class you want to restrict or only show it to.





if ($CURUSER["class"] < "4"){



}





this begins a frame. in between the quotes you can give the block a name:





begin_frame("");





this ends a frame:





end_frame();





this begins a block:





begin_block(" ");





this ends a block:





end_block();





this is for your header and usually goes before the begin frame or begin block. if you have more than one frame or block then you should on use this one time in the begining:





stdhead(" ");





this is for your footer and usually goes after the end frame or end block. if you have more than one frame or block then you should on use this one time in the end:





stdfoot();





this is one way of conecting to the mysql db along with the die function:





mysql_query(" ") or die(mysql_error());





this is another way to connect to the mysql db:





$query = " ";

mysql_query($query);




when i have some more time and think of some of the other things i will add it. I hope this will help some peeps and cut down on some questions pertaining to this. enjoy :D
Unknown User
2008-03-29 00:50:06
Nice work.

But you should add some little showoff.

Like a little and simple example Hello-World-Page with a MySQL-Query.

Maybe reading out the last uploaded torrent by that user and a admin function to see who uploaded the last torrent and what it is.

So the new users can see an example and try that too and learn easier :D
Unknown User
2008-03-29 11:36:42
show_error_msg("Heading", "Text", 0|1); 0 lets the page finish, 1 makes it exit

begin_block("Heading", "Align");

begin_frame("Heading", "Align");

dbconn(true|false); // connects to database, true to run cleanup if needed (default true)

loggedinonly(); // show the page only to members
Unknown User
2009-11-17 23:24:59
Hi

Great post  ;)

One thing only...

in my script it looks like this:

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

{

}

(TT v 2.03)

What is the correct code if I want to allow that all with say userclass 7 and up to 9 (highest) can see it only?

If I add this code only userclass 7 can view the part of the code on the page, but class 8 and 9 cant.

Can you help me out?
Unknown User
2009-11-20 11:55:48
this will work

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

{

}
it is the quickest way to do it but the safest way which uses more code is




if ($CURUSER["class"] ==7 || $CURUSER["class"] ==8 || $CURUSER["class"] ==9) 

{

}



the reason the above one is safer is because it will only allow class 7, 8 or 9 and nothing above. it will cover you incase there is some kind of problem with your php or with the torrent trader script. for example if there is a bug in either it it allows lets say class 10 even though there isn't one or if you make a higher class for some reason and it is a normal user class, which you should never do, then by adding wach individual class you do not have to worry about the code being exploited. off course you could even add more code which would make it more secure by dis-allowing all the other classes but then it just adds extra lines of code which is really not needed.
Unknown User
2009-11-20 15:08:00
thank you ;)
Unknown User
2013-01-23 03:50:28
Yes thanks very much!
Unknown User
2013-05-10 18:11:28
? ???? ?? ?????????? ??????????
[url="http://dosug.intirest.ru/service/27/index.htm"]??????????? ?????? - ????? ? ??????[/url]
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728