-
Posts
2,124 -
Joined
-
Last visited
-
Days Won
144
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Hi there! If you're reading this, then .. well .. you clicked the topic name HUURRRHURRRHURRRHURRR I'm Magictallguy, 27 (at the time of writing), and living in greytown in greycity where everything's grey (Bolton). Annnnd I've got no idea what else to put here. Ask away, I'll update this with answers
-
Pretty self-explanatory title. Can we get a dark theme please?
-
My Skype lot now know MWG's back. Regaining the community shouldn't take long. Word spreads quickly ^.^
-
Oh, it's daaaayum good to be back!
-
The code is outdated and outmoded. You need to update the code yourself or find/hire someone who will do that for you. Your DB errors are due to the fact that the dbdata.sql is coded incorrectly - attempting to set default values on blob/text columns (can't do it). At least switch to MySQLi, if you're not willing/able to do anything else - you can do this is config.php, simply change "mysql" to "mysqli"
-
Sounds interesting, I may follow this
-
IPLISTNER.php ssl3.0 FIX and server fix
Magictallguy replied to jay-dogg2009's topic in Modification Support
Forgive the gravedig - spotted this on MCCodes.com and laughed.. iplistener.php is a file I include with my free PayPal IPN integration.. The IPN itself can be found here Only those using that particular IPN class (or equivalent) would need to update their SSL setting -
Added sending event (unless commenting on own profile) to profile owner
- 8 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Moved a few things around, tested and working
- 8 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Tested and working :)
- 8 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Profile Comments
-
Profile Comments! TESTED - Please respond with any bugs Run SQL: CREATE TABLE users_comments ( id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, profile_id INT(11) NOT NULL DEFAULT 0, poster_id INT(11) NOT NULL DEFAULT 0, flagged TINYINT(4) NOT NULL DEFAULT 0, content TEXT NOT NULL, time_added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, INDEX(profile_id) ) THIS STEP IS OPTIONAL - YOU ONLY NEED TO DO THIS IF YOU INTEND TO USE JBBCODE Find: require_once('globals.php'); Add below: require_once __DIR__ . '/path/to/JBBCode/Parser.php'; Find (default: above "Profile for x user"): $db->free_result($ref_q); Add below <?php // added for syntax highlighting. Remove this line before pasting $delSuccess = false; $flagSuccess = false; $commentPosted = false; $_GET['flagcom'] = array_key_exists('flagcom', $_GET) && ctype_digit($_GET['flagcom']) && $_GET['flagcom'] > 0 ? $_GET['flagcom'] : null; $_GET['delcom'] = array_key_exists('delcom', $_GET) && ctype_digit($_GET['delcom']) && $_GET['delcom'] > 0 ? $_GET['delcom'] : null; if (!empty($_GET['flagcom'])) { $selectComment = $db->query('SELECT id, profile_id, poster_id, flagged FROM users_comments WHERE id = '.$_GET['flagcom']); if ($db->num_rows($selectComment)) { $com = $db->fetch_row($selectComment); if (!$com['flagged']) { $db->query('UPDATE users_comments SET flagged = 1 WHERE id = '.$_GET['flagcom']); $flagSuccess = true; } else { echo 'This comment has already been flagged'; } $db->free_result($com); } else { echo 'The comment you selected doesn\'t exist'; } } elseif (!empty($_GET['delcom'])) { $selectComment = $db->query('SELECT id, profile_id, poster_id FROM users_comments WHERE id = '.$_GET['delcom']); if ($db->num_rows($selectComment)) { $com = $db->fetch_row($selectComment); if (in_array($ir['userid'], [$com['profile_id'], $com['poster_id']]) && !$ir['staff_rank']) { $db->query('DELETE FROM users_comments WHERE id = '.$_GET['delcom']); $delSuccess = true; } else { echo 'You don\'t have access'; } $db->free_result($com); } else { echo 'The comment you selected doesn\'t exist'; } } if (array_key_exists('comment', $_POST)) { $_POST['comment'] = is_string($_POST['comment']) && strlen($_POST['comment']) > 0 ? strip_tags(trim($_POST['comment'])) : null; if (!empty($_POST['comment'])) { $selectDupCom = $db->query('SELECT COUNT(id) FROM users_comments WHERE profile_id = '.$r['userid'].' AND poster_id = '.$ir['userid'].' AND content = "'.$db->escape($_POST['comment']).'"'); if (!$db->fetch_single($selectDupCom)) { $db->query(sprintf('INSERT INTO users_comments (profile_id, poster_id, content) VALUES (%u, %u, "%s")', $r['userid'], $ir['userid'], $db->escape($_POST['comment']))); if ($ir['userid'] != $r['userid']) { $myname = function_exists('username') ? username($ir['userid']) : '<a href="viewuser.php?u='.$ir['userid'].'">'.stripslashes($ir['username']).'</a>'; event_add($r['userid'], $myname.' left a comment on your profile'); } $commentPosted = true; } $db->free_result($selectDupCom); } } Find (default: just above function checkblank() { [...] }): echo ' </tr> </table> '; Replace with: <?php // added for syntax highlighting. Remove this line before pasting echo '</tr>'; $successExists = function_exists('success'); $selectComments = $db->query('SELECT id, poster_id, flagged, content, time_added, username FROM users_comments INNER JOIN users ON poster_id = userid WHERE profile_id = '.$r['userid'].' ORDER BY time_added DESC LIMIT 10' );?> <tr> <td colspan="2" valign="top"> <?php echo $commentPosted ? ($successExists ? success('Your comment has been posted!') : 'Your comment has been posted!<br />') : ''; echo $delSuccess ? ($successExists ? success('You\'ve deleted the comment') : 'You\'ve deleted the comment<br />') : ''; echo $flagSuccess ? ($successExists ? success('You\'ve flagged the comment') : 'You\'ve flagged the comment<br />') : ''; ?> <form action="viewuser.php?u=<?php echo $r['userid'];?>" method="post"> <div class="form-group"> <label for="comment">Comment</label> <textarea name="comment" id="comment" rows="5%" cols="40%" class="form-control"></textarea> </div> <button type="submit" class="btn btn-primary"> <i class="fas fa-thumbs-up" aria-hidden="true"></i> Post Comment </button> </form> <table class="table table-dark table-hover" width="100%"> <thead> <tr> <th scope="col" style="width:25%;">Poster</th> <th scope="col" style="width:75%;">Comment</th> </tr> </thead> <tfoot> <tr> <th>Poster</th> <th>Comment</th> </tr> </tfoot> <tbody> <?php if(!$db->num_rows($selectComments)) { ?> <tr> <td colspan="2" class="center">There are no comments on this profile</td> </tr><?php } else { $usernameExists = function_exists('username'); while($row = $db->fetch_row($selectComments)) { $comment = trim(nl2br(stripslashes(htmlentities($row['content'], ENT_QUOTES, 'UTF-8')))); if(class_exists('JBBCode\Parser')) { $parser = new JBBCode\Parser(); $parser->addCodeDefinitionSet(new JBBCode\DefaultCodeDefinitionSet()); $comment = $parser->getAsHTML($parser->parse($comment)); } ?> <tr<?php echo $row['flagged'] ? ' style="-webkit-filter: grayscale(1);filter: grayscale(1);"' : '';?>> <td> <?php echo $usernameExists ? username($row['poster_id']) : '<a href="viewuser.php?u='.$row['profile_id'].'">'.stripslashes(htmlspecialchars($row['username'])).'</a>';?> </td> <td> <?php echo $comment;?><br /> <span style="font-size:.8em;font-style:italic;float:right;"><?php if(in_array($ir['userid'], [$row['poster_id'], $r['userid']]) || $ir['user_level'] == 2) { ?> [<a href="viewuser.php?u=<?php echo $r['userid'];?>&delcom=<?php echo $row['id'];?>">Delete</a>]<?php } else if(!in_array($ir['userid'], [$row['poster_id'], $r['userid']])) { ?> [<a href="viewuser.php?u=<?php echo $r['userid'];?>&flagcom=<?php echo $row['id'];?>">Flag</a>]<?php } ?> </span> </td> </tr><?php } } ?> </tbody> </table> </td> </tr> <?php $db->free_result($selectComments);
-
I'm afraid I haven't released them to the public yet - mostly because they're for custom builds. I'll write up a stock MC Codes version for you
-
if(my['userid'] == returned['userid']) { show name } else { show 'unknown'; }
-
Nah, just about clinging to life xD
-
I've built a "Court" system for those in Federal Jail, so that could be what you're looking for. The incentive system, as we currently know it, relies on the voting site itself to send something back to the originating site (a game, for example). Unless you mean to add a staff interface so you can add/edit/delete voting sites directly from within the Staff Panel (if so, wrote that too). Profile comments are yet another thing I've written up a few times (not trying to brag..) and are pretty simple (mine even comes with BBCode!) -- What are your thoughts, Adam?
-
Want any collab code [uSER=67703]adamhull[/uSER]? If so, give me a shout :) Feel free to decline, no offense will be taken :P
-
You know, funnily enough, I do! I wouldn't have created this topic otherwise.. I've spent years on this site, learning from it and adding to it (not necessarily all good content, but added content all the same). Criminal Existence (now MWG) is effectively my root to how and where I started coding. Unlike some on this site (mentioning no names, and no this isn't aimed at you), I actually want to help new developers. We live in an age where it's a good skill to have.
-
Wait.. So who actually owns MWG now? Who are the staff?
-
Without trying to offend, but with trying to kick people up the arse and into gear.. Will the administration please get on top of and handle the friggin' spam?! Sick and tired of seeing it. Spammers are posting more content than the users - go figure Also, the session handling ain't doing so well - not even 2 minutes being logged in and I'm logged out again? This is with activity during typing posts (to ensure the session doesn't time out..) Addendum: If this topic gets closed/locked before the spam is handled, says a lot..
-
You'll need a little JavaScript for this. <script type="text/javascript"> function insertBBCode(val, ele) { document.getElementByName(ele).innerHTML += val; } </script> Then, for your BBCode click entry.. <a href="javascript:insertBBCode('[img][/img]', 'message');" onclick="void(0)">Insert image</a> The secondary argument "message" may need updating to match your system - whatever the textarea on mail_compose() is called..
-
For your setup.. <?php require_once __DIR__ . '/lib/allpage.php'; $tables = [ 'attacklogs', 'attacklogs', 'blacklist', 'blacklist', 'cashxferlogs', 'cashxferlogs', 'challengesbeaten', 'coursesdone', 'crystalmarket', 'dps_process', 'events', 'fedjail', 'fedjail', 'fight_challenges', 'fight_challenges', 'forum_forums', 'forum_forums', 'forum_posts', 'forum_posts', 'forum_topics', 'forum_topics', 'friendslist', 'friendslist', 'gymlogs', 'hitlist', 'imarketaddlogs', 'imbuylogs', 'imbuylogs', 'imremovelogs', 'imremovelogs', 'inventory', 'itembuylogs', 'itemmarket', 'itemselllogs', 'itemxferlogs', 'itemxferlogs', 'jaillogs', 'jaillogs', 'logs_staff', 'mail', 'mail', 'mugger_oth', 'mugger_oth_global', 'preports', 'preports', 'referals', 'referals', 'reports_bugs', 'reports_bugs_responses', 'review', 'rr_challenges', 'rr_challenges', 'rr_logs', 'rr_logs', 'rr_logs', 'scoment', 'staffnotelogs', 'staffnotelogs', 'status', 'syndicates', 'syndicates', 'syndicate_apps', 'syndicate_coment', 'unjaillogs', 'unjaillogs', 'users', 'userstats', 'user_imageusername', 'warnings', 'warnings', 'willplogs' ]; $db->startTrans(); foreach($tables as $table) { $db->query('TRUNCATE TABLE '.$query); $db->execute(); } $db->endTrans(); session_unset(); session_destroy(); echo 'Game reset';
-
Adding this for notification to other developers this and this
-
Use my stuff as you wish - all published under the DBAD license
-
Based on the limited information given, I have responded the best I can.