-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: Help with Jailing try this <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; print "<div id='content'>"; if($ir['jail'] or $ir['hospital']) { die(" <prb>This page cannot be accessed while in jail or hospital.</prb> [url='index.php']> Home[/url]"); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print " <prb>ERROR! - Invalid crime</prb> [url='index.php']> Home[/url]"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print " <prb>You do not have enough Brave to perform this crime.</prb> [url='index.php']> Home[/url]"; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print "<h1>".$r['crimeNAME']."</h1><hr width='90%' align='left' /> ".$r['crimeITEXT']."</p> "; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print " ".str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT'])."</p>"; $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print "<p class='crimefail'>".$r['crimeFTEXT']."</p>"; } else { print "<p class='crimejail'>".$r['crimeJTEXT']."</p>"; $db->query("UPDATE users SET jail=jail+1 WHERE userid=$userid"); $db->query("UPDATE users SET busted=busted+1 WHERE userid=$userid"); $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); $h->endpage(); exit; } } print " [url='docrime.php?c={$_GET[']> Try Again[/url]</p> [url='criminal.php']> Back to Crimes[/url]</p>"; } } $h->endpage(); ?>
-
Re: [mccode v2] Improved Security on Attack System Im a bit lost here or maybe im tired.. But usually a switch uses two actions 0=off 1=on My question is when someone is attacking which of the switches tells the SQL that they are no longer in a fight and can leave the screen ? As i can see the deafult is 1 and 1 being that they are atacking ?
-
Re: House Images Help It would depend on what you have named the table for house pics to show on your MYSQL if its hsepics <<< EXAMPLE then on your index page you would need to put in place If the pic is in an image folder say IMAGES then you would need to add this
-
[MMCODE V2] Set Sell Price of houses after they are Purchased...
Uridium replied to Uridium's topic in Free Modifications
Re: [MMCODE V2] Set Sell Price of houses after they are Purchased... Cheers guys for the updates :) hope it wasnt my script working failing me again lol -
if this has already been done then ya can delete me post if not then this mod will allow STAFF to set a sell price for each house they create. just add this SQL to the remaining houses SQLS ALTER TABLE houses ADD hSELLPRICE BIGINT(90) NOT NULL; Overwrite you old staff_houses.php with this one.. <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $sellprice=abs((int) $_POST['sellprice']); $will=abs((int) $_POST['will']); $name=$_POST['name']; $pic=$_POST['pic']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$sellprice', '$will', '$pic')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Sell Price: <input type='text' name='sellprice' /> Max Will: <input type='text' name='will' /> Pic: <input type='text' name='pic' /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $sellprice=abs((int) $_POST['sellprice']); $will=abs((int) $_POST['will']); $pic=$_POST['pic']; $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL='$will', hPRICE='$price', hSELLPRICE='$sellprice', hNAME='$name', hPIC='$pic' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> Sell Price: <input type='text' name='sellprice' value='{$old['hSELLPRICE']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /> Pic: <input type='text' name='pic', value='{$old['hPIC']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")." <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")." <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> Now in your estate.php look for $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=150,maxwill=150 WHERE userid=$userid",$c); and overwrite with. $db->query("UPDATE users SET money=money+'{$np['hSELLPRICE']}',will=150,maxwill=150 WHERE userid=$userid",$c); print "You sold your {$np['hNAME']} for \$$j".money_formatter($r['hSELLPRICE'],'')." Minus Lawyer fees and went back to your shed."; Dont forget to add a new table name called SELL HOUSE. and overwrite this <tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>{$r['hWILL']}</td> with this <tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td> <td>\$$j".money_formatter($r['hSELLPRICE'],'')."</td> <td>{$r['hWILL']}</td> And your done...
-
[MCCODES V2] Stop Users Refreshing attack pages / Leaving Fight
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] Stop Users Refreshing attack pages / Leaving Fight die ("Continue Fight"); -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling When you create a new Education are all the Parts you added avilable. goto EDIT the education youve just made and see if any are set to zero and not like the ones you created... -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game FF can be a pain in the rase ive downloaded the plugin 5 times for the lpayer and its stillsa ying i havent got it.. best to use IE or Google Chrome :) -
Re: Great Potential Im going to give you +1 for making something unique and hope you will sahre more scripts. :)
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling for those having issues with the updating of the hourly cron add $db->query("UPDATE users SET minus_clicks=0"); $db->query("UPDATE users SET clickend=0"); -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Seems i made a mistake on the staff_courses so back itup and overwrite with this one. <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains course stuffs switch($_GET['action']) { case "addcourse": addcourse(); break; case "editcourse": editcourse(); break; case "delcourse": delcourse(); break; default: print "Error: This script requires an action."; break; } function addcourse() { global $db, $ir, $c, $h, $userid; $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); if($_POST['name'] && $_POST['desc'] && $cost && $cashprize && $item && $qty) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$cashprize', '$item', '$qty', '$energy', '$comppercent', '$percent', '$clicks', '$perclicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added."; stafflog_add("Added course {$_POST['name']}"); } else { print "<h3>Add Course</h3><hr /> <form action='staff_courses.php?action=addcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <th>Course Name: <input type='text' name='name' /> </th> <th>Course Description: <input type='text' name='desc' /> </th> <th>Starting Text: <input type='text' name='starting' /> </th> <th>Completed Text: <input type='text' name='completed' /> </th> <th>Course Target Percent: <input type='text' name='compperent' /> example 100% - 10000% </th></tr> <th>Percent Gain: <input type='text' name='percent' /> Example 1 to 99999 </th> <th>Clicks Per Day: <input type='text' name='clicks' /> Example 18 </th> <th>Clicks Per Session: <input type='text' name='perclicks' /> Example 3 Per Session </th> <th>Cost (Money): <input type='text' name='cost' /> </th> <th>Cash Prize: <input type='text' name='cashprize' /> </th></tr> <th>Item Prize: <input type='text' name='item' /> Enter Inventory item ID </th> <th>Quantity: <input type='text' name='qty' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th> <th>Strength Gain: <input type='text' name='str' /> </th> <th>Agility Gain: <input type='text' name='agil' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' /> </th> <th>Labour Gain: <input type='text' name='lab' /> </th> <th>IQ Gain: <input type='text' name='iq' /> </th> <input type='submit' value='Add Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE courses SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crITEM=$item, crQTY=$qty, crENERGY=$energy, crCOMPPERCENT=$comppercent, crPERCENT=$percent, crCLICKS=$clicks, crPERCLICKS=$perclicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "<h1>Course $name was edited successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> <th>Name: <input type='text' name='name' value='{$old['crNAME']}' /> </th> <th>Description: <input type='text' name='desc' value='{$old['crDESC']}' /> </th> <th>Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> </th> <th>Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> </th> <th>Course Target(percent): <input type='text' name='comppercent' value='{$old['crCOMPPERCENT']}' /> </th></tr> <th>Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> </th> <th>Clicks Per Day : <input type='text' name='clicks' value='{$old['crCLICKS']}' /> </th> <th>Clicks Per Session: <input type='text' name='perclicks' value='{$old['crPERCLICKS']}' /> </th> <th>Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> </th> <th>Cash Prize : <input type='text' name='cashprize' value='{$old['crCASHPRIZE']}' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> </th> <th>Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> </th> <th>IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> </th> <input type='submit' value='Edit Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT ANOTHER COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM courses WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted. [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE ANOTHER COURSE ][/url]"; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url]"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Cheers Badgirl there isnt an ARRAY hidden in there somewhere is there lol OOPS only joking lol -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Cheers matey i was never any good at adding SQLS i usually do them whilst in phpmyadmin and never take not of the correct procedure :) -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game UPDATE TURN VIDEO PREVIEWING ON OR OFF + SEARCH FOR MEDIA This will allow your users to Turn off or on the video Preview mode which is seen from the videos.php screen SQL ALTER TABLE 'users' ADD 'preview' INT( 2 ) NOT NULL DEFAULT '0'; now open up preferences.php Add this with the rest of the LINKS.. Turn Video Preview: [url='preferences.php?action=previewon']ON[/url] or [url='preferences.php?action=previewoff']OFF[/url] "; In the CASE section add case 'previewon': preview_on(); break; case 'previewoff': preview_off(); break; at the bottom of the page add function preview_on() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET preview=0 WHERE userid=$userid"); Print"<h2> Video Previewing Enabled</h2> [url='index.php']Return To Game[/url] or [url='videos.php']Goto Videos[/url]"; } function preview_off() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET preview=1 WHERE userid=$userid"); Print"<h2> Video Previewing Disabled</h2> [url='index.php']Return To Game[/url] or [url='videos.php']Goto Videos[/url]"; } overwrite videos.php with this one... <?php include "globals.php"; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'tracktitle'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; if($ir['preview']==0) { print "<h3>Videos</h3>"; print "<form action='searchvideo.php' method='get'><input type='text' name='searchvideo' /><input type='submit' value='Search Video' /></form>"; $cnt=$db->query("SELECT * FROM videos",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*10; print "[url='videos.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='videos.php?st=$st&by=videoalphabet&ord=$ord']Alphabet Letter[/url] | [url='videos.php?st=$st&by=artist&ord=$ord']artist[/url] | [url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Title[/url] [url='videos.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='videos.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT * FROM videos ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+10; print "Showing Videos $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>[url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Name[/url]</th><th>[url='videos.php?st=$st&by=artist&ord=$ord']Artists Name[/url]</th><th>[url='videos.php?st=$st&by=videoalphabet&ord=$ord']Letter[/url]</th><th>Preview</th><th>[url='videos.php?st=$st&by=source&ord=$ord']Source[/url]</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['tracktitle']) { $r['artist'] = "<font color=yellow>{$r['artist']}</font>";$d=""; } print "<tr><td>{$r['tracktitle']}</td><td>[url='playvideo.php?u={$r[']{$r['artist']}[/url]</td><td>{$r['videoalphabet']}</td><td><center><embed src='{$r['playerswflink']}' width='100' height='100' allowsiptallowaccess='{$r['videophplink']}' allowfullseen='true' flashvars='height=100&width=100&file={$r['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight=100&autostart='false'/></a></embed><td>{$r['source']}</td></center> </td>"; print "</td></tr>"; } print "</table>"; } else if($ir['preview']==1) { print "<h3>Videos</h3>"; print "<form action='searchvideo.php' method='get'><input type='text' name='searchvideo' /><input type='submit' value='Search Video' /></form>"; $cnt=$db->query("SELECT * FROM videos",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*10; print "[url='videos.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='videos.php?st=$st&by=videoalphabet&ord=$ord']Alphabet Letter[/url] | [url='videos.php?st=$st&by=artist&ord=$ord']artist[/url] | [url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Title[/url] [url='videos.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='videos.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT * FROM videos ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+10; print "Showing Videos $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>[url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Name[/url]</th><th>[url='videos.php?st=$st&by=artist&ord=$ord']Artists Name[/url]</th><th>[url='videos.php?st=$st&by=videoalphabet&ord=$ord']Letter[/url]</th><th>[url='videos.php?st=$st&by=source&ord=$ord']Source[/url]</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['tracktitle']) { $r['artist'] = "<font color=yellow>{$r['artist']}</font>";$d=""; } print "<tr><td>{$r['tracktitle']}</td><td>[url='playvideo.php?u={$r[']{$r['artist']}[/url]</td><td>{$r['videoalphabet']}</td><td>{$r['source']}</td></center> </td>"; print "</td></tr>"; } print "</table>"; } $h->endpage(); ?> And create a file called searchvideo.php <?php include "globals.php"; if(!$_GET['searchvideo']) { print "You did not enter anything! [size="1"]> [/size][url='videos.php']Back[/url]"; } else { $video=$db->query("SELECT * FROM videos WHERE artist LIKE ('%{$_GET['searchvideo']}%')"); print $db->num_rows($video)." Search Results <table width=75% border=1 cellspacing=0> <th bgcolor=#000000>Artist</th> <th bgcolor=#111111>Video Track</th> <th bgcolor=#222222>Watch</th> </tr>"; while($ir=$db->fetch_row($video)) { print "<tr> <td bgcolor=#999999>{$ir['artist']}</a></td> <td bgcolor=#999999>{$ir['tracktitle']}</a></td> <td bgcolor=#999999><center>[[url='playvideo.php?u={$ir['][size="1"]<font color=yellow>Watch</font>[/size][/url]]</center></td> </tr>"; } print "</table> [size="1"]> [/size][url='videos.php']Back[/url]"; } $h->endpage(); ?> -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Let me grab my copy off the FTP the one i posted is one from my PC i may have edited that before hand gizza sec. -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game one new SQL to add... ALTER TABLE videos ADD source VARCHAR (255) NOT NULL; Overwrite your staff_videos.php with this one <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains video stuffs switch($_GET['action']) { case "addvideo": addvideo(); break; case "editvideo": editvideo(); break; case "delvideo": delvideo(); break; default: print "Error: This sipt requires an action."; break; } function addvideo() { global $db, $ir, $c, $h, $userid; $videoidlink=abs((int) $_POST['videoidlink']); $width=abs((int) $_POST['width']); $height=abs((int) $_POST['height']); if($_POST['name'] && $_POST['title'] && $videoidlink && $height && $width) { $db->query("INSERT INTO videos VALUES(NULL, '{$_POST['name']}', '{$_POST['title']}', '{$_POST['alphabet']}', '{$_POST['playerswflink']}', '{$_POST['videophplink']}', '{$_POST['allowaccess']}', '{$_POST['autostart']}', '$videoidlink', '$width', '$height', '{$_POST['source']}')"); print "video Artist {$_POST['name']} Track Title {$_POST['title']} added. <h1>Preview</h1> <center><embed src='{$_POST['playerswflink']}' width='$width' height='$height' allowsiptallowaccess='{$_POST['videophplink']}' allowfullseen='true' flashvars='height=$height&width=$width&file={$_POST['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight=$height&autostart={$_POST['autostart']}'/></a></embed></center> "; stafflog_add("Added video {$_POST['title']}"); } else { print "<h3>Add video</h3><hr /> <form action='staff_videos.php?action=addvideo' method='post'> Artist Name: <input type='text' name='name' /> Track Title: <input type='text' name='title' /> Alphabet Letter: <input type='text' name='alphabet' /> SWF Link: <input type='text' name='playerswflink' /> Example [url]http://www.domain.com/music/vplayer.swf[/url] PHP link: <input type='text' name='videophplink' /> Example [url]http://www.domain.com/music/flash.php?id=[/url] Allow allowaccess: <input type='text' name='allowaccess' /> Default always Autostart Media: <input type='text' name='autostart' /> true or false Video ID Number: <input type='text' name='videoidlink' /> example 17635 Player Width: <input type='text' name='width' /> default 350 Player Height: <input type='text' name='height' />default 400 Video Source: <input type='text' name='source' />Example youtube.com <input type='submit' value='Add video' /></form>"; } } function editvideo() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $videoidlink=abs((int) $_POST['videoidlink']); $width=abs((int) $_POST['width']); $height=abs((int) $_POST['height']); $name=$_POST['name']; $db->query("UPDATE videos SET artist='$name', tracktitle='{$_POST['title']}', videoalphabet='{$_POST['alphabet']}', playerswflink='{$_POST['playerswflink']}', videophplink='{$_POST['videophplink']}' , videoidlink=$videoidlink, width=$width, height=$height, source='{$_POST['source']}' WHERE videoID={$_POST['video']}"); print "video $name was edited successfully. <h1>Preview</h1> <center><embed src='{$_POST['playerswflink']}' width='$width' height='$height' allowsiptallowaccess='{$_POST['allowaccess']}' allowfullseen='true' flashvars='height=$height&width=$width&file={$_POST['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight=$height&autostart={$_POST['autostart']}'/></a></embed></center> "; stafflog_add("Edited video $name"); break; case "1": $q=$db->query("SELECT * FROM videos WHERE videoID={$_POST['video']}"); $old=$db->fetch_row($q); print "<h3>Editing a video</h3><hr /> <form action='staff_videos.php?action=editvideo' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='video' value='{$_POST['video']}' /> Artist Name <input type='text' name='name' value='{$old['artist']}' /> Track Title: <input type='text' name='title' value='{$old['tracktitle']}' /> Alphabet Entry: <input type='text' name='alphabet' value='{$old['videoalphabet']}' /> SWF link Text: <input type='text' name='playerswflink' value='{$old['playerswflink']}' /> PHP Link Text: <input type='text' name='videophplink' value='{$old['videophplink']}' /> Allow allowaccess: <input type='text' name='allowaccess' value='{$old['allowaccess']}' /> Auto Start: <input type='text' name='autostart' value='{$old['autostart']}' />true or false Video ID Number: <input type='text' name='videoidlink' value='{$old['videoidlink']}' /> Player Width: <input type='text' name='width' value='{$old['width']}' /> Player Height: <input type='text' name='height' value='{$old['height']}' /> Video Source: <input type='text' name='source' value='{$old['source']}' /> <input type='submit' value='Edit video' /></form>"; break; default: print "<h3>Editing a video</h3><hr /> <form action='staff_videos.php?action=editvideo' method='post'> <input type='hidden' name='step' value='1' /> video: ".video2_dropdown($c, "video")." <input type='submit' value='Edit video' /></form>"; break; } } function delvideo() { global $db,$ir,$c,$h,$userid; if($_POST['video']) { $q=$db->query("SELECT * FROM videos WHERE videoID={$_POST['video']}"); $old=$db->fetch_row($q); $db->query("DELETE FROM videos WHERE videoID={$_POST['video']}"); print "video {$old['tracktitle']} deleted."; stafflog_add("Deleted video {$old['tracktitle']}"); } else { print "<h3>Deleting a video</h3><hr /> <form action='staff_videos.php?action=delvideo' method='post'> video: ".video2_dropdown($c, "video")." <input type='submit' value='Delete video' /></form>"; } } $h->endpage(); ?> Now over write your playvideo.php with this one <?php include "globals.php"; global $db,$r,$c,$userid; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'tracktitle'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; $_GET['u'] = abs((int) $_GET['u']); if(!$_GET['u']) { print "Invalid use of file"; } else { $video=$db->query("SELECT * FROM videos WHERE videoID={$_GET['u']}",$c); if($db->fetch_row($video) == 0) { print "There is no such video!"; } else { $r=$db->query("SELECT artist, tracktitle, playerswflink, videophplink, width, height, allowaccess FROM videos WHERE videoID={$_GET['u']}",$c); $r = $db->fetch_row($r); print " <h1>Artist <font color='yellow'>{$r['artist']}</font> Track <font color='yellow'> {$r['tracktitle']}</font></h1> <h1>Session Playing</h1> [img=curtains.png] <DIV STYLE='position:absolute; top:500px; left:360px; width:200px; height:50px'> <CENTER><FONT SIZE='+2' COLOR='00ff00'><embed src='{$r['playerswflink']}' width='{$r['width']}' height='{$r['height']}' allowsiptallowaccess='{$r['allowaccess']}' allowfullseen='true' flashvars='height={$r['height']}&width={$r['width']}&file={$r['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight={$r['height']}&autostart='{$r['autostart']}' /></a></embed></center> </FONT></CENTER> </DIV> "; } } $h->endpage(); ?> And upload this image -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game I'll repost my copy as ive made some amendements -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Quick Update..... When i Re-post the upgraded Mod... Users can Add, Edit their own Videos (Staff will still have power to remove any videos) And just so users dont go mental and start adding Millions od Videos they are set to only ADD 3 videos per week. Users can also save Videos to their Video Vault for easy access...... Also changed a few things on the Original script. -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game To get videos to work breif guide When you goto youtube and open up a video link on the right there is an embed code.... <object width="560" height="340"><param name="movie" value=" "></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src=" " type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object> you need to place this piece only into the SWF LINK and the PHP LINK -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game did you also ammend the SQL error i made... I did post the fix. -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game You dont just have to use Video formats to work on this you can also Use mp3 wav midi even link to your own radio site if you have one it will play anything...... For MP3 media to work put the full URL for the track you want to play in both the SWF and the PHP link and set the ID number to 1...... Same applies for the Radio..... -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Liven it up a notch.. -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Media tested on phpmotion google youtube musicjesus myspace dailymotion All work perfectly -
[mccodes V2] Add any type of video media to your game
Uridium replied to Uridium's topic in Free Modifications
Re: [mccodes V2] Add any type of video media to your game Finally completed the user section..... call this files videos.php <?php include "globals.php"; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'tracktitle'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; print "<h3>Userlist</h3>"; $cnt=$db->query("SELECT * FROM videos",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*10; print "[url='videos.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='videos.php?st=$st&by=videoalphabet&ord=$ord']Alphabet Letter[/url] | [url='videos.php?st=$st&by=artist&ord=$ord']artist[/url] | [url='videos.php?st=$st&by=tracktitle&ord=$ord']Track Title[/url] [url='videos.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='videos.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT * FROM videos ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+10; print "Showing Videos $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Track Name</th><th>Artists Name</th><th>Letter</th><th>Preview</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['tracktitle']) { $r['artist'] = "<font color=yellow>{$r['artist']}</font>";$d=""; } print "<tr><td>{$r['tracktitle']}</td><td>[url='playvideo.php?u={$r[']{$r['artist']}[/url]</td><td>{$r['videoalphabet']}</td><td><center><embed src='{$r['playerswflink']}' width='100' height='100' allowsiptallowaccess='{$r['videophplink']}' allowfullseen='true' flashvars='height=100&width=100&file={$r['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight=100&autostart='false'/></a></embed></center> </td>"; print "</td></tr>"; } print "</table>"; $h->endpage(); ?> And call this file playvideo.php <?php include "globals.php"; global $db,$r,$c,$userid; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'tracktitle'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; $_GET['u'] = abs((int) $_GET['u']); if(!$_GET['u']) { print "Invalid use of file"; } else { $video=$db->query("SELECT * FROM videos WHERE videoID={$_GET['u']}",$c); if($db->fetch_row($video) == 0) { print "There is no such video!"; } else { $r=$db->query("SELECT artist, tracktitle, playerswflink, videophplink, width, height, allowaccess FROM videos WHERE videoID={$_GET['u']}",$c); $r = $db->fetch_row($r); print " <h1>Artist <font color='yellow'>{$r['artist']}</font> Track <font color='yellow'> {$r['tracktitle']}</font></h1> <h1>Session Playing</h1> <center><embed src='{$r['playerswflink']}' width='{$r['width']}' height='{$r['height']}' allowsiptallowaccess='{$r['allowaccess']}' allowfullseen='true' flashvars='height={$r['height']}&width={$r['width']}&file={$r['videophplink']}&backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xCC0000&displayheight={$r['height']}&autostart='false'/></a></embed></center> "; //$db->query("UPDATE videos SET videoVIEWS=videoVIEWS+1 WHERE videoID={$_GET['u']}"); } } $h->endpage(); ?> Few Screenies From SELECT menu From Play Screen... TEST SITE http://www.mccode.doom-nights.com Look on left menu near bottom for Video Link. -
Re: adding php to an embed code ? At long last ive fixed the stupid god foresaken damn annoying thing ;) test site www.mccode.doom-nights.com/videos.php