Jump to content
MakeWebGames

Danny696

Members
  • Posts

    2,632
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Danny696

  1. Obvs or he wouldnt be selling it. Money sent :)
  2. global $db;
  3. Im gussing for free
  4. a blog is different from a forum. Its hard to explain. Look at the blogs on here and the forums.
  5. oh god. Basic HTML here
  6. wtf was green doing. stupid man
  7. illegalife
  8. Kick off now
  9. I blame rondalo for the fact we didnt win last year. The ref was gonna give rooney a yellow, but ronaldo kept saying give him a red.
  10. England out in the semis on pens (as per usual xD) USA out at group stages ;) only because they call it soccer and thats wrong :P Africa did look strong in their game, until they conceded then their heads went down. France have had a bad start. Uruguay were looking to win until they got the first red of the campain. Game on as we speak. - South Kerea VS Greece Ive series linked the whole campain on Sky+©
  11. Mres is better than addslashes i think because it does escapce other chars
  12. filename.php?cmd=add
  13. Danny696

    Layout

    Ahh, my rubbish template ^^
  14. I also use that template :)
  15. im sure its echo'<big>'. ucwords($blog['name']) .' </big> And yes, that will work just fine :) hmm, doesnt show a ' after the .
  16. Thanks Zed. Forgot to change view to ID :) Done
  17. Ok, Sniko suggested this, its working and tested. Althought i will be adding an editing feature, and a pharser (for videos etc..) This isnt that big'a mod. But works well. Run these on something like PhpMyAdmin: [mysql]CREATE TABLE IF NOT EXISTS `blogs` ( `ID` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(225) NOT NULL DEFAULT '', `blog` TEXT NOT NULL, `posted` INT(11) NOT NULL DEFAULT 1, `time` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY(`ID`) ) ENGINE=MyISAM auto_increment=0; CREATE TABLE IF NOT EXISTS `blog_comments` ( `ID` INT(11) NOT NULL AUTO_INCREMENT, `blogID` INT(11) NOT NULL DEFAULT 0, `time` INT(11) NOT NULL DEFAULT 0, `comment` TEXT NOT NULL, `posted` INT(11) NOT NULL DEFAULT 1, PRIMARY KEY(`ID`) ) ENGINE=MyISAM auto_increment=0;[/mysql] Save as blog.php or something else, doesnt matter ;)   <?php /*/////////////////// Copyright of Danny696 Do not sell this mod Do not re-distribute this mod Do not claim this as your own mod Free for members of MakeWebGames - McCodes, Dev-Forum - MagicTallGuy, Cronwerks - Cronus. Thanks Danny696 This message does nothing to your game. And users cant see it. Respect others. Respect their mods. Respect this message. *//////////////////// @include_once(DIRNAME(__FILE__) .'/globals.php'); $_GET['cmd'] = (isset($_GET['cmd']) && !empty($_GET['cmd']) && is_string($_GET['cmd']) && ctype_alpha($_GET['cmd'])) ? trim(strtolower($_GET['cmd'])) : false; $_GET['view'] = (isset($_GET['view']) && !empty($_GET['view']) && is_int($_GET['view'])) ? @intval($_GET['view']) : false; switch($_GET['cmd']) { case'add': add(); break; case'del': del(); break; case'view': look(); break; case'comment': comment(); break; case'all': all(); break; case'search': search(); break; default: index(); break; } function first($string, $words) { //base of the function from [url]www.nutt.net[/url] $array = explode(' ', $string); if(count($array) < $words) { $return = $string; } else { array_splice($array, $words); $return = implode(' ', $array).' .....'; } return $return; } //Thanks to LordDan for this function. function highlight_words( $string, $words, $color = '#FFFF99' ){ $words = ( is_array( $words ) ) ? $words = implode( '|', $words ) : $words; return preg_replace( '@\b('. $words .')\b@si', '<span style="background-color:'. $color .'">$1</span>', $string ); } function index() { global $db, $h; echo'Here is the last 5 blogs posted. [url="?cmd=all"]View all blogs[/url] <table width="80%" class="table"> <tr> <th width="15%"></th> <th width="70%">&nbsp</th> <th></th> </tr>'; $get_blogs = $db->query("SELECT * FROM `blogs` ORDER BY `ID` LIMIT 15;"); while($blog = $db->fetch_row($get_blogs)) { $user = $db->fetch_row($db->query("SELECT `username`, `userid` FROM `users` WHERE (`userid` = ". $blog['posted'] .");")); echo'<tr> <td>[b]'. ucwords($blog['name']) .'[/b] Posted By: [url="viewuser.php?u='.$user['userid'].'"]'.$user['username'].'[/url] Posted On: [size="1"]'. date('F j, Y; g:i:s a', $blog['time']) .'[/size]</td> <td>'. first($blog['blog'], 25) .'</td> <td>[url="?cmd=view&ID='.$blog['ID'].'"]Read More[/url]</td> </tr>'; } echo'</table>'; headers::endpage(); } function look() { global $db, $ir, $h; if(!$_GET['ID']) { exit(index()); } $blog = $db->fetch_row($db->query("SELECT * FROM `blogs` WHERE (`ID` = ". $_GET['ID'] .");")); if(!$blog) { exit(index()); } $name = $db->fetch_single($db->query("SELECT `username` FROM `users` WHERE (`userid` = ". $blog['posted'] .");")); echo'<big>'. ucwords($blog['name']) .'</big> [url="#comments"]View comments[/url] <table width="80%" class="table"> <tr> <th></th> <th width="70%"></th>'; if($blog['posted'] == $ir['userid'] || $ir['user_level'] == 2) { echo'<th></th>'; } echo' </tr> <tr> <td>'. ucwords($blog['name']) .' Posted By: '.$name.' Posted On: '. date('F j, Y; g:i:s a', $blog['time']) .'</td> <td>'. $blog['blog'] .'</td>'; if($blog['posted'] == $userid || $ir['user_level'] == 2) { echo'<td>[url="?cmd=del&id='.$blog['ID'].'"]Remove[/url]</td>'; } echo' </tr> </table>'; unset($name); $get_comments = $db->query("SELECT * FROM `blog_comments` WHERE (`blogID` = ". $blog['ID'] .");"); echo'<h3><a name="comments">Comments</a></h3> <table width="70%" class="table"> <tr> <th>Poster Info</th> <th>Comment</th> </tr>'; while($comment = $db->fetch_row($comments)) { $name = $db->fetch_single($db->query("SELECT `username` FROM `users` WHERE (`userid` = ". $comment['posted'] .");")); echo'<tr> <td>Posted By: '.$name.' Posted On: '. date('F j, Y; g:i:s a', $comment['time']) .'</td> <td>'. $comment['comment'] .'</td> </tr>'; } echo'</table>'; if(isset($_POST['comment'])) { echo'<h3>Comment Added!</h3>'; $db->query("INSERT INTO `blog_comments` VALUES('', ". $blog['ID'] .", ". time() .", '". $db->escape(strip_tags($_POST['comment'])) ."', ". $_SESSION['userid'] .");"); exit($h->endpage()); } echo'<h3>Add a comment</h3> <form action="" method="post"> <textarea name="comment"></textarea> <input type="submit" value="Add" /> </form>'; } function all() { global $db, $h; echo'Here is a list of all the blogs <table width="80%" class="table"> <tr> <th width="15%"></th> <th width="70%">&nbsp</th> <th></th> </tr>'; $get_blogs = $db->query("SELECT * FROM `blogs` ORDER BY `ID`"); while($blog = $db->fetch_row($get_blogs)) { $name = $db->fetch_single($db->query("SELECT `username` FROM `users` WHERE (`userid` = ". $blog['posted'] .");")); echo'<tr> <td>'. ucwords($blog['name']) .' Posted By: '.$name.' Posted On: '. date('F j, Y; g:i:s a', $blog['time']) .'</td> <td>'. first($blog['blog'], 15) .'</td> <td>[url="?cmd=view&ID='.$blog['ID'].'"]Read More[/url]</td> </tr>'; } echo'</table>'; headers::endpage(); } function del() { global $db, $ir, $h; if(isset($_GET['id'])) { $owner = $db->fetch_single($db->query("SELECT `posted` FROM `blogs` WHERE (`ID` = ". $_GET['id'] .");")); if(($userid != $owner) AND $ir['user_level'] != 2) { echo'You are not the owner of this blog, and therefore cannot delete it.'; exit($h->endpage()); } $db->query("DELETE FROM `blogs` WHERE (`ID` = ". $_GET['id'] .");"); $db->query("DELETE FROM `blog_comments` WHERE (`blogID` = ". $_GET['id'] .");"); echo'Deleted.'; exit($h->endpage()); } echo'Select a blog to delete: <form action="" metod="get"> <select name="id">'; $get_blogs = $db->query("SELECT `name`, `ID` FROM `blogs` WHERE (`posted` = ". $_SESSION['userid'] .");"); while($blog = $db->fetch_row($get_blogs)) { echo'<option value="'.$blog['ID'].'">'.$blog['name'].'</option>'; } echo'</select> </form>'; exit($h->endpage()); } function add() { global $db, $ir, $h; if(isset($_POST['message'])) { $_POST['message'] = strip_tags($_POST['message']); $_POST['message'] = $db->escape($_POST['message']); $_POST['name'] = strip_tags($_POST['message']); $_POST['name'] = $db->escape($_POST['message']); //insert $db->query("INSERT INTO `blogs` VALUES ('', '". $_POST['name'] ."', '". $_POST['message'] ."', '". @intval($ir['userid']) ."', ". time() .");"); $id = $db->insert_id(); echo'Blog added. Click [url="?cmd=view&ID='.$id.'"]Here![/url] to view it.'; exit($h->endpage()); } echo'Adding a new blog. <form action="?cmd=add" method="post"> Name: <input type="text" value="" name="name" /> Blog Text: <textarea name="message"></textarea> <input type="submit" value="Add!" /> </form>'; exit($h->endpage()); } function search() { global $db, $ir, $h; if(!isset($_POST['search'],$_POST['keyword']) || empty($_POST['keyword']) ) { echo'<h3>Searching</h3> <form action="?cmd=search" method="post"> Keyword: <input type="text" value="" name="keyword"> <input type="submit" value="Search" name="search"> </form>'; exit($h->endpage()); } $_POST['keyword'] = strip_tags($db->escape($_POST['keyword'])); $get_searches = $db->query("SELECT * FORM `blogs` WHERE (`blog` LIKE '%%". $_POST['keyword'] ."%%');"); echo'<table width="80%" class="table"> <tr> <th width="15%"></th> <th width="70%">&nbsp</th> <th></th> </tr>'; while($blog = $db->fetch_row($get_searches)) { $name = $db->fetch_single($db->query("SELECT `username` FROM `users` WHERE (`userid` = ". $blog['posted'] .");")); echo'<tr> <td>'. ucwords($blog['name']) .' Posted By: '.$name.' Posted On: '. date('F j, Y; g:i:s a', $blog['time']) .'</td> <td>'. highlight_words(first($blog['blog'], 25), $_POST['keyword']) .'</td> <td>[url="?cmd=view&ID='.$blog['ID'].'"]Read More[/url]</td> </tr>'; } echo'</table>'; exit($h->endpage()); }
  18. In reply to your statement DJK, i will help anyone, just not with the core MCC. Unless they can prove they have a valid licence, and then ill tel them to vist CB/DB or Mcc Support.
  19. Danny696

    Include "...."

    require is the only alternative i think
  20. OR you mail CB/DB stating your valid licence number, and ask them -.-
  21. Ask CB or DB, im sure they could give it you :)
  22. Ahh, my bad
  23. CCleaner does this also and its free and goos freatures
  24. suggestion: Replace $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; with $IP = $SERVER['REMOTE_ADDR'];
  25. change $query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], to $query = sprintf("UPDATE users SET %s=$a+2,%s=%s+2,%s=%s+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'],
×
×
  • Create New...