Jump to content

fxuser

Members
  • Posts

    93
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fxuser's Achievements

Member

Member (2/5)

0

Reputation

  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.
×
×
  • 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.