Jump to content
MakeWebGames

peterisgb

Members
  • Posts

    759
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by peterisgb

  1. I know this is a late reply, but working on it slowly. Ive got this $file = ($_POST['episode']); $direc = ($_POST['dir']); $path_parts = pathinfo(''.$_POST['episode'].''); $dir = ($path_parts['dirname']); $base = ($path_parts['basename']); $ext = ($path_parts['extension']); $name = ($path_parts['filename']); $sql = "INSERT INTO `tvdir` (`id`, `directory`, `series`, `episode`, `name`, `desc`) VALUES (NULL, '{$_POST['episode']}', '{$dir}', '{$name}', '', '')"; if ($mysqli->query($sql)) { //echo "New Record has id ".$mysqli->insert_id; echo "<p>Entered Into Database!</p>"; } else { echo "<p>MySQL error no {$mysqli->errno} : {$mysqli->error}</p>"; exit(); }   which does place it into the database, but my knowledge isnt good enough to firgure out how to do them all at once.
  2. I did have this at one stage but no longer, sorry
  3. This was good however i have some bad news. goinstant.com is closing. Read more here https://goinstant.com/blog/time-to-say-farewell
  4.   I've been looking forward to this myself. cant wait.
  5. <?php include "globals.php"; include "bbcode.php"; include "bbcodestyle.css"; if($ir['mailban']) { printf("<span style='color:red;'><h3>ERROR</h3>You have been mail banned for {$ir['mailban']} days.<strong>Reason: {$ir['mb_reason']}</font></strong>"); $h->endpage(); exit; } $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(@intval($_GET['ID'])) : null; if($ir['pagetutorials'] == 'ON') { echo " <table width='75%' border='3' bordercolor='#BDBDBD' cellspacing='0' bgcolor='#FBFBE0' frame='border'> <tr> <td width='75'><img src='images/lightbulb.gif' alt='Lightbulb' /><br /><span style='color:#999;'><em>[<a href='preferences.php?action=pagetutorialschange'></a>]</em></span></td> <td><strong>Your Mailbox</strong><br /><span style='color:#000;font-size:3em;'>Hopefully, I shouldnt have to tell you how this works.</span></td> </tr> </table><br />"; } echo "<br /><hr /><br /><table width='87%' class='table' cellspacing='1' style='text-align:center;'> <tr> <td><a href='mailbox.php?action=inbox'><img src='images/indox.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=outbox'><img src='images/sent.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=compose'><img src='images/compose.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=delall'><img src='images/deleteall.gif' width='75px' height='79px'></a></td> <td><a href='mailbox.php?action=archive'><img src='images/archiveall.gif' width='75px' height='79px'></a></td> <td><a href='contactlist.php'><img src='images/contacts.gif' width='75px' height='79px'></a></td> </tr> </table><br /><hr /><br />"; $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'inbox': mail_inbox(); break; case 'outbox': mail_outbox(); break; case 'compose': mail_compose(); break; case 'delete': mail_delete(); break; case 'delall': mail_delall(); break; case 'archive': mail_archive(); break; case 'del': mail_massdel(); break; case 'read': mail_view(); break; default: mail_inbox(); break; } function mail_inbox() { global $db, $ir, $c, $userid, $h; ?> <script><!-- HIDE function setCheckboxes(the_form, do_check) { var elts = (typeof(document.forms[the_form].elements['ID[]']) != 'undefined') ? document.forms[the_form].elements['ID[]'] : (typeof(document.forms[the_form].elements['ID[]']) != 'undefined') ? document.forms[the_form].elements['ID[]'] : document.forms[the_form].elements['ID[]']; var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0; if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; } // end for } else { elts.checked = do_check; } // end if... else return true; } // STOP HIDING --></script> Only the last 25 messages sent to you are visible. <form name='masssell' method='post' action='mailbox.php?action=del'> <table width='100%' class='table1' cellspacing='1' border='0'> <tr> <th>From</th> <th>Status</th> <th>Read</th> <th>Delete</th> </tr> <?php $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_from` = `u`.`userid`) " . "WHERE (`m`.`mail_to` = %d) " . "ORDER BY `m`.`mail_time` DESC LIMIT 25", $ir['userid'])); $i = 0; while($r = $db->fetch_row($q)) { printf("<tr class='d%d'>", $i & 1); $i++; echo "<td>"; echo $r['mail_from'] ? sprintf("<center><a href='viewuser.php?u=%d' style='color:%s;'>%s</a> (%s)", $r['mail_from'], stripslashes($r['colour']), stripslashes($r['username']), number_format($r['mail_from'])) : "<span style='color:yellow;font-weight:700;'>SYSTEM</span>"; echo "</center></td>"; printf("<td>%s</td>", !$r['mail_read'] ? "<span style='color:red;'>Unopened</span>" : "<span style='color:green;'>Read</span>"); printf("<td><a href='mailbox.php?action=read&ID=%d'>Open</a></td>", $r['mail_id']); printf("<td><a href='mailbox.php?action=delete&ID=%d'><img src='images/trash.gif' height='20' width='20' alt='Delete' /></a> <input type='checkbox' name='del%d' value='yes' /><input type='hidden' name='id%d' value='%d' /></td>", $r['mail_id'], $i, $i, $r['mail_id']); echo "</tr>"; } ?> <tr> <td colspan='5'><center><hr /><input name='sellmass' type='submit' id='sellmass' value='Delete selected' /><br /><a href='#' onClick='setCheckboxes("masssell",true); return false;'>Check All</a> | <a href='#' onClick='setCheckboxes("masssell",false); return true;'>Uncheck All </a></center></td> </tr> </table> </form><? } function mail_outbox() { global $db, $ir, $c, $userid, $h; ?>Only the last 25 messages you have sent are visible.<br /> <table width='75%' cellspacing='1' class='table'> <tr> <th>To</th> <th>Message</th> </tr><? $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_to` = `u`.`userid`) " . "WHERE (`m`.`mail_from` = %d) " . "ORDER BY `m`.`mail_time` DESC LIMIT 25", $ir['userid'])); while($r = $db->fetch_row($q)) { echo "<tr>"; printf("<td><a href='viewuser.php?u=%d' style='color:%s;'>%s</a> [%s]</td>", $r['mail_from'], $r['colour'], stripslashes($r['username']), number_format($r['mail_from'])); printf("<td>%s</td>", stripslashes($r['mail_subject'])); echo "</tr>"; echo "<tr>"; printf("<td>Sent at: %s</td>", date('F j, Y, g:i:s a', $r['mail_time'])); printf("<td>%s</td>", stripslashes($r['mail_text'])); echo "</tr>"; } echo '</table>'; } function mail_compose() { global $db, $ir, $db, $userid, $h; if(!isset($_POST['form'])) { ?><script type="text/javascript"> function insert(el,ins) { if (el.setSelectionRange){ el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length); } else if (document.selection && document.selection.createRange) { el.focus(); var range = document.selection.createRange(); range.text = ins + range.text; } } </script> <form action='mailbox.php?action=compose' method='post'> <input type='hidden' name='form' value='1' /> <table width='75%' border='0'> <tr> <th>ID to send to:</th> <td><input type='text' name='userid' value='<? echo $_GET['ID']; ?>' style='color: white; background-color:#2E2E2E' class='loginbox' /></td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <th>Message:</th> <td> <input type="button" class="bbcode_hover" onClick="insert(this.form.message,'[b][/b]'); return false;" value="" /> <input type="button" class="bbcode_hover0" onClick="insert(this.form.message,'[br]'); return false;" value="" /> <input type="button" class="bbcode_hover1" onClick="insert(this.form.message,'[i][/i]'); return false;" value="" /> <input type="button" class="bbcode_hover2" onClick="insert(this.form.message,'[u][/u]'); return false;" value="" /> <input type="button" class="bbcode_hover3" onClick="insert(this.form.message,'[url][/url]'); return false;" value="" /> <input type="button" class="bbcode_hover5" onClick="insert(this.form.message,'[img][/img]'); return false;" value="" /> <input type="button" class="bbcode_hover7" onClick="insert(this.form.message,'[color=#xxxxxx][/color]'); return false;" value="" /> <br /> <input type="image" src="smilies/smiley1.gif" alt="Smile" title="smile" onclick="insert(this.form.message,':)'); return false;" /> <input type="image" src="smilies/smiley2.gif" alt="Wink" title="Wink" onclick="insert(this.form.message,';)'); return false;" /> <input type="image" src="smilies/smiley3.gif" alt="Suprised" title="Suprised" onclick="insert(this.form.message,':o'); return false;" /> <input type="image" src="smilies/smiley4.gif" alt="Cheesy Grin" title="Cheesy Grin" onclick="insert(this.form.message,':D'); return false;" /> <input type="image" src="smilies/smiley5.gif" alt="Confused" title="Confused" onclick="insert(this.form.message,':s'); return false;" /> <input type="image" src="smilies/smiley6.gif" alt="Sad" title="Sad" onclick="insert(this.form.message,':('); return false;" /> <input type="image" src="smilies/smiley7.gif" alt="Angry" title="Angry" onclick="insert(this.form.message,':red'); return false;" /> <input type="image" src="smilies/smiley8.gif" alt="Clown" title="Clown" onclick="insert(this.form.message,':clown'); return false;" /> <input type="image" src="smilies/smiley9.gif" alt="Embarrassed" title="Embarrassed" onclick="insert(this.form.message,':bashful'); return false;" /> <input type="image" src="smilies/smiley10.gif" alt="Star" title="Star" onclick="insert(this.form.message,':x'); return false;" /> <input type="image" src="smilies/smiley11.gif" alt="Sick" title="Sick" onclick="insert(this.form.message,':green'); return false;" /> <input type="image" src="smilies/smiley12.gif" alt="Bored" title="Bored" onclick="insert(this.form.message,':|'); return false;" /> <input type="image" src="smilies/smiley13.gif" alt="Begging" title="Begging" onclick="insert(this.form.message,';('); return false;" /> <input type="image" src="smilies/smiley14.gif" alt="Smug" title="Smug" onclick="insert(this.form.message,':]'); return false;" /> <input type="image" src="smilies/smiley15.gif" alt="Horny" title="Horny" onclick="insert(this.form.message,':horny'); return false;" /> <input type="image" src="smilies/smiley16.gif" alt="Cool" title="Cool" onclick="insert(this.form.message,':cool'); return false;" /><br /> <textarea name='message' rows='10' cols='70' style='color: white; background-color: #2E2E2E' class="loginbox"></textarea> </td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2' class='center'><center><input type='image' src='images/mailsend.jpeg' id='btn' name='submit' /></center></td> </tr> </table> </form><? if($_GET['ID']) { echo "<br /><hr /><br /> <table width='75%' border='0'> <tr> <th colspan='2'>Your last 5 mails to/from this person:</th> </tr>"; $q = $db->query(sprintf("SELECT `m`.*, `u1`.`username` AS `sender` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u1` ON (`m`.`mail_from` = `u1`.`userid`) " . "WHERE (((`m`.`mail_from` = %d) AND (`m`.`mail_to` = %d)) OR ((`m`.`mail_to` = %d) AND (`m`.`mail_from` = %d))) " . "ORDER BY `m`.`mail_time` DESC LIMIT 5", $ir['userid'], $_GET['ID'], $ir['userid'], $_GET['ID'])); if(!$db->num_rows($q)) { echo "<tr><td colspan='2' class='center'>No messages exist</td></tr>"; } else { while($r = $db->fetch_row($q)) { echo "<tr>"; printf("<td>%s</td>", date('F j, Y, g:i:s a', $r['mail_time'])); printf("<td><strong><span style='color:%s;'>%s</span> [%s] wrote:</strong> %s</td>", stripslashes($r['colour']), stripslashes($r['sender']), number_format($_GET['ID']), stripslashes($r['mail_text'])); echo "</tr>"; } } echo '</table>'; } } else { $_POST['userid'] = isset($_POST['userid']) && ctype_digit($_POST['userid']) ? abs(@intval($_POST['userid'])) : null; if(empty($_POST['userid'])) { echo "You didn't select a valid player to send a message to"; $h->endpage(); exit; } $selectPlayer = $db->query(sprintf("SELECT `username` FROM `users` WHERE (`userid` = %d)", $_POST['userid'])); if(!$db->num_rows($selectPlayer)) { echo "That player doesn't exist"; $h->endpage(); exit; } $subj = str_replace("\n", "<br />", strip_tags($_POST['subject'])); $codes = array( ":)", ";)", ":o", ":D", ":s", ":(", ":red", ":clown", ":bashful", ":x", ":green", ":|", ";(", ":]", ":horny", ":cool", "(LK)", "(O)" ); $images = array( "<img src='smilies/smiley1.gif' />", "<img src='smilies/smiley2.gif' />", "<img src='smilies/smiley3.gif' />", "<img src='smilies/smiley4.gif' />", "<img src='smilies/smiley5.gif' />", "<img src='smilies/smiley6.gif' />", "<img src='smilies/smiley7.gif' />", "<img src='smilies/smiley8.gif' />", "<img src='smilies/smiley9.gif' />", "<img src='smilies/smiley10.gif' />", "<img src='smilies/smiley11.gif' />", "<img src='smilies/smiley12.gif' />", "<img src='smilies/smiley13.gif' />", "<img src='smilies/smiley14.gif' />", "<img src='smilies/smiley15.gif' />", "<img src='smilies/smiley16.gif' />", "<img src='lk.png' />", "<img src='one.png' />" ); $newmsg = $db->escape(str_replace($codes, $images, $_POST['message'])); $to = $_POST['userid']; $db->query(sprintf("INSERT INTO `mail` VALUES ('', 0, %d, %d, %s, '%s', '%s')", $ir['userid'], $to, time(), $subj, $newmsg)); $db->query(sprintf("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE (`userid` = %d)", $to)); printf("Your message to %s has been sent", stripslashes($player)); } } function mail_delete() { global $db, $ir, $c, $userid, $h; if(empty($_GET['ID'])) { echo "You didn't select a valid message to delete"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT `mail_id` FROM `mail` WHERE ((`mail_id` = %d) AND (`mail_to` = %d))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($select)) { echo "Either that message doesn't exist, or it's not yours"; $h->endpage(); exit; } $db->query(sprintf("DELETE FROM `mail` WHERE (`mail_id` = %d)", $_GET['ID'])); echo "Message deleted.<br /><a href='mailbox.php'>> Back</a>"; } function mail_view() { global $db, $ir, $c, $userid, $h; ?><table width='100%' class='table' border='0' cellspacing='1'> <tr> <th width='25%'>From</th> <th width='75%'>Message</th> </tr><? $q = $db->query(sprintf("SELECT `m`.*, `u`.`username` FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_from` = `u`.`userid`) " . "WHERE ((`m`.`mail_id` = %d) AND (`m`.`mail_to` = %d))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($q)) { echo "Either that message doesn't exist, or it's not yours"; $h->endpage(); exit; } $r = $db->fetch_row($q); echo "<tr>"; printf("<td>%s</td>", $r['mail_from'] ? sprintf("<a href='viewuser.php?u=%d' style='color:%s;'>%s</a> [%s]", $r['mail_from'], stripslashes($r['colour']), stripslashes($r['username']), number_format($r['mail_from'])) : "SYSTEM"); printf("<td>%s</td>", stripslashes($r['mail_subject'])); echo "</tr>"; echo "<tr>"; printf("<td>Sent at: %s<br /><br /><a href='mailbox.php?action=compose&ID=%d'>Reply</a><br /><a href='mailbox.php?action=delete&ID=%d'>Delete</a><br /><a href='preport.php?ID=%d'>Report</a></td>", date('F j, Y, g:i:s a', $r['mail_time']), $r['mail_from'], $r['mail_id'], $r['mail_from']); printf("<td>%s</td>", stripslashes($r['mail_text'])); echo "</tr>"; echo "</table>"; if($r['mail_text'] == 'You have just been mailed bomb, damm unlucky.') { $db->query(sprintf("UPDATE `users` SET `hospital` = `hospital` + %d, `hospreason` = 'Mailbombed' WHERE (`userid` = %d)", mt_rand(10, 140), $ir['userid'])); } if(!$r['mail_read']) { $db->query(sprintf("UPDATE `mail` SET `mail_read` = 1 WHERE (`mail_id` = %d)", $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `new_mail` = `new_mail` - 1 WHERE (`userid` = %d)", $ir['userid'])); } } function mail_delall() { global $db, $ir; if(!isset($_GET['ans'])) { echo "This will delete all the messages in your inbox.<br />There is <strong>NO</strong> undo, so be sure.<br /><a href='mailbox.php?action=delall&ans=yes'>> Yes, delete all messages</a><br /><a href='mailbox.php'>> No, go back</a>"; } else { $db->query(sprintf("DELETE FROM `mail` WHERE (`mail_to` = %d)", $ir['userid'])); printf("%s message%s ha%s been deleted", $db->affected_rows(), ($db->affected_rows() == 1) ? '' : 's', ($db->affected_rows() == 1) ? 's' : 've'); } } function mail_archive() { echo "This tool will download an archive of all your messages.<br /><a href='dlarchive.php?a=inbox'>> Download Inbox</a><br /><a href='dlarchive.php?a=outbox'>> Download Outbox</a>"; } function mail_massdel() { global $db, $ir, $c, $userid, $h; $counter = 1; $deleted = 0; while($counter < 25) { $dodel = "del" . $counter; if($_POST[$dodel] == "yes") { $delid = "id" . $counter; $db->query(sprintf("DELETE FROM `mail` WHERE ((`mail_to` = %d) AND (`mail_id` = %d))", $ir['userid'], $_POST[$delid])); $deleted++; } $counter++; } printf("%s message%s ha%s been deleted", $deleted, ($deleted == 1) ? '' : 's', ($deleted == 1) ? 's' : 've'); } echo "<br /><br />Mail count mixed up? Click <a href='fix.php?fix=1'>Here</a> to fix"; $h->endpage(); ?>   http://pastebin.com/9jwzQnra Thanks goes to MTG for coding this for me ages. Please do give thanks. Oh and dont forget to edit the code to suit your game.
  6.   ok thats a fair enough point.
  7. yup MTG recoded it for me. never said i made it, just posted up here a working edition. I removed it as i didnt get no thanks or anything for posting it up, it had over 500 views.
  8. I have removed this now, 214 views and not one thank you. so yeah
  9.   Mccodes and Ravan is the Same Script. Just Ravans is stolen code.
  10. hmmm, well i have tried a few login systems out there but i havent found one simple enough and aint good enough to do it myself. Best i could do is strip down mccodes and use that which is a bad idea.....
  11. Yes it does sound like a good idea but it'll take ages to put all the files into the database. But there are a few hundred avi files which seems like alot of hard work when this code grabs all the files needed in the dir I've attached a screeny of my work so far. neither am i any good at creating my own login system to suit my needs.
  12.   No database, The first line $texts = glob($directory ."tv/walkingdead/*/*.flv"); $image = glob($directory ."tv/walkingdead/*/*.jpg"); Selects all Videos and Pictures on the dir of the file manager
  13. wrong board?
  14. Well i tried to put the loops in with eachother then tried to put them together, but i wasnt very good or successfull at doing it. I'm an ok coder but i know what i know and not much other than that, which is why its bad lol. getting there tho. would you be able to put up a demo or somthing with 2 loops in one, i tried to google it but couldnt find what i needed it.
  15. well i have 2 foreach on there which makes this harder i think
  16. Thanks, what a star.
  17. well Here is a Screeny. Basically i want the "Input radio, <-->, Episode Name, the Picture" all on one line. as you can see from the screeny it doesnt line up.
  18. peterisgb

    Help with tables

    Hi i am working on this video script for my local network and i am stuck with the tables, i cant figure out which way round it all goes. i spent all last night untill 5am trying to figuring it out, please help, thanks   <?php include "head.php"; $texts = glob($directory ."tv/walkingdead/*/*.flv"); $image = glob($directory ."tv/walkingdead/*/*.jpg"); echo '<form action="watch.php" method="post"> <table border="0" width="600" cellpadding="0"> <tr><td> '; foreach($texts as $text) { $video="$text"; $file = basename($video, ".flv"); echo '<table border="0" width="300" cellpadding="0"> <tr width="300" height="200"> <td><INPUT type="radio" name="episode" value="'.$video.'"></td> <td><--></td> <td>'.$video.'</td></tr></table> '; } echo '</td><td>'; foreach($image as $imge) { $images="$imge"; $file = basename($images, ".jpg"); echo '<table border="0"> <tr width="300" height="200"> <td><img src="'.$images.'" width="300" height="200"></td> </tr></table>'; } echo '</td> </tr></table> <input type="submit" value="Watch"/></form>'; echo '<br /><br /><br /><br /><a href="index.php">Home </button>'; include "foot.php"; ?>
  19. I like the idea of this. good work. thos i think i would have to agree with Sniko, But as its free i think that if anyone is going to use it they should make it into there own table. Might use this.
  20. Yea the Design is nice, i believe chaotic wars use this exact basis on there game.
  21. i like this mod, but i wouldnt pay for it, sorry but i do like it, nice work.
  22. As said previously that this does work 100% as it is now, just not the user functions right.
  23. yeah for each user. not sure how to do that to be honest.
  24. hm,, well this system kinda works already, but not quite got the right user selection really. my database is like this: users database there is 'lotto1' which is 1 for got ticket and 0 for not. Meanwhile into its own table lotto and lottodraw. lotto is where the userid and lotto numbers go and lottodraw is where the Last numbers picked get entered into. This system does work now, just the user selection that i ain't sure. It seems to draw the lotto and credit me fine when i get correct number and x2 prize for 2 or matching numbers. After coding mccodes for years i still ain't very good at it. I have updated the Main post with the latest update. P.S, Sorry for my grammar and stuff, my English writing was never any good.
  25. well i dont think the cron file, the first part works.
×
×
  • Create New...