##        Mod title:  puntracker
##
##      Mod version:  1.0.2
##   Works on PunBB:  1.2.15
##     Release date:  2007-06-15
##           Author:  eric235u (support@newmag.org)
##
##      Description:  a bittorrent indexer
##
##   Affected files:  only included files
##
##       Affects DB:  yes.  adds a table.
##
##            Notes:  (1) requires PHP/CURL.
##                    (2) if you want to use the 'scrape'
##                    feature make sure you're using a tracker that
##                    supports it.  not all trackers do.  also, for torrents
##                    you list with this module but do not scrape, you will
##                    have to independently verify whether or not the
##                    torrent is active.  such as with your bittorrent
##                    client.  torrents listed with scrape url will be
##                    checked by the puntracker every 90 minutes and deleted
##                    after 3 days of inactivity.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
               

#
#---------[ 1. UPLOAD ]-------------------------------------------------------
#

upload the contents of /puntracker to /
(you of course don't need to upload readme.txt)


#
#---------[ 2. RUN ]----------------------------------------------------------
#

install_mod.php
(going to this page with your browser will 'run' the file)


#
#---------[ 3. DELETE ]-------------------------------------------------------
#

install_mod.php
(delete this file from your server)

#
#---------[ 4. VIEW ]---------------------------------------------------------
#

go to ../puntracker.php and you should see your tracker there

#
#---------[ 5. UNINSTALL ]---------------------------------------------------------
#

if you desire to uninstall this modification, upload install_mod.php to your
server /.  go to that page with your broswer and click 'restore'.  this will
remove the puntracker database table.  (if you no longer have install_mod.php
you can just drop the table on your own.  this is particularly easy with
phpmyadmin.)

then delete from your server all the puntracker files.

#
#---------[ 6. UPDATE TO VERSION 1.0.2 FROM 1.0.1 ]-----------------------------------
#

to update from puntracker version 1.0.1 you have to unistall the previous version
and install the new version.  the database table has been changed.

**********************************************************************************


download:
http://www.punres.org/files.php?pid=399

77

(10 replies, posted in PunBB 1.2 troubleshooting)

hey fju, nobody owes you anything.  ask for help, don't demand it.

do you understand how to enable debugging?

oh i just noticed you have cbb for a forum.  i've used it.  it works.

Coux wrote:

is there an update on this.. i would like to use this forum with xoops.

are you really into xoops?  i just stopped using it because there hasn't been any active development on the core in a l o n g time.  there's a ton of promises for several months, but no code.  if you do use xoops avoid the 2.2.x branch.  it's basically dead.

if u are going to use xoops and can't port punbb yourself consider some of the other forums that have already been ported to xoops.

have u seen http://xoopscube.org/ ?

good luck.

80

(114 replies, posted in Programming)

i'm just a beginning with php but i like http://jedit.org/ when i'm using different os's and http://www.kdevelop.org/ when i'm in linux only mode.  both are free.

81

(17 replies, posted in Programming)

pogenwurst wrote:
eric235u wrote:

as a free software user i totally despise flash.  i don't even have flash installed on my home computer.

Personally I don't mind having closed-source apps like Flash mixed in with my OSS system, but I understand that some do. I wonder if the Flash output of this program is compatible with Gnash or Swfdec.

well to be completely honest i do have a couple of evil codecs on my my linux box.  so my system isn't completely pure, though it's close.  nevertheless, it would seem befitting a f/oss project to utilize free media.  but many folks do go the way of flash and i realize i'm in a minority.

i tried gnash a while back and had no luck but it may be better now.  i'll look into it.  thanks.

Dr.Jeckyl, it's very cool you're making some tutorials for punbb!  good luck in your effort.  i look forward to checking it out.

82

(17 replies, posted in Programming)

Dr.Jeckyl wrote:

it's a self contained video w/ player all in one .exe file exported from a vid cap program called BB FlashBack. VERY tiny file for what it outputs in quality. but i'm looking for cross platform compatability which i'm sure the .exe file is not. it's to do with my PunBB video tutorial project.

when i get a response from Rickard i'll be posting them up for use here shortly. just need his blessing on the content. if anyone is interested in giving a conversion a try i'll be happy to send you a link.

drjeckyl723@gmail.com

are u saying this app exports a .exe ?

if i were a windos user, which i'm not, i think the last thing i would want to do is have to click on a .exe file from a source i don't absolutely believe is trustworthy.

my $0.02

83

(17 replies, posted in Programming)

Dr.Jeckyl wrote:
pogenwurst wrote:

Publish to Flash, AVI, WMV, EXE and PowerPoint.

Your best bets for cross-platform use will probably be Flash or AVI.

yeah i kinda figured that. i was hoping that it was possible because of the clarity the exe offers. i'll experiment with the avi and flash settings.

thanks guys, carry on. ;)

as a free software user i totally despise flash.  i don't even have flash installed on my home computer.  avi would be okay.  ogg theora is better!  if you are unable to convert it you can just email me a link and i'll trascode it for you and post it as a torrent.  just a thought.

http://www.theora.org/

it also should be noted that this mod will only work with trackers that support 'scrape' in the form of 'scrape?hash_id=' and unfortunately not all trackers do.  in fact i've found one popular tracker that gives out bad information when you scrape it.  so i suggest only posting your torrents to a tracker that properly supports scrape and then posting that torrent to your modified punbb website.

SuperMAG wrote:

i just dont know how this mod works but i know its makes ur site a torrent site ok ... does it need special servers or special place or special abilites of your hosting .. and what is difference between downloading file directly from site and downloading a torrent from that site. .. i tried to download from you site that torrent and worked wonderfully at high speed .. so could you explain

hi.

your website host doesn't need anything special except curl.  see:  http://curl.haxx.se/  your host probably provides this.  check their faq or list of available php functions. 

there is no difference in downloads.  for an example, when you clicked on the link at my website to download the '.torrent' file you actually received the file from the orginal torrent tracker, not from me.  with this mod no files are stored on your server.  you merely index or list torrents in other places.

you could just have a link to the torrent file in a forum if you wanted and it would be the same.  the only difference is that this mod displays torrent statistics using 'scrape'.  scrape is where i tell the original tracker the torrent hash i'm interested in and the tracker replies with information, like how many seeds, leeches and completed downloads (as well as a bunch of other info if they want).

if you're interested in a better description check this out:
http://wiki.theory.org/BitTorrentSpecif … Convention

hope that helps.

oh screw it, i'm going to be brave and use the mod on a public site.  if you want to check it out see:  http://torrent.newmag.org/  the site is pretty empty and i'll use it as a testing ground for the mod.  i've also posted the code on punres.org.

let me know if anything particularly sucks.  :-)

87

(2 replies, posted in Programming)

ah.  i get it now.  thanks man.

just for fun i removed mysql_real_escape_string and was able to cause an error.  so it's working properly.  for some reason i thought i would see the escapes.  doh!

if you're interested here's a good general overview of bittorrent:
http://en.wikipedia.org/wiki/BitTorrent

this mod is not a bittorrent tracker.  it's a bittorrent indexer.  the most important difference is that no files are stored on your server.

so you would have the a file on your home computer, let's call it aKickAssMovie.mpg.  using your bittorrent client (azureus and ktorrent are good ones) you create a meta data file (whatever.torrent) using a bittorrent tracker (like thepiratebay.org).

using this mod you can input some basic information about your torrent.  this mod will the occasionally connect to tracker and get some stats about your torrent (aka scrape) and display the data on your punbb based website.  this way visitors to your site will be able to know how large the torrent swarm is for aKickAssMovie.mpg and be able to join if they want. 

if you're looking to share really large files nothing beats bittorrent.  just for fun i made a ~40GB file and shared it with hundreds of people.  worked like a charm.  bandwidth costs did not increase.

hi all.  i have a punbb mod that uses a form to store user input in mysql.  i want to sanatize user input.  i'm trying to use mysql_real_escape_string but the special characters don't seem to be prepended by backslashes.  i view the data i purposely use special charactors in via phpmyadmin and the characters are not prepended.  should i see the backslashes there or am i thinking about this incorrectly?

from http://www.nyphp.org/phundamentals/stor … ieving.php

The resulting SQL statement will look like this:

    INSERT INTO MyTable (MyColumn) VALUES ('My Dear Aunt Sally's Picnic Basket')
   

Notice that we now have three single quotes. The database engine will see the first single quote, the value My Dear Aunt Sally and will then see the second single quote. It will assume that the phrase s Picnic Basket') is part of -- what? The database engine doesn't know. It will then generate an error.

yet when i do something similar i don't get an error.  Sally's goes right into my db.  i am completely confused as to whether or not i have mysql_real_escape_string working correctly or not.

as a side note, does punbb have special functions i should use instead?  i see things like pun_trim($str) but i'm not sure where it would be best to use them.  are there any docs on these beasties?

thanks for any tips!

so it moves the 'subscribe' link from the bottom of the page to under every post?

dds the possibility (for admins and, I think, moderators, too)

maybe consider changing that.  create a moderator and know if it works.

i don't need such a mod at this time but it could be useful to some.  more mods the better!

hi all.  i wanted a bittorrent module for punbb and i wanted to learn php.  so i've put together a bittorrent indexer called puntracker.  i'm posting here to ask for a couple of people to try it out and tell me about any bugs.  also i desire for a more experienced programmer to look over my code and help me close any obvious exploits.  punform.php is particularly week.  i haven't figured out yet on how to make a proper white list for the form.

please remember that this is beta software and not to be used on a production website.

here's what it looks like,
http://newmag.org/downloadsVisitor/foru … r1beta.png

thanks for any tips!

Tubby wrote:

It looks rather nice, but i think that a table is at hand to seperate the links from their specific descriptions. It would look alot more professional ( not to mention organised ).

yeah.  my next version will be much better.  this was just a first try.  for the next version i want to basically clone the xoops link module for punbb.  it looks like this.  people seem to like the catagories at the top and the other features.  so i'll copy them.  i should be able to get to work on it in about a month.  i'll post it here for u all to check out.

93

(89 replies, posted in PunBB 1.2 discussion)

[my two cents]

when i join a website or forum i despise overly time consuming activation processes.  i'm not a trick pony and don't jump through hoops.

it seems that the best way of slowing down spam is to keep the methods varied and modular.  if there's four or five punbb antispam modules that all work differently we would be in a better strategic position than if one module were included in the official release.  this argument i think is self evident.

[/my two cents]

hi.  the links module i modified a bit looks like this:  Links Plus 1.2.1.

i'm currently working on another module but when i get that done (say within a month) i'm going to redo the links module.  i want to change the formatting and add some features.  it's currently a very simple but functional module.

95

(3 replies, posted in PunBB 1.2 show off)

thanks for the feedback.  i guess it's more of a blog.  lots of fun hacking around on punbb.

if you were local i would try and talk you into coming to our dojo!

96

(1 replies, posted in Programming)

i searched around and bumped into this.  :-)

PHP Debugging Basics.


this bugger is useful!

error_reporting(E_ALL);

:-p

97

(89 replies, posted in PunBB 1.2 discussion)

hey i know this is slightly off topic but i couldn't resist posting it.  so u you have spam problems?  check out this article,
MySpace users snowed in by new blizzard of spam.

A few days later, a new spammer left 500 pages worth of postings. Bartley eventually converted the group to private, so people would have to receive her explicit permission before being able to post messages. But even this has done nothing to stem the viral wave of crap, which in many cases includes postings of some of the vilest porn known to man. To make matters worse, the vandals have figured out a way to ban her most vocal supporters from accessing the group, so they are unable to participate in any meaningful way.

"...some of the vilest porn known to man..."  i hate spammers but that line's kind of funny.

98

(89 replies, posted in PunBB 1.2 discussion)

that's a good point sirena.  maybe making a couple of already existing options default would help.

i'm an extreme newb at programming so i'm not sure on what would be the best method for additional defense but possibly a captcha that could be turned off for accessibility reasons...

interesting thread.

Smartys wrote:

...1.3 will most certainly have official extensions to help fight spam...

:-)

99

(1 replies, posted in Programming)

hi all.  newb programmer here trying to make a bittorrent indexer plugin for punbb.  i have all the easy stuff working and now i'm trying to tackle the object that scrapes other trackers.  my module isn't producing any errors in my servers error scripts log but i know darn well i''ve made a couple of mistakes.  so how do you guys see all the errors in your code?  do you just 'echo' variables everywhere to see what's going on?  thanks for any tips.

for amusement purposes here's some code.  i know i've made mistakes in punscrape.  probably a bunch of 'em...

<?php

/*

  This file isn't part of PunBB.  This file is part of puntracker
  a bittorrent tracker module for PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

*/

// let's keep tracker within punbb
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

// the scrape object
class punscrape
{
    function do_scrape()
    {

    global $db;
    
// let's check if the torrent(s) need to be scraped.
$table = $db->prefix.'puntracker';
$result = $db->query("SELECT * FROM $table 
WHERE TIMEDIFF(NOW(), $table.last_scrape) >= '0000-00-00 01:30:00'");

while ($row = $db->fetch_assoc($result)) {

// if query returns a row, scrape url
    if (isset($row['announce'])) {

$announce_url=$row['announce'];
$hash=$row['hash'];

// let's transform the announce url to a specific torrent scrape
$scrape_url = preg_replace ( '<announce.*>', 'scrape?hash_id='.$hash, $announce_url); 

// create a new cURL resource
// we may need to set CURLOPT_CONNECTTIMEOUT
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $scrape_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  // to return text
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL text and set $scrape_result
$scrape_result = curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);

// let's extract complete (seeds), downloaded and incomplete (peers).
preg_match("<completei\d*>", $scrape_result, $matches_complete);
preg_match("<downloadedi\d*>", $scrape_result, $matches_downloaded);
preg_match("<incompletei\d*>", $scrape_result, $matches_incomplete);

// get the substring of only numbers.
// i don't think i an do this on an array
$complete = substr($matches_complete, 9);
$downloads = substr($matches_downloaded, 11);
$incomplete = substr($matches_incomplete, 11);

// if scrape returns text update mysql
// not secure.  we need to check better prior to update
if (isset($complete)) {

//  update mysql.  *CHECK THIS IN PHPMYADMIN TO MAKE SURE I'M NOT RETARdED*
$sql = "UPDATE $table";
$sql .= " ( complete, downloads, incomplete, last_scrape ) VALUES ";
$sql .= " ( '$complete', '$downloads', '$incomplete', NOW())";
$sql .= " WHERE '$hash' = hash";

} } }

}}

$updatedb = new punscrape;
$updatedb->do_scrape();

// if scrape fails for 3 days DELETE
// this query runs everytime the page is viewed.  not efficient.
$table = $db->prefix.'puntracker';
$query = "DELETE FROM $table WHERE $table.last_scrape <= NOW() - INTERVAL 3 DAY";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>puntracker</title>
<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_config['o_default_style'].'.css' ?>" />
</head>
<body>

<p>
<b>Definitions:</b>  "Torrent File Name" is the name of the file.  You can 
make something up.  "Torrent Hash" has 40 characters.  In Azureus you can right 
click on the torrent, select copy hash and then past here.  "Tracker Announce 
URL" is the URL you used to make the torrent.  It will look something like 
<i>http://www.supertracker.net:6969/announce</i>, announce being the key word. 
"Torrent File Link" is the link to download the actual metadata file.  
<i>http://newmag.org/ericBitchSlapsPimp.torrent</i>. 
So in this field you should enter the URL to the torrent file.  
Please submit a torrent only once and contact us if you have any queries. 
Thanks.
</p>

<!-- this is the form to submit a new torrent -->
<form action="punform.php" method="post">
 <p><b>Torrent File Name:</b> <input type="text" name="name" />
 <b>    Torrent Hash:</b> <input type="text" name="hash" /></p>
 <p><b>Tracker Announce URL:</b> <input type="text" name="announce" />
 <b>    Torrent File Link:</b> <input type="text" name="metadata" />
     <input type="submit" /></p>
</form>

</body>
</html>


<?php

// list all torrents in database.  Name(metadata), seeds, peers, downloads.
$table = $db->prefix.'puntracker';
$result = $db->query("SELECT metadata, name, complete, incomplete, downloads FROM $table 
    ORDER BY name");
    
// can i use $db->fetchArray?  should i change the format?  <p>?
while ($row = $db->fetch_assoc($result)) {
    echo '<p><b>Name:</b> <a href="' . $row['metadata'] . '">'. $row['name'] . '</a>' . 
    ' Seeds: ' . $row['complete'] . ' Peers: ' . $row['incomplete'] . 
    ' Downloads: ' . $row['downloads'] . "</p>";
}

?>

<?php
// let keep tracker within punbb
$footer_style = 'index';
require PUN_ROOT.'footer.php';
?>

100

(89 replies, posted in PunBB 1.2 discussion)

Thanks. As I said, I can install mods myself or even tweak my own spam filter. I'm talking about fixing this bug for the default installation so that people who install punBB don't have to worry, the default installation will be safe.

i don't think the word 'bug' is being properly used here.  if the default installation is too open for your liking several methods have been mentioned here on how to tighten things up.

if you feel that the default settings should be changed that is something you could mention to the developers.  but i personally like punbb as is.

i do feel your pain, spammers suck balls.