Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=113)
-   -   Torrent age limit (http://www.bvlist.com/showthread.php?t=1890)

Edgein 27th January 2009 21:56

Torrent age limit
 
1 Attachment(s)
In the Netherlands we have a look indicator oftewel a look recommendation for children so that they know also where they will look at to


first the sql

Code:

ALTER TABLE `torrents` ADD `age` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'all.gif'
in edit.php add where you like

PHP Code:

        tr("Age","<input type=radio name=age value=all>all
                <input type=radio name=age value=6>6
                <input type=radio name=age value=12>12
                <input type=radio name=age value=16>16
                <input type=radio name=age value=angst>angst
                <input type=radio name=age value=dis>discriminatie
                <input type=radio name=age value=drugs>drugs
                <input type=radio name=age value=geweld>geweld
                <input type=radio name=age value=grof>grof
                <input type=radio name=age value=sex>sex
                <font class=small size=1>Please select the apropiate!</font>"
,1); 

in takeedit.php after

PHP Code:

if ($_POST["sticky"] == "yes")
      
$updateset[] = "sticky = 'yes'";
   else
      
$updateset[] = "sticky = 'no'"

add

PHP Code:

if (!empty($_POST['age']))
$age unesc($_POST['age']); 

above

PHP Code:

$updateset[] = "anonymous = '" . ($_POST["anonymous"] ? "yes" "no") . "'"

add

PHP Code:

$updateset[] = "age = " sqlesc($age); 

in details.php in the msql query after torrents.save_as,

add

PHP Code:

torrents.age

Find in details

PHP Code:

tr("Info hash"preg_replace_callback('/./s'"hex_esc"hash_pad($row["info_hash"])));
$descrip $row["descr"];
if(!empty(
$row['imageurl']))
$descrip "[img]$row[imageurl][/img]\n".$descrip

and add after

PHP Code:

if ($row["age"] == "all")
tr("Age""<img src=/age/all.gif>"1);
if (
$row["age"] == "6")
tr("Age""<img src=/age/6.gif>"1);
if (
$row["age"] == "12")
tr("Age""<img src=/age/12.gif>"1);
if (
$row["age"] == "16")
tr("Age""<img src=/age/16.gif>"1);
if (
$row["age"] == "angst")
tr("Age""<img src=/age/angst.gif>"1);
if (
$row["age"] == "dis")
tr("Age""<img src=/age/dis.gif>"1);
if (
$row["age"] == "drugs")
tr("Age""<img src=/age/drugs.gif>"1);
if (
$row["age"] == "geweld")
tr("Age""<img src=/age/geweld.gif>"1);
if (
$row["age"] == "grof")
tr("Age""<img src=/age/grof.gif>"1);
if (
$row["age"] == "sex")
tr("Age""<img src=/age/sex.gif>"1); 

in browse.php
in the big query ADD torrents.age,
so looks like

PHP Code:

    $query "SELECT torrents.id, torrents.free, torrents.sticky, torrents.category, torrents.age, 

in functions.php in the function torrenttable
after

PHP Code:

<td class="colhead" align="center"><font color=#3D3D3D>Category</font></td> 

add

PHP Code:

<td class="colhead" align="center">Age</td

after

PHP Code:

        $id $row["id"];
        print (
"<tr>\n");
        print (
"<td align=center width=16 height=16 style='padding: 0px'>");
        if (isset(
$row["cat_name"])) {
            print (
"<a href=\"browse.php?cat=" $row["category"] . "\">");
            if (isset(
$row["cat_pic"]) && $row["cat_pic"] != "")
                print (
"<img border=\"0\" src=\"$pic_base_url$row["cat_pic"] . "\" alt=\"" .
                    
$row["cat_name"] . "\" />");
            else
                print (
$row["cat_name"]);
            print (
"</a>");
        } else
            print (
"-");
        print (
"</td>\n"); 

add

PHP Code:

if ($row["age"] == "all")
     
$d "<img src=/age/all.gif>";
  else if (
$row["age"] == "6")
     
$d "<img src=/age/6.gif>";
  else if (
$row["age"] == "12")
     
$d "<img src=/age/12.gif>";
  else if (
$row["age"] == "16")
     
$d "<img src=/age/16.gif>";
  else if (
$row["age"] == "angst")
     
$d "<img src=/age/angst.gif>";
  else if (
$row["age"] == "dis")
     
$d "<img src=/age/dis.gif>";
  else if (
$row["age"] == "drugs")
     
$d "<img src=/age/drugs.gif>";
  else if (
$row["age"] == "geweld")
     
$d "<img src=/age/geweld.gif>";
  else if (
$row["age"] == "grof")
     
$d "<img src=/age/grof.gif>";
  else if (
$row["age"] == "sex")
     
$d "<img src=/age/sex.gif>";
            print(
"<td class=\"row2\" align=\"center\">" $d "</td>\n"); 

Some screens

in browse.php

http://i86.photobucket.com/albums/k1..._2006/age1.gif


and in details.php

http://i86.photobucket.com/albums/k1..._2006/age2.gif


here are the pics

hack346 8th February 2009 12:05

yeap, nice addon


All times are GMT +2. The time now is 10:33.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.