Jump to content

LegosJedi

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LegosJedi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, so, I'm trying to make a table that's styled like Mac OS X's tables and has the alternating backgrounds. Here's the thing. I currently have the alternating backgrounds set to be a background image, and I've put no rows in the <tbody>, so there's no height. Is there a way I can set the height of the <tbody> in CSS without actually have any rows in it?
  2. Okay, so I have a BBCode parser. Currently, if a user posts something like 'javascript:alert('hacked!')' in the url of a url BBCode, when you click on it, it will execute the javascript. I want to have a way to check to see if javascript is found in the url of the url BBCode, and then take them out. Then, you can also hack it by closing off the url tag with a quote, and adding other attributes, like javascript event handlers. I want to be able to take those out, too.
  3. Yeah, but I want to actually remove the handlers, not the code inside them.
  4. No, I mean the javascript events, not the script tags. I mean things like onmouseover="function()". That stuff.
  5. Hey, I'm working with BBCodes, and I'm trying to figure out how to remove Javascript event handlers from BBCodes who have arguments, as in the url BBCode. I know this can be done with Regular Expressions, but I can't find anything on removing the events. There's alot on just taking away the script tags, but no events.
  6. Ugh, I am such an idiot! I loaded the variables into the template array first, and then run the stripslashes function on the variable that was loaded into the array, not the variable in the array. It'll work now.
  7. See, that's the problem. I do perform the slashes function to remove the slashes, but it acts like I haven't performed the function, and displays it with slashes.
  8. So, I have a form, and when I submit it, if there are errors, what the user submits gets loaded back into the form. Magic Quotes is turned on, and you'd think that by using stripslashes(), I'd get rid of the slashes. It's not working for some reason. I don't know why. Here's the code for the page. <?php if(!defined('FLEXBB')) die('Index.php must be included with this file!<br /><br /><b>Hacking Attempt by '.$_SERVER['REMOTE_ADDR'].'</b>'); if(!$loguser['id']) { // Uh-oh! A guest! Guests can't post submissions! $Replace['template']['header']['1'][] = "{PAGE_NAME}"; $Replace['template']['header']['1'][] = "{USER_LOCATION}"; $Replace['template']['header']['2'][] = "Error!"; $Replace['template']['header']['2'][] = '<img border="0" src="templates/default/images/tree/folder.gif" style="vertical-align:bottom;"> <a href="index.php">{WEBSITE_NAME}</a><br /><img border="0" src="templates/default/images/tree/joinbottom.gif" style="vertical-align:bottom;"><img border="0" src="templates/default/images/tree/file.gif" style="vertical-align:bottom;"> <b>Error!</b>'; $TMPL->show("header","header.template.html"); echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"table\"> <tr> <td width=\"20%\" valign=\"top\">"; $TMPL->show("link", "link.template.html"); echo "</td> <td width=\"80%\" valign=\"top\" style=\"padding-left: 10px;\">"; $Replace['template']['mods']['1'] = array("{HEADER_TEXT}","{MESSAGE_TEXT}"); $Replace['template']['mods']['2'] = array( "Error!", "You are not logged in. You need to be logged in to be able to submit your modification or template. Please <a href=\"http://flexbbmods.hyperphp.com/forums.php?page=login\">login</a>. If you are not a registered member, why not take the time to <a href=\"http://flexbbmods.hyperphp.com/forums.php?page=register\"register</a>? It'll only take a few seconds, and there are so many features that are enabled for memebers, including posting in the forum, submitting mods and templates, and more!" ); $TMPL->show("mods","general-table.template.html"); } else { $Replace['template']['submit']['1'] = array( "{NAME}", "{SHORT_DESCRIPTION}", "{DESCRIPTION}", "{VERSION}", "{LICENSE}", "{ERRORS}" ); $Replace['template']['submit']['2'] = array( "", "", "", "", "", "" ); if(isset($_POST['submit'])) { $name = $_POST['name']; $short = $_POST['short']; $description = $_POST['description']; $version = $_POST['version']; $type = intval($_POST['type']); $fversion = intval($_POST['fversion']); $category = intval($_POST['category']); $license = $_POST['license']; if(!isset($license)) { $license = $set['default_license']; } $license = str_replace('{USERNAME}', $_SESSION['flexbb_username'], $license); $license = str_replace('{DATE}', date('Y'), $license); $errors = array(); if(!isset($name) || !isset($short) || !isset($description) || !isset($version) || !isset($category) || !isset($license)) { $errors[] = "You left one or more fields blank. Please fix this."; $_POST['submit'] = ''; } $versionQuery = $DB->query("SELECT * FROM ".$prefix."versions WHERE vid='".$version."'"); if($DB->num_rows($versionQuery) <= 0) { $errors[] = "That version does not exist! Please select a new one."; $_POST['submit'] = ''; } $categoryQuery = $DB->query("SELECT * FROM ".$prefix."categories WHERE cid='".$category."'"); if($DB->num_rows($categoryQuery) <= 0) { $errors[] = "That category does not exist! Please select a new one."; $_POST['submit'] = ''; } if($_FILES['file']['error'] == "0") { $filename = $_FILES['file']['name']; $postfile = $_FILES['file']['name']; $filesize = round($_FILES['file']['size']/1024, 2); $filetmp = $_FILES['file']['tmp_name']; $filetype = strtolower(substr($filename, strrpos($filename, '.'))); $filetype = str_replace(".","",$filetype); $typeallow = explode(",", 'zip,rar'); // Is it over the allowed size if($filesize > 500 || $filesize == 0) { $errors[] = "The file you uploaded is too big! Please re-upload a smaller file."; $_POST['submit'] = ''; } if(!in_array($filetype, $typeallow)) { $errors[] = "The file you uploaded is not a zip file or a rar file."; $_POST['submit'] = ''; } if(file_exists('uploads/submissions/' . $filename)) { $errors[] = "The file you are trying to upload already exists. Please rename the file and upload it again"; $_POST['submit'] = ''; } } else { $errors[] = "You didn't include a file. Please select one to upload."; $_POST['submit'] = ''; } if(count($errors) > 0) { $Replace['template']['submit']['2'] = array( $name, $short, $description, $version, $license ); } else { $upload = move_uploaded_file($filetmp, 'uploads/submissions/' . $filename); if(!$upload) { $errors[] = "There was a problem with us uploading the file. Please try again."; $_POST['submit'] = ''; } $DB->query("INSERT INTO ".$prefix."submissions VALUES ('', '".$name."', '".$short."', '".$description."', '".$license."', '0', '".time()."', '0', '".$loguser[id]."', '".$version."', '".$fversion."', '".$category."', '".$type."', '0', '".basename($filename)."')"); $Replace['template']['header']['1'][] = "{PAGE_NAME}"; $Replace['template']['header']['1'][] = "{USER_LOCATION}"; $Replace['template']['header']['2'][] = "Thank You!"; $Replace['template']['header']['2'][] = '<img border="0" src="templates/default/images/tree/folder.gif" style="vertical-align:bottom;"> <a href="index.php">{WEBSITE_NAME}</a><br /><img border="0" src="templates/default/images/tree/joinbottom.gif" style="vertical-align:bottom;"><img border="0" src="templates/default/images/tree/file.gif" style="vertical-align:bottom;"> <b>Thank You!</b>'; $TMPL->show("header","header.template.html"); echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"table\"> <tr> <td width=\"20%\" valign=\"top\">"; $TMPL->show("link", "link.template.html"); echo "</td> <td width=\"80%\" valign=\"top\" style=\"padding-left: 10px;\">"; $Replace['template']['mods']['1'] = array("{HEADER_TEXT}","{MESSAGE_TEXT}"); $Replace['template']['mods']['2'] = array( "Thank You!", "Thank you for your submission. It will now be reviewed by one of our staff members, and then should be added to the database. This shouldn't take more that 24 hours." ); $TMPL->show("mods","general-table.template.html"); } } if(!isset($_POST['submit']) || $_POST['submit'] == '') { $name = stripslashes($name); $short = stripslashes($short); $description = stripslashes($description); $version = stripslashes($version); $license = stripslashes($license); $Replace['template']['header']['1'][] = "{PAGE_NAME}"; $Replace['template']['header']['1'][] = "{USER_LOCATION}"; $Replace['template']['header']['2'][] = "Submit"; $Replace['template']['header']['2'][] = '<img border="0" src="templates/default/images/tree/folder.gif" style="vertical-align:bottom;"> <a href="index.php">{WEBSITE_NAME}</a><br /><img border="0" src="templates/default/images/tree/joinbottom.gif" style="vertical-align:bottom;"><img border="0" src="templates/default/images/tree/file.gif" style="vertical-align:bottom;"> <b>Submit</b>'; $TMPL->show("header","header.template.html"); echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"table\"> <tr> <td width=\"20%\" valign=\"top\">"; $TMPL->show("link", "link.template.html"); echo "</td> <td width=\"80%\" valign=\"top\" style=\"padding-left: 10px;\">"; if(count($errors) > 0) { $error = " <br /><ul>"; foreach($errors as $err) { $error .= " <li>{$err}</li>"; } $error .= " </ul>"; $Replace['template']['submit']['2'][7] = $error; } $verQuery = $DB->query("SELECT vid, name FROM ".$prefix."versions ORDER BY name ASC"); while($ver = $DB->fetch_array($verQuery)) { if($ver['vid'] == $fversion) { $selected = " selected=\"selected\""; } $verSelect .= " <option value=\"{$ver['vid']}\"{$selected}>{$ver['name']}</option>\n"; $selected = ""; } $catQuery = $DB->query("SELECT cid, name FROM ".$prefix."categories ORDER BY name ASC"); while($cat = $DB->fetch_array($catQuery)) { if($cat['cid'] == $category) { $selected = " selected=\"selected\""; } $catSelect .= " <option value=\"{$cat['cid']}\"{$selected}>{$cat['name']}</option>\n"; $selected = ""; } $Replace['template']['submit']['1'][] = "{VERSION_SELECT}"; $Replace['template']['submit']['2'][] = $verSelect; $Replace['template']['submit']['1'][] = "{CATEGORY_SELECT}"; $Replace['template']['submit']['2'][] = $catSelect; $TMPL->show('submit', 'submit.template.html'); } } ?>
  9. I've created a Count-up script that starts counting and then stops at a certain number. The only problem is that when it reaches to right about that number, it just starts acting strangly. It doesn't stop, like I tell it to, and then some numbers start missing, and then some numbers are there that shouldn't be. I've run a debugging div to output what should be shown, and everything's fine in there, so It's a problem with the output. Here's my HTML and JavaScript. This problem needs to be fixed real soon, as this needs to be ready for Sunday, and I'm not going to be aroung tomorrow. <html> <head> <title>Commitment Sunday Total</title> <script src="./js.js"></script> </head> <body> <h1 id="count">000000</h1> <input type="button" value="Start!" onclick="increase(); return false;" /> <div id="debug" style="overflow: auto; height: 300px; width: 300px;"></div> </body> </html> var end = '123400'; var speed = 1; // 100 is slowest, 1 is fastest var timer = ""; var hundreds = '0'; var thousands = '0'; var tenthousands = '0'; var hundredthousand = '0'; function increase() { hundreds++; if(hundreds == '10') { hundreds = '0'; thousands++; } if(thousands == '10') { thousands = '0'; tenthousands++; } if(tenthousands == '10') { tenthousands = '0'; hundredthousand++; } current = hundredthousand+tenthousands+thousands+hundreds+'00'; count = document.getElementById('count'); count.innerHTML = current; if(current != end) { if(hundredthousand == end.substr(0, 1)) { document.getElementById('debug').innerHTML = document.getElementById('debug').innerHTML+'<br />'+hundredthousand+tenthousands+thousands+hundreds+'00'; var timer = setTimeout('increase()', 50*speed); } else { var timer = setTimeout('increase()', 10*speed); } } else { clearTimeout(timer); } }
  10. Okay, I'm making a MyBB theme and, for some reason, the background is repeated in every td in IE, though it displays fine in FF. Theme in IE: Theme in FF: Here's my HTML Code for the section: <tr class="tcat"> <td width="35"> </td> <td><strong>Forum</strong></td> <td style="white-space: nowrap;" align="center" width="85"><strong>Threads</strong></td> <td style="white-space: nowrap;" align="center" width="85"><strong>Posts</strong></td> <td align="center" width="200"><strong>Last Post</strong></td> </tr> And here's the CSS Code: .tcat { background: #ffffff url(wii/forum.gif) top left no-repeat; color: #000000; font-size: 12px; height: 29px; } Anyone know how I can make IE display like FF?
  11. Woah. For some reason, it's working again. Strange. Thanks for your help, though!
  12. My Apache Web Server is acting up. It tries to make me download my .php files (I have correctly installed PHP), and it won't open regular HTML pages. And idea as to what might be wrong? Oh, by the way, I'm using Apache 2.2.4 (I think), and PHP 5.2.0 (I think). And It's not a problem with compatability, cause it was working before.
  13. That somewhat worked. Some of the things that need to be displayed are displayed, but they aren't where they are supposed to be. Link
  14. (Sorry for double post) Okay, I tried escaping the brackets, and that didn't work. Then I echoed the variables, and they all contained what they needed to contain. Any other tips?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.