Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=101)
-   -   Friends block (http://www.bvlist.com/showthread.php?t=272)


   
        end_table();
    end_frame();
    $res2 = mysql_query("SELECT count(id) FROM friendsblock") or die(mysql_error());
    $row = mysql_fetch_array($res2);
    $url = " .$_SERVER[PHP_SELF]?";
    $count = $row[0];
    $perpage = 15;
    list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);
    begin_frame("To edit :.");
    if ($count == 0)
    print("

There is nothing:(

\n");
    else
    {
    //print("
Fynnon 1st May 2008 16:59

Friends block
 
ok since everybody had trouble with the last version i did this again and corrected a couple of things and taken out half the crap that wasnt even needed tbh

it was full html code that wasnt even being used such as etc

run this sql

Code:

    CREATE TABLE `friendsblock` (
    `id` int(10) unsigned NOT NULL auto_increment,
    `added` datetime default NULL,
    `image` text NOT NULL,
    `descr` text NOT NULL,
    `url` text NOT NULL,
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=207;


in your stdhead add this just above the

Code:

   
still in stdhead add this where you want the block to show up

Code:

    begin_block("Friends");?>
               
                   
                   
                     

                 
                 
                   

                   
                                            $res = mysql_query("SELECT id,added,image,descr,url from friendsblock ORDER BY added DESC $limit") or sqlerr(__FILE__, __LINE__);
                        while ($arr = mysql_fetch_assoc($res))
                        print("


                     

[img]$arr[image][/img]
                       
\n");
                    ?>
                     


                     

               
                                        end_block();


now make a friendsblockadd.php and ad to your root

Code:

        require_once("include/bittorrent.php");
    dbconn(false);
    loggedinorreturn();
    if (get_user_class() < UC_SYSOP)
    stderr("Error", "There is no access........");
    stdhead("To add in the friends");
    begin_frame("To add in the friends :.");
    begin_table();

    ?>
   

        tr("URL Buttons: ", "
(upload Button on http://img293.imageshack.us)", 1);
    tr("Description: ", "", 1);
    tr("URL Site : ", "
(http://www.torrentstrike.info)
\n", 1);
    ?>
   
\n");
    begin_table();
    print("\n");
    $res = mysql_query("SELECT id,added,image,descr,url from friendsblock ORDER BY added DESC $limit") or sqlerr(__FILE__, __LINE__);
    while ($arr = mysql_fetch_assoc($res))
    {
    print("\n");
    }
    end_table();
    //print("
ButtonIt is addedDescriptionURL SiteEdit.Delete.
$arr[added]$arr[descr]$arr[url][Edit.][Del.]
\n");
    echo $pagerbottom;
    }
    end_frame();
    stdfoot();
    ?>

now make a friendsmanage.php and add to your root

Code:

        require "include/bittorrent.php";
    dbconn();
    loggedinorreturn();
    if (get_user_class() < UC_SYSOP)
    stderr("Error", "There is no access........");
    $action = $_GET["action"];
    if ($action == 'delete')
    {
    $id = $_GET["id"];
    if (!is_valid_id($id))
    stderr("Error","bad id");
    $returnto = $_GET["returnto"];
    $sure = $_GET["sure"];
    if (!$sure)
    stderr("Delete","Are you sure you want to delete? Press\n" .
    "here to confirm.");
    mysql_query("DELETE FROM friendsblock WHERE id=$id") or sqlerr(__FILE__, __LINE__);
    if ($returnto != "")
    header("Location: $returnto");
    else
    $warning = "Successfully deleted.";
    }
    if ($action == 'edit')
    {
    $id = (int) $_GET["id"];
    if (!is_valid_id($id))
    stderr("Error","Bad id");
    $res = mysql_query("SELECT * FROM friendsblock WHERE id=$id") or sqlerr(__FILE__, __LINE__);
    if (mysql_num_rows($res) != 1)
    stderr("Error", "There are no friends ID $id.");
    $arr = mysql_fetch_array($res);
    if ($_SERVER['REQUEST_METHOD'] == 'POST')
    {
    $image = $_POST['image'];
    if ($image == "")
    stderr("Error", "Enter URL of the Button?!");
    $descr = $_POST['descr'];
    if ($descr == "")
    stderr("Error", "Enter the description?!");
    $url = $_POST['url'];
    if ($url == "")
    stderr("Error", "Enter URL site?!");

    $image = sqlesc($image);
    $descr = sqlesc($descr);
    $url = sqlesc($url);

    mysql_query("UPDATE friendsblock SET image=$image,descr=$descr,url=$url WHERE id=$id") or sqlerr(__FILE__, __LINE__);
    $returnto = $_POST['returnto'];
    if ($returnto != "")
    header("Location: $returnto");
    else
    $warning = "Error,Error..........";
    }
    else
    {
    $returnto = $_GET['returnto'];
    stdhead();
    begin_frame("Edit :.");
    print("
\n");
    print("\n");
    print("\n");
    print("\n");
    print("\n");
    print("
    \n");
    print("\n");
    print("
URL Buttons:*
Description:*
URL Site:*
\n");
    print("
\n");
    end_frame();
    stdfoot();
    die;
    }
    }
    ?>


lastly make a takefriends.php and add to your root

Code:

        require_once("include/bittorrent.php");
    dbconn();
    loggedinorreturn();
    if (get_user_class() < UC_SYSOP)
    stderr("Error", "There is no access....");
    function bark($msg) {
    stdhead();
    stdmsg("Error!", $msg);
    stdfoot();
    exit;
    }
    if (!$_POST["image"])
    bark("Enter URL the address of the button.");
    $image = $_POST["image"];
    if (!$_POST["descr"])
    bark("Enter the description.");
    $descr = $_POST["descr"];
    if (!$_POST["url"])
    bark("Enter URL Site.");
    $url = $_POST["url"];
    $image = sqlesc($image);
    $descr = sqlesc($descr);
    $url = sqlesc($url);
    $added = sqlesc(get_date_time());
    mysql_query("INSERT INTO friendsblock (added,image,descr,url) VALUES($added,$image,$descr,$url)") or sqlerr(__FILE__, __LINE__);
    $id = mysql_insert_id();
    header("Refresh: 0; url=friendsblockadd.php");
    ?>

thats it :smile:
snakebite 1st May 2008 17:21

Re: TorrentStrike Mod - Freinds block
 
nice :D

diablo21 23rd June 2010 12:36

can you give me the done files couse i got errors when i try it to make it


All times are GMT +2. The time now is 23:27.

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