Home » Discussion Forums » M0dZ & HaCkZ » Candidates pmbt core
| Candidates pmbt core [message #664] |
Thu, 15 February 2007 22:03  |
lodp  Messages: 336 Registered: June 2006 |
Releaser |
|
|
since djechelon seems to have re-emerged from his dark lair (and my CVS access is working again), i thought we should start thinking about which of our (well, mostly joeroberts') numerous hacks and modz we're going to push into the phpMyBitTorrent core for the next release. I think that while we shouldn't be afraid to extend pmbt's core functions, but we shouldn't overdo it on fancy features. Those can be released as Mods on SF -- nicely packaged, with documentation (for example, the phpBB3 bridge should be released that way, i think).
i already committed the following fixes/mods to CVS:
- joeroberts' fix for browsing multiple pages in search results and when all torrents of a category are displayed.
- the ban button in details.php and bittorrent.php, as well as the ban-unban selector in edit.php
- the scrape button in details.php and bittorrent.php. also added scrape-external.php of course.
what else? this is my take, list will be extended (after all i don't know all of joeroberts' hacks that well):
BUGFIXES:
- at3p's fix for the page numbers at the bottom of the index, which screw up the template in the higher numbers. i tried to get this into CVS (diffing files), but i failed. i'll need some info on how exactly he did it.
...
MODS/HACKS:
- The Donation mod. Makes eminent sense to me. You can switch it on/off in the admin panel, so I think it should definitely be in the core.
- The PHP5 fix. djechelon is going to look at this.
- "Better swarm health judgement". Judge torrents on a range of 1-7, according to total peer number and seed/leech ratio.
- Search function improvements (i.e. inserting ALL of the description and the names of the files contained in a torrent into the search space)
...
Your criticism/suggestions please ...
|
|
|
| Re: Candidates pmbt core [message #665 is a reply to message #664] |
Thu, 15 February 2007 22:44   |
|
Not to push my hackz or nothen
but I think that we should add
| Quote: | Frequintly Asked Quistions
this section is comen on most site. you can add new edit
and change to what you want and it well do BBcode with adition
of redirect.php. It also has icons for New, and Updated Quistions
|
| Quote: | Site New
for site announcements and news you can set to allow coments
how many announcements are displayed at a time. and if they can
view archived news.
|
and I have one more thats not in my list wich is
| Quote: | Rules
wich lists ruls for defrent classes
and has admin access to Change, Update, and Add New Rules
|
BTW you should change line 623 of details.php from
to
not sure why but on some servers with php5 with the new Modz aplied
you cant see details with out the php on the end
[Updated on: Thu, 15 February 2007 23:04] Report message to a moderator
|
|
| | | |
| Re: Candidates pmbt core [message #685 is a reply to message #664] |
Tue, 27 February 2007 01:37   |
|
I just had a new idea. Making the tracker more Web 2.0 compliant.
Some people talked about a search cloud for most searched keywords. Well, I wanted it to look like the following:
Below the search box there is a button (in the form of a link) that displays the search cloud, which was hidden in HTML. When on the cloud, clicking a keyword fills the search box in. So the user clicks on the word to search and the text box is filled with it: he/she has just to click on Search to perform the Torrent search.
Another idea is to split most of the content of the Torrent Details page in tabs, accessible by clicking a graphic button.
However, I need my desktop PC back to create the second one (or at least I have to first create a text-version of it).
Now I have my PHP editor on my laptop, so I'll try to take a look at the code and the most recent changes in CVS. I don't think that the search cloud has already been implemented, so I'll have to do it.
Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.
|
|
|
| Re: Candidates pmbt core [message #695 is a reply to message #685] |
Tue, 27 February 2007 05:14   |
|
I got my rules hack all set for lang. pack here is the code
This is rules.php
<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*-------------- Created By Antonio Anzivino (aka DJ Echelon) --------------*
*------------- http://www.p2pmania.it -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*------------- http://www.bittorrent.com -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*-- This program 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. --*
*-- --*
*-- This program 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 --*
*-- --*
*------------------------------------------------------------------------------*
*------ ©2005 phpMyBitTorrent Development Team ------*
*----------- http://phpmybittorrent.com -----------*
*------------------------------------------------------------------------------*
*-------- Hacked For phpMyBitTorrent --------*
*-------- By Joeroberts ---------*
*-------- http://www.moviegamesmore.net --------*
*------------------------------------------------------------------------------*
*/
include("header.php");
if($user->admin){
print("<br><table width=100% border=0 cellspacing=0 cellpadding=10>");
print("<tr><td align=center><a href=modrules.php?act=newsect>"._btrulesadd."</a></td></tr></table>\n");
}
$sql_rule = "select * from ".$db_prefix."_rules order by level;";
$res = $db->sql_query($sql_rule);
$db->sql_freeresult($sql_rule);
while ($arr = $db->sql_fetchrow($res)){
if ($arr["public"]=="yes")
{
OpenTable(_btrulesgen);
print("<form method=post action=modrules.php?act=edit&id=".$arr["id"]."><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<tr><td><hr /></td><td></td></tr>\n";
echo ("".$arr["title"]."");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
if($user->admin)print("</td></tr><tr><td><input type=hidden value=".$arr["id"]." name=id><input type=submit value='"._btalt_edit."'></td></tr></table></form>");
CloseTable();
}
if ($arr["public"]=="no")
{
if($user->user && $arr["level"]=="user")
{
OpenTable(_btrulesuser);
print("<form method=post action=modrules.php?act=edit&id=".$arr["id"]."><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<tr><td><hr /></td><td></td></tr>\n";
echo ("".$arr["title"]."");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
if($user->admin)print("</td></tr><tr><td><input type=hidden value=".$arr["id"]." name=id><input type=submit value='"._btalt_edit."'></td></tr></table></form>");
CloseTable();
}
if($user->premium && $arr["level"]=="premium")
{
OpenTable(_btrulesprem);
print("<form method=post action=modrules.php?act=edit&id=".$arr["id"]."><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<tr><td><hr /></td><td></td></tr>\n";
echo ("".$arr["title"]."");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
if($user->admin)print("</td></tr><tr><td><input type=hidden value=".$arr["id"]." name=id><input type=submit value='"._btalt_edit."'></td></tr></table></form>");
CloseTable();
}
if($user->moderator && $arr["level"]=="moderator")
{
OpenTable(_btrulesmod);
print("<form method=post action=modrules.php?act=edit&id=".$arr["id"]."><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<tr><td><hr /></td><td></td></tr>\n";
echo ("".$arr["title"]."");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
if($user->admin)print("</td></tr><tr><td><input type=hidden value=".$arr["id"]." name=id><input type=submit value='"._btalt_edit."'></td></tr></table></form>");
CloseTable();
}
if($user->admin && $arr["level"]=="admin")
{
OpenTable(_brrulesadmin);
print("<form method=post action=modrules.php?act=edit&id=".$arr["id"]."><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<tr><td><hr /></td><td></td></tr>\n";
echo ("".$arr["title"]."");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
if($user->admin)print("</td></tr><tr><td><input type=hidden value=".$arr["id"]." name=id><input type=submit value='"._btalt_edit."'></td></tr></table></form>");
CloseTable();
}
}
}
include("footer.php");
?>
this one is modrules.php
<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*-------------- Created By Antonio Anzivino (aka DJ Echelon) --------------*
*------------- http://www.p2pmania.it -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*------------- http://www.bittorrent.com -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*-- This program 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. --*
*-- --*
*-- This program 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 --*
*-- --*
*------------------------------------------------------------------------------*
*------ ©2005 phpMyBitTorrent Development Team ------*
*----------- http://phpmybittorrent.com -----------*
*------------------------------------------------------------------------------*
*-------- Hacked For phpMyBitTorrent --------*
*-------- By Joeroberts ---------*
*-------- http://www.moviegamesmore.net --------*
*------------------------------------------------------------------------------*
*/
include("header.php");
//DELETE RULE SECTION PAGE/FORM
$id = $_GET["id"];
if ($_GET["act"] == "delete")
{
OpenTable("");
$sql = "DELETE FROM ".$db_prefix."_rules WHERE id = $id ";
if (!$db->sql_query($sql)) btsqlerror($sql);
echo "<p>Rules PAGE/FORM Deleted</p>";
header("Refresh: 5; url=modrules.php");
CloseTable();
}
//ADD NEW RULE SECTION PAGE/FORM
elseif ($_GET["act"] == "newsect")
{
OpenTable(_btrulesaddsect);
print("<form method=\"post\" action=\"modrules.php?act=addsect\">");
print("<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\">\n");
print("<tr><td>"._bttitle.":</td><td><input style=\"width: 400px;\" type=\"text\" name=\"title\"/></td></tr>\n");
echo "<tr><td><hr></td><td></td></tr>";
echo "<tr><td><p>"._btdescription;
if (!$allow_html) echo "<br>"._btnohtml."</p></td><td><p><textarea name=\"text\" rows=\"20\" cols=\"90\">".$res[title]."</textarea></p>\n</td></tr>\n";
else {
echo "</td><td>";
$oFCKeditor = new FCKeditor('msg') ;
$oFCKeditor->BasePath = 'FCKeditor/';
$oFCKeditor->Value = $res['text'];
$oFCKeditor->Height = 350 ;
$oFCKeditor->Create();
}
echo "<tr><td><hr /></td><td></td></tr>\n";
echo "<tr><td><p>Puplic</p></td><td><p>";
echo "<select name=\"public\">\n";
echo "<option value=\"yes\">YES</option>\n";
echo "<option value=\"no\">NO</option>\n";
echo "</select>Is this puplic</p>\n";
echo "</td></tr>\n";
echo "<tr><td><hr /></td><td></td></tr>\n";
echo "<tr><td><p>"._btlevel."</p></td><td><p>";
echo "<select name=\"level\">\n";
echo "<option value=\"user\">"._btclassuser."</option>\n";
echo "<option value=\"premium\">"._btclasspremium."</option>\n";
echo "<option value=\"moderator\" >"._btclassmoderator."</option>\n";
echo "<option value=\"admin\" >"._btclassadmin."</option>\n";
echo "</select>"._btnamelevel."</p>\n";
echo "</td></tr>\n";
print("<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Add\" style=\"width: 60px;\"></td></tr>\n");
print("</table></form>");
CloseTable();
}
//ADD NEW RULE SECTION TO DATABASE
elseif ($_GET["act"]=="addsect"){
$title = sqlesc($_POST["title"]);
$public = sqlesc($_POST["public"]);
$level = sqlesc($_POST["level"]);
if (!get_magic_quotes_gpc()) $msg = escape($msg);
if ($allow_html) {
if (preg_match("/<[^>]* (on[a-z]*[.]*)=[^>]*>/i", $text)) //HTML contains Javascript EVENTS. Must refuse
bterror(_btinvalidhtml,_btuploaderror);
if (preg_match('/<a[^>]* href="[^"]*(javascript|vbscript):[^>]*>/i', $page)) //HTML contains Javascript or VBScript calls. Must refuse
bterror(_btinvalidhtml,_btuploaderror);
}
parse_html($msg);
$sql = "insert into ".$db_prefix."_rules (title, text, public, level) values($title, '".$msg."', $public, $level)";
if (!$db->sql_query($sql)) btsqlerror($sql);
header("Refresh: 0; url=modrules.php");
}
//EDIT RULE
elseif ($_GET["act"] == "edit"){
$id = $_POST["id"];
$sql_rule = "select * from ".$db_prefix."_rules where id=$id;";
$res_rule = $db->sql_query($sql_rule);
$res = $db->sql_fetchrow($res_rule);
$db->sql_freeresult($res_rule);
OpenTable(_btrulesedit);
$body =$res["text"];
print("<form method=\"post\" action=\"modrules.php?act=edited\">");
print("<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\">\n");
print("<tr><td>"._bttitle.":</td><td><input style=\"width: 400px;\" type=\"text\" name=\"title\" value=\"$res[title]\" /></td></tr>\n");
echo "<tr><td><hr></td><td></td></tr>";
echo "<tr><td><p>"._btdescription;
if (!$allow_html) echo "<br>"._btnohtml."</p></td><td><p><textarea name=\"text\" rows=\"20\" cols=\"90\">".$res[text]."</textarea></p>\n</td></tr>\n";
else {
echo "</td><td>";
$oFCKeditor = new FCKeditor('msg') ;
$oFCKeditor->BasePath = 'FCKeditor/';
$oFCKeditor->Value = $body;
$oFCKeditor->Height = 350 ;
$oFCKeditor->Create();
}
echo "<tr><td><hr /></td><td></td></tr>\n";
echo "<tr><td><p>Puplic</p></td><td><p>";
echo "<select name=\"public\">\n";
echo "<option value=\"yes\""; if($res["public"] == "yes") echo "selected"; echo ">YES</option>\n";
echo "<option value=\"no\""; if($res["public"] == "no") echo "selected"; echo ">NO</option>\n";
echo "</select>Is this puplic</p>\n";
echo "</td></tr>\n";
echo "<tr><td><hr /></td><td></td></tr>\n";
echo "<tr><td><p>"._btlevel."</p></td><td><p>";
echo "<select name=\"level\">\n";
echo "<option value=\"user\" "; if($res["level"] == "user") echo "selected"; echo ">"._btclassuser."</option>\n";
echo "<option value=\"premium\" "; if($res["level"] == "premium") echo "selected"; echo ">"._btclasspremium."</option>\n";
echo "<option value=\"moderator\" "; if($res["level"] == "moderator") echo "selected"; echo " >"._btclassmoderator."</option>\n";
echo "<option value=\"admin\" "; if($res["level"] == "admin") echo "selected"; echo " >"._btclassadmin."</option>\n";
echo "</select>"._btnamelevel."</p>\n";
echo "</td></tr>\n";
print("<tr><td colspan=\"2\" align=\"center\"><input type=hidden value=$res[id] name=id><input type=\"submit\" value=\"Save\" style=\"width: 60px;\"></td></tr>\n");
print("</table>");
CloseTable();
}
//DO EDIT RULE, UPDATE DB
elseif ($_GET["act"]=="edited"){
$id = $_POST["id"];
$title = sqlesc($_POST["title"]);
$public = sqlesc($_POST["public"]);
$level = sqlesc($_POST["level"]);
if (!get_magic_quotes_gpc()) $msg = escape($msg);
if ($allow_html) {
if (preg_match("/<[^>]* (on[a-z]*[.]*)=[^>]*>/i", $msg)) //HTML contains Javascript EVENTS. Must refuse
bterror(_btinvalidhtml,_btuploaderror);
if (preg_match('/<a[^>]* href="[^"]*(javascript|vbscript):[^>]*>/i', $page)) //HTML contains Javascript or VBScript calls. Must refuse
bterror(_btinvalidhtml,_btuploaderror);
}
parse_html($msg);
$sql = "update ".$db_prefix."_rules set title=$title, text = '".$msg."', public=$public, level=$level where id=$id";
if (!$db->sql_query($sql)) btsqlerror($sql);
header("Refresh: 0; url=modrules.php");
}
else{
// STANDARD MENU OR HOMEPAGE ETC
$sql_rule = "select * from ".$db_prefix."_rules order by level;";
$res = $db->sql_query($sql_rule);
$db->sql_freeresult($sql_rule);
OpenTable("Site Rules Editor");
print("<br><table width=100% border=0 cellspacing=0 cellpadding=10>");
print("<tr><td align=center><a href=modrules.php?act=newsect>Add New Rules Section</a></td></tr></table>\n");
CloseTable();
while ($arr = $db->sql_fetchrow($res))
{
OpenTable($arr[title]);
print("<form method=post action=modrules.php?act=edit&id=><table width=95% border=0 cellspacing=0 cellpadding=>");
print("<tr><td width=100%>");
echo "<p>".str_replace("\n","<br>",$arr["text"])."</p>";
print("</td></tr><tr><td><input type=hidden value=$arr[id] name=id><input type=submit value='Edit'></td></tr></table></form>");
print("</td></tr><tr><td><form name=delete-rule method=post action=modrules.php?act=delete&id=$arr[id]><input type=hidden name=delete value=$arr[id]> <input class=btn type=submit value=DELETE ></form></td></tr>\n");
CloseTable();
}
echo "<br><br>";
echo "<br><br>";
}
include("footer.php");
?>
and this is the lang for english.php
<?php
// Rules
define("_btrules","Rules");
define("_brrulesadmin","Admin-Rules");
define("_btrulesmod","Moderator-Rules");
define("_btrulesprem","Premium-Rules");
define("_btrulesuser","User-Rules");
define("_btrulesgen","General-Rules");
define("_btrulesadd","Add New Rules Section");
define("_btrulesaddsect","Add Rule Section");
define("_btnamelevel","User Level for this rule");
define("_bttitle","Section Title");
define("_btlevel","Level");
define("_btrulesedit","Edit Rules");
?>
and this is the data base
-- Table structure for table `torrent_rules`
--
CREATE TABLE `torrent_rules` (
`id` int(11) NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`text` text NOT NULL,
`public` enum('yes','no') NOT NULL default 'yes',
`level` enum('user','premium','moderator','admin') NOT NULL default 'user',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
any thoughts??
[Updated on: Wed, 28 February 2007 00:55] Report message to a moderator
|
|
|
| Re: Candidates pmbt core [message #698 is a reply to message #664] |
Tue, 27 February 2007 22:35   |
|
Could you please STOP using mysql_xxx() functions and use $db->sql_xxx() functions instead? We lose all the compatibility with the standard PHP functions.
I haven't got ready the multi-db platform yet, and I don't think I will have the time ever, but if we write code that works only with MySQL, the day when someone will help us with multidb implementation we'll be forced to recheck all the code back
Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.
|
|
| | | | | | |
| Re: Candidates pmbt core [message #830 is a reply to message #829] |
Tue, 03 April 2007 05:04   |
|
Just to make sure we are on the same Idea you want like
user-page (your profile, personal settings, your torrents, privat messaging)
torrent page (torrent offers, torrent requists, torrents)
site page (News, Site announcements(birthdays,donation drives), FAQ's, Rules)Kinda like that??
|
|
|
| Re: Candidates pmbt core [message #862 is a reply to message #664] |
Thu, 05 April 2007 01:11  |
lodp  Messages: 336 Registered: June 2006 |
Releaser |
|
|
sorry to be answering so late .. i got a big paper to write, that's why i'm keeping low profile these days..
yeah, that's kinda what i had in mind, although which tabs exactly should be there, and what they should contain would have to be discussed.
if you ask me, i'd say let's keep this for the release following 1.2 (the site news, the rules-- i think it would take too long settling all this right now. it's better to release early and release often (as the old open source saying goes).
what would be left for this release would be to merge in the donation mod, mass-email(+pm?), avatars-in-shoutbox, maybe make a few changes to the wavetorrent theme, and we're set for 1.2
|
|
|
Goto Forum:
Current Time: Wed Feb 08 10:56:12 GMT 2012
Total time taken to generate the page: 0.00926 seconds
|