Monkuar
Members-
Posts
987 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Monkuar
-
Hello, I need a php function or some type of little parser that will find if a user submit's a ' then it converts it into " before I grab it and submit it into my database? How would I go about getting some code to convert all the input ' to " ? Thank you,
-
why is it calling my database name and the table?
Monkuar replied to Monkuar's topic in PHP Coding Help
Wow.. LOL I guess that fixed it, the table was all lowercase, but I had it the I uppercase, This instantly fixed the my problem, I am very happy. Kudo's sir.. stupid debian 32bit compared to my windows os lol (on localhosT) -
mysql_query("SELECT $field FROM iNettuts WHERE user_id='1'") or die (mysql_error()); And I have a table named iNettuts.... in my database, my db is called "forum" But I get the error... Table 'forum.iNettuts' doesn't exist Makes no sense? This works on localhost, but when I transfer to a life server on my VPS, it seems to bring this error. any idea? ty
-
They're not rows, there data inside 1 Field? Sorry for the misunderstanding
-
Thanks for your response, now it just shows nothing? I think this will be easier If I took screenshot's instead. This is the value stored in my "text" field. When I use your query it just show no data, but no error also? hmmm
-
I tried everything, the | before and after, I don't think the "AND" etc is working when I already selected my initial user_id = 5?? could I use another "AND" replacement that might get it to work?
-
Hi everyone! I am stuck! SELECT config FROM inettuts WHERE user_id='5' This config pulls out this data: PostInfo,color-grey,User Info,not-collapsed|Twitter,color-grey,Twitter,not-collapsed;AboutMe,color-grey,AboutMe,not-collapsed|Signature,color-grey,Signature,not-collapsed From a Text field in the mysql db, it then it is translated from jquery to show a portable iGoogle like page. But the problem is, I need to make the query select everything but the "Twitter,color-grey,Twitter,not-collapsed" (TWITTER PART) how is this possible?
-
Wow.. topic resolved, thank you sir lol
-
Hi, I have the following code: case "Twitter"; echo 'Twitter gadget will show here'; break; I need to make it so it's like this: case "Twitter" AND $member['top'] == "1" echo "Twitter Gadget will show here"; break; I need to add a IF onto the CASE is it possible? Thank you.
-
$txt = preg_replace( "#\[yt\]http://www.youtube.com/watch?v=(.+?)\[/yt\]#is", '<embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="512" height="313" allowfullscreen="true" />', $txt ); Okay this is my code just for inserting it into HTML, the problem is whenever I try to use: [yt]http://www.youtube.com/watch?v=l1G7TJD6Xu0[/yt] On my form to enter it does not work? But if I use $txt = preg_replace( "#\[yt\](.+?)\[/yt\]#is", '<embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="512" height="313" allowfullscreen="true" />', $txt ); [yt]l1G7TJD6Xu0[/yt] It works. But I want to use the full URL of the youtube, so I don't want my users to copy/paste just the "l1G7TJD6Xu0" Code , any help? Thank you
-
Is there a way I can get the .jpg file in kilobytes from a remote url and check it to make sure it does not exceed 40 kilobytes before it saves the remote url into my database?
-
Okay, Sorry I think I might have gave the wrong information, I am still getting WSOD though, and I get no apache error logs, or nothing. Really making me eager to learn more about this php.
-
For some reason this stupid code is bringing up a white blank WSOD, no apache logs or nothing, running php 5 on my server. function fetch_row($query_id = "") { if ($query_id == "") { $query_id = $this->query_id; } $this->record_row = mysql_fetch_array($query_id, MYSQL_ASSOC) ; return $this->record_row; } How can I make this php5 compatible? Thank you
-
Thanks, topic resolved.
-
On my main page of my forum, it shows the total amount of Posts and Topics on board, and it selects these from a query IBF_STATS,. and I was just wondering, do you think it would be more improvement wize to edit each time somone post's you use fwrite, and make it add +1 into the .txt on the server, then just extract the .txt contents to show on the main page, so you do not have to use a mysql query, do you think it would beneficial or no? Is reading from a .txt a strain on a server or alot easier then comparing 1 simple (kinda long) mysql query?
-
Sweet I guess all I did was change it to $pattern = '/<embed type="application\/x-shockwave-flash" src="mp3.swf" flashvars="m=(.*)" width="200" height="12" \/>/'; $txt = preg_replace($pattern, '[mp3]$1[/mp3]', $txt); Now it works, Thanks guys
-
Wont work man, cause it's a Edit Signature system, i have thousands of people everyone will enter submit a different url of a song, it can't be the samed it has to be some type of thing to read what m= was so it works for every single user. example: $txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt ); See the (\S+?) that will be bring back whatever use has pulled from the img src=" XXX " tags, i need the same for m= " ", so I tried this: $txt = preg_replace($pattern, '[mp3](.+?)[/mp3]', $string); But doesn't work it brings back: Instead of [mp3]http://pds18.egloos.com/pds/201010/24/20/Dragon_Rider.mp3[/mp3] Like I submitted... ^^^^ This is what im trying to accomplish, this sht is so confusing for me, sorry if i can't explain well
-
$text = 'somefile.mp3'; my $text is coming from a input data , that full function is: function unconvert($txt="", $code=1, $html=0) { $text = 'somefile.mp3'; $string = '<embed type="application/x-shockwave-flash" src="mp3.swf" flashvars="m='.$text.'" width="200" height="12" />'; $pattern = '/<embed type="application\/x-shockwave-flash" src="mp3.swf" flashvars="m=(.*)" width="200" height="12" \/>/'; $txt = preg_replace($pattern, '[mp3]$1[/mp3]', $string); $txt = preg_replace( "#(<font style='width=80%; filter:xray'>)(.+?)(</font>)#is", "\[xray\]\\2\[/xray\]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:glow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[glow=\\2\]\\4\[/glow\]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:shadow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[shadow=\\2\]\\4\[/shadow\]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:flipV'>)(.+?)(</font>)#is", "\[flipv\]\\2\[/flipv\]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:flipH'>)(.+?)(</font>)#is", "\[fliph\]\\2\[/fliph\]", $txt ); $txt = preg_replace( '#(<div align=")(.+?)(">)(.+?)(</div>)#is', "\[ALIGN=\\2\]\\4\[/ALIGN\]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:blur'>)(.+?)(</font>)#is", "\[blur\]\\2\[\/blur]", $txt ); $txt = preg_replace( "#(<font style='width=80%; filter:dropshadow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[dropshadow=\\2\]\\4\[\/dropshadow\]", $txt ); $txt = preg_replace( "#(<\!--txtStart-->)(.+?)(<\!--txtEnd-->)#is", "\[spoiler\]\\2\[/spoiler\]", $txt ); $txt = preg_replace( "#(<\!-- spoilerKillit -->)(.+?)(<\!-- spoilerKillitEnd -->)#is", "", $txt ); $txt = preg_replace( "#(<strike>)(.+?)(</strike>)#is", "\[s\]$2\[/s\]", $txt ); $txt = preg_replace( "#(<sup>)(.+?)(</sup>)#is", "\[sup\]$2\[/sup\]", $txt ); $txt = preg_replace( "#(<sub>)(.+?)(</sub>)#is", "\[sub\]$2\[/sub\]", $txt ); } I tried to change $txt = preg_replace($pattern, '[mp3]$1[/mp3]', $string); To: $txt = preg_replace($pattern, '[mp3]$1[/mp3]', $text); But then it just shows somfile.mp3 in my textarea instead of [mp3]my song i put to submit[/mp3] Any more info BLueSky, thanks
-
I tried: $txt = preg_replace( "#<embed type=\"application/x-shockwave-flash\" src=\"mp3.swf\" flashvars=\"m=\'(.+?)'\" width=\"200\" height=\"12\" />#es" ,"\[mp3\]\\1\[/mp3\]" , $txt ); And it doesnt give errors but it's not working and converting it... wtf?
-
So i need to add the correct delimiters on this code: return '<embed type=\"application/x-shockwave-flash\" src=\"mp3.swf\" flashvars=\"m='.$txt.'" width=\"200\" height=\"12\" />'; But that's why I made this topic , im stuck, lol
-
Pattern replacement, subject, limit, count, it's perfectly fine, my pattern is the problem here? This code works fine $txt = preg_replace( '#(<div align=")(.+?)(">)(.+?)(</div>)#is', "\[ALIGN=\\2\]\\4\[/ALIGN\]", $txt ); But im still stumped, >_> And that code is to replace alignment html xD
-
No ending delimiter '$' found in post_parser.php on line 608 608: $txt = preg_replace( "\$this->unconvert_mp3('\\1', '(\])')", "#\[mp3\](.+?)\[/mp3\]#se", $txt ); function unconvert_mp3: function unconvert_mp3($txt, $lol) { global $ibforums, $std, $DB; return '<embed type=\"application/x-shockwave-flash\" src=\"mp3.swf\" flashvars=\"m='.$txt.'" width=\"200\" height=\"12\" />'; } Pretty much I'm trying to replace <embed type=\"application/x-shockwave-flash\" src=\"mp3.swf\" flashvars=\"m='.$txt.'" width=\"200\" height=\"12\" /> with [mp3] XX [/mp3] bbcode, Thanks for your response
-
Bump
-
Bump! Is this even possible ? or does that site have some source code that i neeD?