Monkuar
Members-
Posts
987 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Monkuar
-
//mod_KaLiTe_Subforums BEGIN $forum_data['subforums'] .= "<a href=?z={$data[id]}>"; $forum_data['subforums'] .= $data['name']; $forum_data['subforums'] .= "</a>"; //mod_KaLiTe_Subforums END This shows all my subforums on my forum, but 1 problem, if I try to seperate them, like let's say with a "comma" by using: //mod_KaLiTe_Subforums BEGIN $forum_data['subforums'] .= "<a href=?z={$data[id]}>, "; $forum_data['subforums'] .= $data['name']; $forum_data['subforums'] .= "</a>"; //mod_KaLiTe_Subforums END It will show the , BEFORE the link? so weird, here is the function: $forum_data['subforums'] = "<br> <span class=desc4>Subforums:</span> "; foreach($this->children[ $forum_data['id'] ] as $idx => $data) { //-------------------------------------- // Check permissions... //-------------------------------------- if ( $std->check_perms($data['read_perms']) != TRUE ) { continue; } // Do the news stuff first if (isset($data['last_title']) and $data['last_id'] != "") { if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $data['id']) ) { $this->news_topic_id = $data['last_id']; $this->news_forum_id = $data['id']; $this->news_title = $data['last_title']; } } if ($data['last_post'] > $newest['last_post']) { //Subforum last_title? $newest['last_post'] = $data['last_post']; $newest['fid'] = $data['id']; //$newest['id'] = $data['id']; $newest['last_id'] = $data['last_id']; $newest['last_title'] = $data['last_title']; $newest['password'] = $data['password']; $newest['last_poster_id'] = $data['last_poster_id']; $newest['last_poster_name'] = $data['last_poster_name']; $newest['status'] = $data['status']; $newest['star'] = $data['star']; } $newest['posts'] += $data['posts']; $newest['topics'] += $data['topics']; $printed_children++; //mod_KaLiTe_Subforums BEGIN $forum_data['subforums'] .= "<a href=?z={$data[id]}>, "; $forum_data['subforums'] .= $data['name']; $forum_data['subforums'] .= "</a>"; //mod_KaLiTe_Subforums END } How can I make it so it doesn't show the , before the FIRST link on that subforums variable, but only after every link and beyond? Okay I got it working by moving it ontop $forum_data['subforums'] .= "<a href=?z={$data[id]}>{$data['name']}</a>, "; //mod_KaLiTe_Subforums END $printed_children++; but now it shows the , after the last link, how do I make it so it doesn't show the comma for the last child?
-
worst then me lol
-
$DB->query('UPDATE clans set pending_ids=pending_ids+"'.$ibforums->member['id'].'|" WHERE id = '.$this->clan['id'].''); I have a field called pending_ids and each time a new user requests to join a clan, i need it to add "memberid|" so then I can explode the member id's with the | later.. this query doesn't work it doesn't read the " | "
-
ROFL I FIXED IT AGAIN GG MONKUAR!! '#<3#i' => '<img src=html/emoticons/heart2.gif alt="<3">',
-
'#(?<!\w)<3(?!\w)#i' => '<img src=html/emoticons/heart2.gif alt="<3">', <3 is not being converrted over? I tried to add a \ before < but still not working? PS: This is for my smiley bbcode
-
to $txt = str_replace($match[0], sprintf('%s<a href=\'%s\'>%s</a>%s',$match[1],$url,$url,$match[4]), $txt); WE HAVE A WINNER! THANKS YOU dude!
-
HAHAA I FIXED IT!!! TOPIC RESOLVED!!! if ($display[0] == "1"){ $f = ""; }else{ while( $r = $DB->fetch_row() ){ if ( $r['last_activity'] > (time() - 900) ) $r['status'] = "<span style=float:right;><span class=desc4><b>Online</b></span></span>"; else $r['status'] = "<span style=float:right;><span class=desc4>Offline</span></span>"; $column++; if ($ibforums->member['settings']['2'] or (!$ibforums->member['id'])){ $color = "{$r['color']}"; $colors = explode(",", $color); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ { $r['color'] = ($r['color']) ? "style=\"padding:1px 1px 1px 2px;color:#{$colors[0]};filter:Glow(color=#{$colors[1]},strength=3)\"":""; } }else{ $r['color'] = ($r['color']) ? "style=\"color:#{$colors[0]};text-shadow:#{$colors[1]} 2px 1px 1px\"":""; } } $test = explode(";", $info['pdata']); $r['avatar'] = ($r['avatar']) ? "<img src={$r['avatar']} width=64 height=64>" : ""; $r['star'] = ($r['star']) ? "<img class=top3 src=style_images/1/icons/{$r['star']}.png>":""; $r['name'] = "<a href=?i={$r['friendid']}>{$r['name']}{$r['star']}</a>"; $friendoutput .= <<< LOL <dl class="LOL LEFT flm" style="margin-right:5px"><dt2>{$r['name']}</dt2><dd class=padding4>{$r['avatar']}<div class="RIGHT">{$r['status']}</div></dd></dl> LOL; } $f = '<fieldset><legend>'.$Friends.'</legend> <div class="padding4"> '.$Friends2.' '.$friendoutput.' </div> </fieldset>'; } so epic didn't know .= passes a LOOP! <333333333333333333333333333
-
i have a variable called $cake it needs to have this loop inside it so I can call it out while( $r = $DB->fetch_row() ){ if ( $r['last_activity'] > (time() - 900) ) $r['status'] = "<span style=float:right;><span class=desc4><b>Online</b></span></span>"; else $r['status'] = "<span style=float:right;><span class=desc4>Offline</span></span>"; $column++; if ($ibforums->member['settings']['2'] or (!$ibforums->member['id'])){ $color = "{$r['color']}"; $colors = explode(",", $color); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ { $r['color'] = ($r['color']) ? "style=\"padding:1px 1px 1px 2px;color:#{$colors[0]};filter:Glow(color=#{$colors[1]},strength=3)\"":""; } }else{ $r['color'] = ($r['color']) ? "style=\"color:#{$colors[0]};text-shadow:#{$colors[1]} 2px 1px 1px\"":""; } } $test = explode(";", $info['pdata']); $r['avatar'] = ($r['avatar']) ? "<img src={$r['avatar']} width=64 height=64>" : ""; $r['star'] = ($r['star']) ? "<img class=top3 src=style_images/1/icons/{$r['star']}.png>":""; $r['name'] = "<a href=?i={$r['friendid']}>{$r['name']}{$r['star']}</a>"; $this->to_print .= <<< LOL <dl class="LOL LEFT flm" style="margin-right:5px"><dt2>{$r['name']}</dt2><dd class=padding4>{$r['avatar']}<div class="RIGHT">{$r['status']}</div></dd></dl> LOL; } I tried: $cake = ' while( $r = $DB->fetch_row() ){ if ( $r['last_activity'] > (time() - 900) ) $r['status'] = "<span style=float:right;><span class=desc4><b>Online</b></span></span>"; else $r['status'] = "<span style=float:right;><span class=desc4>Offline</span></span>"; $column++; if ($ibforums->member['settings']['2'] or (!$ibforums->member['id'])){ $color = "{$r['color']}"; $colors = explode(",", $color); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ { $r['color'] = ($r['color']) ? "style=\"padding:1px 1px 1px 2px;color:#{$colors[0]};filter:Glow(color=#{$colors[1]},strength=3)\"":""; } }else{ $r['color'] = ($r['color']) ? "style=\"color:#{$colors[0]};text-shadow:#{$colors[1]} 2px 1px 1px\"":""; } } $test = explode(";", $info['pdata']); $r['avatar'] = ($r['avatar']) ? "<img src={$r['avatar']} width=64 height=64>" : ""; $r['star'] = ($r['star']) ? "<img class=top3 src=style_images/1/icons/{$r['star']}.png>":""; $r['name'] = "<a href=?i={$r['friendid']}>{$r['name']}{$r['star']}</a>"; $this->to_print .= <<< LOL <dl class="LOL LEFT flm" style="margin-right:5px"><dt2>{$r['name']}</dt2><dd class=padding4>{$r['avatar']}<div class="RIGHT">{$r['status']}</div></dd></dl> LOL; }'; but not working
-
OKay update:I got it into my $friends variable! $friends = $this->to_print .= <<< LOL <fieldset><legend>$Friends</legend> <div class="padding4"> $Friends2 LOL; while( $r = $DB->fetch_row() ){ if ( $r['last_activity'] > (time() - 900) ) $r['status'] = "<span style=float:right;><span class=desc4><b>Online</b></span></span>"; else $r['status'] = "<span style=float:right;><span class=desc4>Offline</span></span>"; $column++; if ($ibforums->member['settings']['2'] or (!$ibforums->member['id'])){ $color = "{$r['color']}"; $colors = explode(",", $color); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ { $r['color'] = ($r['color']) ? "style=\"padding:1px 1px 1px 2px;color:#{$colors[0]};filter:Glow(color=#{$colors[1]},strength=3)\"":""; } }else{ $r['color'] = ($r['color']) ? "style=\"color:#{$colors[0]};text-shadow:#{$colors[1]} 2px 1px 1px\"":""; } } $test = explode(";", $info['pdata']); $r['avatar'] = ($r['avatar']) ? "<img src={$r['avatar']} width=64 height=64>" : ""; $r['star'] = ($r['star']) ? "<img class=top3 src=style_images/1/icons/{$r['star']}.png>":""; $r['name'] = "<a href=?i={$r['friendid']}>{$r['name']}{$r['star']}</a>"; $this->to_print .= <<< LOL <dl class="LOL LEFT flm" style="margin-right:5px"><dt2>{$r['name']}</dt2><dd class=padding4>{$r['avatar']}<div class="RIGHT">{$r['status']}</div></dd></dl> LOL; } $this->to_print .= <<< LOL </div> </fieldset> LOL; But I can't call my $friends variable anywhere?
-
I have a option in my profile settings for users to beable to "hide" there friends list this si my code to show there friends on there profile $this->to_print .= <<< LOL <fieldset><legend>$Friends</legend> <div class="padding4"> $Friends2 LOL; while( $r = $DB->fetch_row() ){ if ( $r['last_activity'] > (time() - 900) ) $r['status'] = "<span style=float:right;><span class=desc4><b>Online</b></span></span>"; else $r['status'] = "<span style=float:right;><span class=desc4>Offline</span></span>"; $column++; if ($ibforums->member['settings']['2'] or (!$ibforums->member['id'])){ $color = "{$r['color']}"; $colors = explode(",", $color); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ){ { $r['color'] = ($r['color']) ? "style=\"padding:1px 1px 1px 2px;color:#{$colors[0]};filter:Glow(color=#{$colors[1]},strength=3)\"":""; } }else{ $r['color'] = ($r['color']) ? "style=\"color:#{$colors[0]};text-shadow:#{$colors[1]} 2px 1px 1px\"":""; } } $test = explode(";", $info['pdata']); $r['avatar'] = ($r['avatar']) ? "<img src={$r['avatar']} width=64 height=64>" : ""; $r['star'] = ($r['star']) ? "<img class=top3 src=style_images/1/icons/{$r['star']}.png>":""; $r['name'] = "<a href=?i={$r['friendid']}>{$r['name']}{$r['star']}</a>"; $this->to_print .= <<< LOL <dl class="LOL LEFT flm" style="margin-right:5px"><dt2>{$r['name']}</dt2><dd class=padding4>{$r['avatar']}<div class="RIGHT">{$r['status']}</div></dd></dl> LOL; } $this->to_print .= <<< LOL </div> </fieldset> now I will be using this code to make it hidden based on a variable (they set in there settings) //Hide Friends if ($display[0] == "1"){ $friend = ""; }else{ $friend = 'show that function here above code'; } how can I pull all that info into my $friend variable to make it easy? See then I could just echo out $friend and it will show that code above, or not (if they hidden it in settings)? Help ty
-
I have a scratch ticket system I made, and this code generates if a user will win or not. $card1 = rand(1,5); $card2 = rand(1,5); if($card1 == "1" && $card2 == "1"){ //I WON!!! do my queries here/etc }else{ //Failed } Okay, now how can I make it so I can set it up so I can change it to 5% of winning, 10% of winning, 15% of winning, 20% of winning/etc so on? instead of just a random count function?
-
Okay Well this is below all your code, because this goes to my quote function to get my quotes working $txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt ); regex_parse_quotes function is: function regex_parse_quotes($the_txt="") { if ($the_txt == "") return; $txt = $the_txt; // Too many embedded code/quote/html/sql tags can crash Opera and Moz /*if (preg_match( "/\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\]/is", $txt) ) { $this->quote_error++; return $txt; }*/ $this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) ); $txt = preg_replace( "#\[quote\]#ie" , "\$this->regex_simple_quote_tag()" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '\\2')" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '')" , $txt ); $txt = preg_replace( "#\[/quote\]#ie" , "\$this->regex_close_quote()" , $txt ); $txt = preg_replace( "/\n/", "<br>", $txt ); if ( ($this->quote_open == $this->quote_closed) and ($this->quote_error == 0) ) { $txt = preg_replace( "#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); return $txt; } else { return $the_txt; } } Out of all those 4 $txt = preg_replace( "#\[quote\]#ie" , "\$this->regex_simple_quote_tag()" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '\\2')" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '')" , $txt ); $txt = preg_replace( "#\[/quote\]#ie" , "\$this->regex_close_quote()" , $txt ); I think the $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '')" , $txt ); one is the that is going to be used because it does the [quote === XXXXXXXXX] ?? right? If so, regex_quote_tag function is: function regex_quote_tag($name="", $date="") { global $ibforums; if ( $date != "" ) { $default = "\[quote=$name,$date\]"; } else { $default = "\[quote=$name\]"; } if ( strstr( $name, '<!--c1-->' ) or strstr( $date, '<!--c1-->' ) ) { // Code tag detected... $this->quote_error++; return $default; } $name = str_replace( "+", "+", $name ); $name = str_replace( "-", "-", $name ); $name = str_replace( '[', "[", $name ); $name = str_replace( ']', "]", $name ); $this->quote_open++; if ($date == "") { $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name)" ) ); } else { $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name @ $date)" ) ); } $extra = "-".$name.'+'.$date; return "<!--QuoteBegin".$extra."-->{$html['START']}<!--QuoteEBegin-->"; } Hope this helps
-
Hey I went to school, sorry for the response I guess I forgot to add the $url to it, I did and it now shows <a href="\"http://www.youtube.com/watch?v=xN0FFK8JSYE\"">http://www.youtube.com/watch?v=xN0FFK8JSYE</a>[code] It has a extra \ somewhere that's making it not do weird things, lol but damn bro it working for the most part, but when they click on it it goes to http://localhost/%22http://www.youtube.com/watch?v=xN0FFK8JSYE\%22 hence the above sentences dude you're amazing, i would have never had figured this out man now I will prob do the same to my vimeo bbcode tag's and Worldstarhiphop video tags aswel with your code. you're wonderful
-
OHH Its almost working! now it shows up as <a href="\"\""></a>
-
HAH POOP ON ME! let me try lol Maybe I am the problem here :shrug:
-
HAHA that is the same line of code!!!
-
okay i moved my quote $txt below it and it seems to work, but 1 flaw it doesn't end with a it does ? im so close and the url comes out as "$s"
-
mad Techie, the code again works when I take out the ,1 with no white screen of death. but $txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt ); I think is what making it not working I have $txt = str_replace($match[0], $this->convert_youtube($match[2],$match[3]), $txt); $RegEx = '%(\[quote\].*?)?\[youtube\]http\://(.*?)youtube\.com/watch\?v\=(.*?)\[/youtube\](.*?\[/quote\])?%ie'; if(preg_match_all($RegEx, $txt, $matches,PREG_SET_ORDER)){ foreach($matches as $match){ if(!empty($match[0]) && empty($match[1]) && empty($match[4])){ $txt = str_replace($match[0], $this->convert_youtube($match[2],$match[3]), $txt); }else{ $txt = str_replace($match[0], sprintf('%s<a href="http://%syoutube.com/watch?v=%s">LINK</a>%s',$match[1],$match[2],$match[3],$match[4]), $txt); } } } if I take out that $txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt ); my quotes don't work but the yt stuff does and it shows "LINK" EDIT: I think you might need to do the code to work with the quote function instead of the yt one?
-
Lol, some odd reason, that code gives me a white screen of death, must be something to do with the $txt, my $txt stuff is already in 1 big function also, but yeah ima look over it through the night picking pieces at it blah i removed the ,1 and it's not screen of death, let me test ty
-
The code works, because no errors, but it still embeds the youtube hmmm.. haha
-
to become Right ? HAHA Yeah if they try to post the tags inside a [quote] then it just doesn't embed the youtube video, it just shows the link to it instead (or text) it's frustrating when im viewing topics on my site and people quoting other people and the youtube video pops up with that quote, alot better if when they quote somone it just shows the youtube url instead i just saw your reply let me get a few minutes to study and check it ty
-
Okay, on my forum if my users try to quote a youtube video, it shows the youtube video, while being quoted... (and if alot of people quote that video in a topic/thread) it becomes slow and bloated because abunch of people quoted the youtube videos and they're RE-Quotes. My solution is, is if the tags are INSIDE the [quote] tag's it just shows the youtube URL and doesn't embed!. My Problem is, I don't know how to do it, lol Here is my parser to convert the quotes: $txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt ); Regex_Parse_quotes function is: function regex_parse_quotes($the_txt="") { if ($the_txt == "") return; $txt = $the_txt; // Too many embedded code/quote/html/sql tags can crash Opera and Moz /*if (preg_match( "/\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\].+?\[(quote|code|html|sql)\]/is", $txt) ) { $this->quote_error++; return $txt; }*/ $this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) ); $txt = preg_replace( "#\[quote\]#ie" , "\$this->regex_simple_quote_tag()" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '\\2')" , $txt ); $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie" , "\$this->regex_quote_tag('\\1', '')" , $txt ); $txt = preg_replace( "#\[/quote\]#ie" , "\$this->regex_close_quote()" , $txt ); $txt = preg_replace( "/\n/", "<br>", $txt ); if ( ($this->quote_open == $this->quote_closed) and ($this->quote_error == 0) ) { $txt = preg_replace( "#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) ); return $txt; } else { return $the_txt; } } Here is my youtube parser: $txt = preg_replace( "`\[youtube\]http\://(.*?)youtube\.com/watch\?v\=(.*?)\[/youtube\]`ie" , "\$this->convert_youtube('\\1','\\2')", $txt ); Convert_Youtube function: function convert_youtube($code,$code1) { global $ibforums; $this->youtube_count++; return '<embed src="http://'.$code.'youtube.com/v/'.$code1.'" type="application/x-shockwave-flash" wmode="transparent" width="512" height="313" allowfullscreen="true" />'; } Thanks if you can help! I'll be tracking this topic like a hawk!
-
Not sure what to google for? can u give me a good idea
-
Is there anyway to have users play flash games on my forum and if they win/etc, send them Forum Gold? Wouldn't it be easy to hack it though by just changing the data being sent from the flash app with tamper data? I want to put a poker flash game on my site, and if users play poker/etc and if they win, I want to run a mysql query to update there account with more "Forum gold" If you will, and I want the poker flash game to have correspond and work with the amount of Forum Gold that they have? Would this have to be custom coded by me If I learn actionscript? OR is there anything out like this that I can use?
-
Your code does not WORK, because it's using get num_rows from my query, which is from all my users data. Look let me explain. I have a Track Topic feature, people click "track Topic" on a topic, it adds it to there Tracker. When they view there tracker, it shows them each topic in EACH forum (Category) so I am trying to display a </dd> after each CATEGORY, hence: if ($counter > $i){ $this->output .= <<< E </table></dd> E; } or whatever kind of code that works, If I use your CODE, it does not because it's gather all my TOPICS and not for each individual category. I need to add the </dd> below every category to make my page look nice. This coderight here, echo's out each Category/forum name if ($last_forum_id != $topic['forum_id']) { $last_forum_id = $topic['forum_id']; $this->output .= <<< E <td colspan=10><dl><dt><a href=?z={$topic['forum_id']}>{$topic['forum_name']}</a></dt><dd> <table class="tuble"> 25 E; } So that works fine, I am puzzled on why I cant use this at the bottom to and this whole thing will be fixed. If I have 4 Category's and 3 topics in each 1, that code shows all 4 categorys with 3 topics in each properly. I just cant use that function again because if I Could iwouldn't have this problem. all I am trying to get is the amount of Category's the person is subscribed to, and if I enter in a $i++ in that code ABOVE, it shows how many, but I cant use it inside my LOOP because like you said it would echo out 1234 instead of just "4" and make my statement not work, this is really making me ache Im about to tear my hair out I feel like a retard