this is only a little mod, but as i aint that good its ok i suppose, but some1 might like it and use it,
this allows the gang owner to set level requirements for users wishing to join the gang see on the view gang page before they join to save them putting it in descriptions ?
ok open creategang.php and find
$name=htmlspecialchars($_POST['name']);
$desc=htmlspecialchars($_POST['desc']);
$db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,1000,$userid,$userid,5,0,0,'')");
and replace with
$name=htmlspecialchars($_POST['name']);
$desc=htmlspecialchars($_POST['desc']);
$req=htmlspecialchars($_POST['req']);
$db->query("INSERT INTO gangs VALUES('','$name','$desc','$req','','',0,0,1000,$userid,$userid,5,0,0,'')");
the save and close, then open yourgang.php and find
case "desc":
gang_staff_desc();
break;
and below add
case "req":
gang_staff_req();
break;
and the link of course below "Change Gang Requirements.
" then look for
function gang_staff_desc()
{
global $db,$ir,$c,$userid,$gangdata;
if($gangdata['gangPRESIDENT'] == $userid )
{
if(isset($_POST['subm']))
{
$_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", "
"), $_POST['vp']);
$db->query("UPDATE gangs SET gangDESC='{$_POST['vp']}' WHERE gangID={$gangdata['gangID']}");
print "Gang description changed!
<br />
<a href='yourgang.php?action=staff'> Back</a>";
}
else
{
print "Current Description: <br />
{$gangdata['gangDESC']} <br />
<form action='yourgang.php?action=staff&act2=desc' method='post'>
Enter the new description.<br />
<br />
<input type='hidden' name='subm' value='submit' />
Desc: <br />
<textarea name='vp' cols='40' rows='7'></textarea>
<br />
<input type='submit' value='Change' /></form>";
}
}
}
below that add
function gang_staff_req()
{
global $db,$ir,$c,$userid,$gangdata;
if($gangdata['gangPRESIDENT'] == $userid )
{
if(isset($_POST['subm']))
{
$_POST['vp']=str_replace(array("<", ">", "\n"), array("<", ">", "
"), $_POST['vp']);
$db->query("UPDATE gangs SET gangREQ='{$_POST['vp2']}' WHERE gangID={$gangdata['gangID']}");
print "Gang Requirements changed!
<br />
<a href='yourgang.php?action=staff'>Back</a>";
}
else
{
print "Current Requirements: <br />
{$gangdata['gangREQ']} <form action='yourgang.php?action=staff&act2=req' method='post'>
Enter the new requirements.<br />
<input type='hidden' name='subm' value='submit' />
<br />
<textarea name='vp2' cols='40' rows='7'></textarea>
<br />
<input type='submit' value='Change' /></form>";
}
}
}
then save that file,
then open gangs.php and look for
<b>Description: </b> {$gangdata['gangDESC']}
below that add
<br /><b>Requirements: </b> {$gangdata['gangREQ']}
then save that file then import this into your phpmyadmin
ALTER TABLE gangs ADD gangREQ text NOT NULL;