Jump to content

robert.access

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Everything posted by robert.access

  1. hello everyone, I have the following script that replace the "bad" words from input text, but it's not working in both textarea and only in one of them. What can be the problem? Thank you very much! <html> <head> <script type="text/javascript"> var bannedWords = ["good","hunt","luck","mother humper","lock ducker", "whore","witch","thit","xss","xsshole","faggot", "tigger","kiss","ahole","hole"]; function validate(nForm){ var nMessage = nForm["message", "message2"]; nMessage.value = nMessage.value.replace(/\<\/?.[^\>]*\>/g, "").replace(/[^a-z.?\s\d]/gi, " "); for (i=0; i<bannedWords.length; i++) { var nBanned = new RegExp("[^a-z\s]+"+bannedWords[i]+"[^a-z.?]*","gi"); nMessage.value = nMessage.value.replace(nBanned, " *** "); } nMessage.value = nMessage.value.replace(/\s{2,}/g, " *** "); nMessage.value = nMessage.value.replace(/([a-z]+)\s([.?])/g, "$1$2"); alert('Thank you'); return true; } function init(){ var nForm = document.forms[0]; nForm.onsubmit = function() { return validate(this); } } navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> </head> <body> <form action="" method="post"> <textarea name="message"></textarea> <textarea name="message2"></textarea> <input type="submit" name="submit" value="Submit"> </form> </body> </html>
  2. Hi, please help me! I have the following js script that expand a search box with the names from a database, and I want to limit to let's say 20 chars. For example if I search for "audi" it display in a div "audi a6 model year 2006, fuel petrol" I want to display only "audi a6 model ye..." Would that be possible? Thank you in advance for any help!
  3. Hi! Does anyone know how to disable auto link posting in innovaeditor ?? For example when I enter www.something it will make it a link, How can I disable this, to be able only to modify text size color etc, but not html entering. Thank you in advance, really appreciate any help.
  4. i think that I have to modify something here to block auto insert of link any advice please!!!
  5. my code resize in editor.js it's something like function convertBorderWidth(width){ return eval(width.substr(0,width.length-2)); }
  6. hi all, I really apreciate if anyone can tell me what function I have to look for in a js file, (to delete it) to remove the automaticaly posted link in a text box. for example when I enter www.something.com and I press space bar the textarea will make it like <a href="http://www.something.com ">www.something.com </a> ... this is in java , so please any ideeas what to looking for???? and please don't give me "answers" learn java,,, I try and found nothing, please give me your ideea for what to looking for, to remove... thank you very much! really apreciate (p.s. dont have money to hire a freelancer, that's why I;m here) thx!!!!
  7. can't get it to work... any help? if I knew to do that i wont ask here (( please.
  8. thank you! i'll try to find it out
  9. hi! please help me with "printing" date in sent email copyright. Like copy 2004 - "current year" Thank you! the code that site use to send email registration it's:
  10. the bar it's appear from top and it's not fixed on top, I mean it's sliding down in a second. It's not fixed (what I want). and I just want an opinion or a simple code, mabe an ideea to change if(verticalpos=="fromtop") I dont think that it's so hard, but I really dont know java... MrAdam, thanks for the freelance suggestion...
  11. Hi all! I have the following script: var persistclose=1 var startX=3 var startY=0 var verticalpos="fromtop" function iecompattest() {return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body} function get_cookie(Name) {var search=Name+"=" var returnvalue="";if(document.cookie.length>0) {offset=document.cookie.indexOf(search) if(offset!=-1) {offset+=search.length end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}} return returnvalue;} function closebar() {if(persistclose) document.cookie="remainclosed=1" document.getElementById("topbar").style.visibility="hidden"} function staticbar() {barheight=document.getElementById("topbar").offsetHeight var ns=(navigator.appName.indexOf("Netscape")!=-1)||window.opera;var d=document;function ml(id) {var el=d.getElementById(id);if(!persistclose||persistclose&&get_cookie("remainclosed")=="") el.style.visibility="visible" if(d.layers)el.style=el;el.sP=function(x,y){this.style.right=x+"px";this.style.top=y+"px";};el.x=startX;if(verticalpos=="fromtop") el.y=startY;else {el.y=ns?pageYOffset+innerHeight:iecompattest().scrollTop+iecompattest().clientHeight;el.y-=startY;} return el;} window.stayTopLeft=function() {if(verticalpos=="fromtop") {var pY=ns?pageYOffset:iecompattest().scrollTop;ftlObj.y+=(pY+startY-ftlObj.y)/8;} else {var pY=ns?pageYOffset+innerHeight-barheight:iecompattest().scrollTop+iecompattest().clientHeight-barheight;ftlObj.y+=(pY-startY-ftlObj.y)/8;} ftlObj.sP(ftlObj.x,ftlObj.y);setTimeout("stayTopLeft()",10);} ftlObj=ml("topbar");stayTopLeft();} if(window.addEventListener) window.addEventListener("load",staticbar,false) else if(window.attachEvent) window.attachEvent("onload",staticbar) else if(document.getElementById) window.onload=staticbar This script make a popup and I have modified css to look like an information bar that resize on top. The problem is that the bar it's comming from top in a sec and when i move the page down and after I move fast up the bar is "coming" to top. I want to be fixed on top like internet infobar and to stay on top of othe items and in top of the webpage when I move page up and down. Thanks alot in advance for any help and suggestions!
  12. thanks for readind . looks like z-index:2; fix the problem with showing on top, but same problem with 3px bug in ie ( any advice?
  13. Hi to all! I have a problem with the following code: #topbar{ TOP: 0px; PADDING-BOTTOM: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; VISIBILITY: hidden; BORDER-TOP: black 0px; BORDER-BOTTOM: black 1px solid; BORDER-RIGHT: black 0px; BORDER-LEFT: black 0px; WIDTH: 100%; FONT-FAMILY: Tahoma; FONT-SIZE: 9px; POSITION: absolute !important; BACKGROUND-COLOR: #FEFEDE; } my toolbar (like the googletranslate, or "you need to install the following...") that appear on top of the website and stay there when you move the page, have a 2 - 3 pixels empty space (it's positioned lower with 3px) and it's not on top of all items in site like images, swf, etc. Can anyone can give me an ideea how to fix it, please? Thank you!
  14. the first function it's for upload images without page refresh. If I upload image and click next it's open in new window, but if i hit refresh before next button, it's working normally :confused:
  15. I don't know what to show more??? My buttons (prev and next ) it's called from <?=nav_btns_position();?> But I see that this java it's the problem. Please tell me more what should i send to you< I really need to fix this up. Thank you both. Really apreciate your answers
  16. hi all, please help me with this code really need it. i have the following java code on my page and when I ude doctype HTML and click next the page go in same windows. when I use XHTML doctype, the next page it's open in new window. How to fix it to open in same windows? Please help!!! <script src="lib/JsHttpRequest/JsHttpRequest.js"></script> <script type="text/javascript" language="JavaScript"> function doLoad(value,div,id,type,order, hidden) { document.getElementById(div).innerHTML = '<img src="images/indicator.gif" border="0">'; // Create new JsHttpRequest object. var req = new JsHttpRequest(); // Code automatically called on load finishing. req.onreadystatechange = function() { if (req.readyState == 4) { // Write result to page element (_RESULT becomes responseJS). // document.getElementById('result').innerHTML = '<b>MD5("'+req.responseJS.q+'")</b> = ' + '"' + req.responseJS.md5 + '"<br> '; // Write debug information too (output becomes responseText). update = req.responseText.split('||'); document.getElementById(div).innerHTML = update[0]; document.getElementById(hidden).value = update[1]; } } // Prepare request object (automatically choose GET or POST). req.open(null, 'upl_backend.php?id='+id+'&type='+type+'&order='+order, true); // Send data to backend. req.send( { q: value } ); } function doDelete(value,div,id,type,order,hidden) { document.getElementById(div).innerHTML = '<img src="images/indicator.gif" border="0">'; // Create new JsHttpRequest object. var req = new JsHttpRequest(); // Code automatically called on load finishing. req.onreadystatechange = function() { if (req.readyState == 4) { // Write result to page element (_RESULT becomes responseJS). // document.getElementById('result').innerHTML = '<b>MD5("'+req.responseJS.q+'")</b> = ' + '"' + req.responseJS.md5 + '"<br> '; // Write debug information too (output becomes responseText). update = req.responseText.split('||'); document.getElementById(div).innerHTML = update[0]; document.getElementById(hidden).value = ''; } } // Prepare request object (automatically choose GET or POST). req.open(null, 'upl_backend.php?id='+id+'&type='+type+'&order='+order+'&delete=yes', true); // Send data to backend. req.send( { q: value } ); } </script>
  17. I am altering , mabe it's easy to have images ajax upload without refresh the page. What do you think it's easyer???
  18. well thanks for the big help but really don't know from where to start. the code is: </tr> <tr> <td colspan="3" class="mylabelstyle"><?=MSG_ITEM_TITLE;?> <input name="name" type="text" id="name" value="<?=$item_details['name'];?>" size="60" maxlength="80" class="myinputstyle" /></td> </tr> <tr > <td colspan="3"><script language="JavaScript" type="text/javascript" src='scripts/innovaeditor.php'></script><textarea id="description_main" name="description_main" style="width: 400px; height: 200px; overflow: hidden;" ><?=$item_details['description'];?></textarea> <?=$item_description_editor;?> </td> </tr> <? echo ($setts['max_images'] > 0) ? $image_upload_manager : ''; ?> the item title it's saved on page refresh. do you need other code too??? thanks!
  19. please help me with this. On a page I have a form for user to insert a text and then another to upload image, but when images are uploaded the page it's automatcly refreshed and the text in <textarea> dissapearand and need to be entered again. How to fix this? If I move the images upload above the <textarea> for users first to upload and then enter the text it's ugly for design. Please help Thank you!
  20. Hi all! I use the code above to allow users to upload images, so when I use in top of page: DOCTYPE html PUBLIC "-//W3C//DTD XHTML , and click next page (from <form><imput..>...) it's open in new page (after I upload images). If I use firefox it's working normaly. But not in IE or Opera. If i use DOCTYPE html PUBLIC "-//W3C//DTD HTML , it's work's normal - it's open in same page in IE, Opera and firefox, but it's mess up my page layout. Please help me. the file JsHttpRequest.js it's here http://ajaxian.com/archives/jshttprequest-low-level-ajax-library Thank you in advance!
  21. ) well first thank you for trying to help. I have my site made and it's working fine but i use css. So background images are called from css. now I make a big image with all images inside, and to call a specific image from the big one (sprite) with for example: " background position: -30px -20px;", but this image it's already called in my "old" css and I need to combine Old css with new "position: -30px ...." I don't know if I made myself clear, but I can try to explain again
  22. hi all! i have the following problem. I have made my site a while ago and now I realise that using sprites image it's better, so I have the folling code in my css: #pagtop_info{background:url(www2/img/pagetop.gif) no-repeat;width:987px;height:100px;position:relative} the image it's in a div. now my sprite image it's <style type="text/css"> div { background: url('result.png'); } </style> and the same imge as above it's called from <div style="background-position: -0px -0px; width: 200px; height: 54px"> </div> how to combine this to keep the same structure and have the image from sprite image???? Please help! Thank you in advance!
  23. Hi all! so, all it's working fine but I want to upload images in a subdomain like www2.domain.com So here : $uploadfileF = 'www2/images/img_' if I put: $uploadfileF ='http://www2.domain.com/images/img_' i got an error. I am only able to use relative path. Ok if I use www2/images it's loading images fine in directory that I specified but my link for images (on other pages) will be http://www2.domain.com/www2/images/ How can I get off the www2 to be http://www2.domain.com/images/ this is in function uploadfileF Please help! Really apreciate. Thanks <?php session_start(); set_time_limit(0); //This function required to allow users upload pictures with spaces function sanitize_var($value) { if (!is_numeric($value)) { $value = ereg_replace("[^A-Za-z0-9_ ]", "", $value); $value = eregi_replace('amp','and',$value); $value = eregi_replace('quot','',$value); $value = eregi_replace('039','',$value); $value = eregi_replace(' ','-',$value); } return $value; } include('files/config.php'); require_once "lib/JsHttpRequest/JsHttpRequest.php"; $JsHttpRequest =& new JsHttpRequest("windows-1251"); if($_REQUEST["delete"]!='yes'){ $db = new database; $db->connect($db_host, $db_username, $db_password); $db->select_db($db_name); $_RESULT = array( "q" => 'file ' . $_FILES['q']['name'], "md5" => md5(@file_get_contents($_FILES['q']['tmp_name'])), ); $ftmp = $_FILES['q']['tmp_name']; $fname = $_FILES['q']['name']; $fsize = $_FILES['q']['size']; $ftype = $_FILES['q']['type']; $allowedExtensions[] = "jpg"; $allowedExtensions[] = "gif"; $allowedExtensions[] = "png"; $allowedExtensions[] = "jpeg"; $allowedExtensions[] = "avi"; $allowedExtensions[] = "mpeg"; $allowedExtensions[] = "mpg"; $allowedExtensions[] = "mov"; $path_info = pathinfo($fname); if (!in_array(strtolower($path_info['extension']), $allowedExtensions)) { print "<strong>File not allowed to upload</strong>"; die(); } $uploadfileF = 'www2/images/img_'.$_REQUEST['id'] .sanitize_var($fname).'.'.$path_info['extension']; //filename if (move_uploaded_file($ftmp, $uploadfileF)) { mysql_query("DELETE FROM " . DB_PREFIX . "auction_media WHERE auction_id='".$_REQUEST['id']."' AND `order`='".$_REQUEST['order']."' AND media_type='".$_REQUEST['type']."'"); mysql_query("INSERT INTO " . DB_PREFIX . "auction_media (media_url, media_type, auction_id, `order`) values ('".$uploadfileF."','".$_REQUEST['type']."','".$_REQUEST['id']."','".$_REQUEST['order']."')"); } if ($_REQUEST['type']==1){ $image_resize = mysql_fetch_array(mysql_query("SELECT images_max_size, watermark_size FROM " . DB_PREFIX . "gen_setts WHERE 1")); $image_info = getimagesize($uploadfileF); if(($image_resize["images_max_size"]*1024)<$fsize) { print "<strong>File Too Big</strong>"; unlink($uploadfileF); mysql_query("DELETE FROM " . DB_PREFIX . "auction_media WHERE auction_id='".$_REQUEST['id']."' AND `order`='".$_REQUEST['order']."' AND media_type='".$_REQUEST['type']."'"); die(); } if ($image_resize["watermark_size"]<$image_info[0]){ $image = new SimpleImage(); $image->load($uploadfileF); $image->resizeToWidth($image_resize["watermark_size"]); $image->save($uploadfileF); } print "<img src='thumbnail.php?pic=".$uploadfileF."&w=104&sq=Y&b=Y' border='0'>||".$uploadfileF; } else { print "<img src='thumbnail.php?pic=images/media_icon.gif&w=104&sq=Y&b=Y' border='0'>||".$uploadfileF; } } else { $db = new database; $db->connect($db_host, $db_username, $db_password); $db->select_db($db_name); $picture_unlink=mysql_fetch_array(mysql_query("SELECT media_url FROM " . DB_PREFIX . "auction_media WHERE auction_id='".$_REQUEST['id']."' AND `order`='".$_REQUEST['order']."' AND media_type=".$_REQUEST['type'])); if (isset($picture_unlink["media_url"])){ mysql_query("DELETE FROM " . DB_PREFIX . "auction_media WHERE auction_id='".$_REQUEST['id']."' AND `order`='".$_REQUEST['order']."' AND media_type=".$_REQUEST['type']); //unlink($picture_unlink["media_url"]); } print "<img src='images/bg_no_image.gif' height='104px'>"; } ?>
  24. hi! i want to gzip my javascript files (i have minimised'it) but don't know how to do it. can anyone help me with an example? Thanks!
×
×
  • 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.