Jump to content

fxuser

Members
  • Posts

    93
  • Joined

  • Last visited

    Never

Everything posted by fxuser

  1. Bump* Im using this for now: $search = array( '/\[code style=(.*?)\](.*?)\[\/code\]/is' ); $replace = array( '<div class="codetext" id="$1">$2</div>' ); return preg_replace($search,$replace,$input); so if style = php and inside the code tags i have <?php echo "test"; ?> it will output <div class="codetext" id="php"><?php echo "test"; ?></div> how can i check what $1 is in order to highlight the $2 properly ? thanks, please reply for any other questions.
  2. So i have a custom tag like: [ code style=php ] [ /style] The user has plenty options such as c,c++,js and more, so if the user has posted some code in php and after some code in c++ i want to search the [ code] [ /code] tags to see if the style exists , and then call the highlight function .. i suppose this can be done via regex or something similar? Thanks.
  3. I would try something like this: $var = preg_replace('/[A-Za-z0-9']*/', '', "$var");
  4. something like , include a file which will refresh the timestamp while he will be visiting pages in the website so we will get the users last time visit of the website. So when a user goes to the x users profile we will compare the timestamp of x's with the guest or the user i have and delete the online status row if the x's users timestamp is < than mine? thanks.
  5. So i have a online status available and when the user logs in i insert a new row in a table so the user is online and when the user logs out i delete it so the users goes offline.. but when the user leaves the computer and has the website open he will get logged out after some time of inactivity and the row saying that the user is online will remain there and wont be deleted.. how can i remove the row by the time the session is removed due to inactivity? I dont have any code done till now because im still trying to find out how to do it.. thanks.
  6. So i am on a shared host and it seems that only 777 allows me to upload images on a certain folder , not 755 , just 777... is it because of the shared host or thats how it works? PS: i really didnt know where to post it so if a mod can move it , i'd appreciate it.
  7. bump! it my request in last post needs to go to javascript section , please move it.
  8. i want to strip whitespaces and new lines when there is letter inside the textarea.. yeap it works but how can i make it work in javascript? this is what i got var string; function IsNumeric(input){ var RE = /^-{0,1}\d*\.{0,1}\d+$/; return (RE.test(input)); } function _empty(string){ string = $.trim(string); if(!IsNumeric(string)){ return string.length = -1; } return FALSE; } else if (_empty(msg)){ $('#error').show(); $('#error').html("Error."); } it seems to work but on the second click it doesnt recognise the value and i have to refresh.. thanks
  9. thats exactly what im trying to do. if i explode the string using space " " then the user can enter spaces between words in a single line so i dont get how this would work properly in my problem , also the user can enter twice or more times lines , what i want is to prevent the user from entering spaces only or lines only without a single letter.
  10. What im trying to achieve is not to let the users enter spaces or new lines and send them to database via ajax.. so how can echo a message that the user must enter something when he enters just line breaks or spaces in a textarea? i tried checking if the textarea value is null , = "" or = " " but thats just not what i need... thanks
  11. maybe its the type on the third line of the code? the sutff should be stuff RewriteRule ^stuff/#!/([0-9]+) http://maadif.co.cc/stuff/?id=$1 [R,NC]
  12. A way to do this is by adding 2 columns in the messages table in the database like: sender_read reciever_read and then check when i see the messages content if i am the reciever or the sender and alter the right read column to 1 so it is read and then echo a message so the user will know if he have read the message or not. hope it helps.
  13. well i use ajax to get the file that has the above code plus the html code for the button and file , the gif works on IE but jpg,png wont show me that the image has been uploaded EDIT : ah i knew it was something that had to do with the file type , so jpgs may also be pjpeg and pngs may also be x-png .. gotta check for all the posibilities. fixed!
  14. if ($btn){ if((!empty($filename)) && ($error == 0)) { if (($filetype == "image/jpeg" || $filetype == "image/jpg" || $filetype == "image/gif" || $filetype == "image/png") && ($filesize < 4508876)) { $moving_flag = true; $moving_msg = "Your image has been uploaded!"; } else { $upl_error_msg = "Error: Only jpg/gif/png images under 4Mb are accepted for upload"; $upl_error_flag = true; } } else { $upl_error_msg = "Error: No file uploaded"; $upl_error_flag = true; } } Why the above code wont work on IE and wont show me "Your image has been uploaded!" message when i have a valid type and size? it works on chrome and FF
  15. dont click on it from your email , just copy and paste the link on the url of the browser and hit enter.
  16. for example lets say i have a "how are you today" feature with an inputbox and a button then i have a file that does php stuff to show what i have typed in a div(i use some html code to show the message , time , name and stuff, right?) and include it in my div which shows my top10 stories. when i click the button i use ajax to insert it into the database. inside the ajax file that i call after the insert Query i would copy the html code i use for the structure of the post and insert it after the query in order to show the one i posted after or before the div via this code: after success: function(data){ //show my new post after the div or before? $("#mydiv").before(data); //shows what i just typed on the top of the div $("#mydiv").after(data); //shows what i just typed on the bottom of the div } thats how i do it for such a feature.. maybe there is someone better at this than me which can explain it better. Good luck
  17. on savelevel1.php after you insert a new row in the database , echo the result and on the ajax , add the sucess function and inside it add ("#mydiv").after or .before if you want the result to appear after the div you show the notes or before and then add (result) which is the success function(result)
  18. try http://developers.facebook.com/docs/guides/web#plugins
  19. do the ajax request , echo the the new note when you insert it into the database via the url of the ajax request and then add $("#div").after(data) or $("#div").before(data) on ajax sucess?
  20. fxuser

    Some help

    i had a function that checks for my inputs and it seems it was strip_tags() i have tried a similar way before your response but i also tried what you posted and it seems the strip_tags() was the problem.
  21. fxuser

    Some help

    as i stated in my first post i wanna remove these symbols from the input box when a user types them in due to the LIKE sql query i use but it seems doesnt seem to work for the "<" and "\" .. they dont get replaced when i type them.. weird
  22. fxuser

    Some help

    i have tried it but i get the same problem the "<" doesnt get replaced with " " and i cant put inside the array the "\".
×
×
  • 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.