DarkAngelBGE
-
Posts
7.686 -
Joined
-
Last visited
Posts posted by DarkAngelBGE
-
-
Yes of course this is a blatant spam thread, but we are in the fun & games forum so who cares?
-
What do you mean it doesn't work when you are replying?
-
Just a thread to say that I love this community. I love all the people here, especially [you].
-
Seems you haven't understood the concept of functions yet. Since your get_page() function returns the page info, you need to grab it.
This will work:
$page_info = get_page();
echo $page_info[0]; -
Yes of course, but if I used that ONLY it will be a complete mess since it will add thousands of <span color="xxxx"></span> to the code. Now when you edit your code you don't want to see those.
Also it is to make sure that certain control chars are prevented from causing damage.
I took the highlight_string() part out of the above implementation since it is not need in the matter of this topic. However, here in the forum engine it is there. I couldn't get it to work yet though, something's wrong with the highlighting.
Perhaps I will manage to get it to work soon.
-
Brian, where can I buy this Zen Touch?
-
Well if you really want to store php in your database, make sure to properly convert it before inserting it and then unconverting it.
Here is something I digged up for you. When you have a form and want to submit some php code, make sure to put [ php ] tags around it (without the spaces):
function unconvert($txt) {
preg_match( "#<!--PHP-Head-->(.+?)<!--PHP-EHead-->(.+?)<!--PHP-Foot-->(.+?)<!--PHP-EFoot-->#", $txt, $m);
$php = str_replace("$", "<!--SDS-->$<!--EDS-->", $m[2]);
$txt = preg_replace( "#<!--PHP-Head-->(.+?)<!--PHP-EHead-->(.+?)<!--PHP-Foot-->(.+?)<!--PHP-EFoot-->#e", "\$this->unparse_php_tag(\$php)", $txt);
}
function unparse_php_tag($txt="")
{
$txt = str_replace("<!--SDS-->$<!--EDS-->", "$", $txt);
$txt = str_replace("<code>" , "" , $txt);
$txt = str_replace("</code>", "" , $txt);
$txt = str_replace("</font>", "" , $txt);
$txt = str_replace("</span>", "" , $txt);
$txt = preg_replace("#\<font(.+?)>#", "", $txt);
$txt = preg_replace("#\<span(.+?)>#", "", $txt);
$txt = preg_replace("#^<span(.+?)><br />(.+?)#", "\\2", $txt);
$txt = preg_replace("#(.+?)(?:<br />){1,}$#", "\\1", $txt);
$txt = str_replace("<br />" , "\n", $txt);
return "[php]".$txt."[/php]";
}
function parse_php_tag($txt="")
{
$default = "\[php\]$txt\[/php\]";
if ($txt == '')
{
return;
}
if (preg_match("/\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\].+?\[(quote|code|html|sql|php)\]/i", $txt))
{
return $default;
}
$txt = @html_entity_decode($txt, ENT_QUOTES);
$txt = str_replace("$", "$", $txt);
while (preg_match("#\n$#", $txt))
{
$txt = preg_replace("#\n$#", "", $txt);
}
$txt = preg_replace("#<#" , "<" , $txt);
$txt = preg_replace("#>#" , ">" , $txt);
$txt = preg_replace("#"#" , """ , $txt);
$txt = preg_replace("#:#" , ":" , $txt);
$txt = preg_replace("#\[#" , "[" , $txt);
$txt = preg_replace("#\]#" , "]" , $txt);
$txt = preg_replace("#\)#" , ")" , $txt);
$txt = preg_replace("#\(#" , "(" , $txt);
$txt = preg_replace("#\r#" , "<br />" , $txt);
$txt = preg_replace("#\n#" , "<br />" , $txt);
$txt = preg_replace("#\s{1};#" , ";" , $txt);
$txt = preg_replace("#\s{2}#" , " ", $txt);
$txt = preg_replace("#^\<font color=\"\#000000\">\<br />#", "", $txt);
$txt = preg_replace("#\<br />\</font>$#", "", $txt);
$txt = preg_replace("#^<span(.+?)><br />(.+?)#", "\\2", $txt);
$txt = preg_replace("#(.+?)(?:<br />){1,}$#", "\\1", $txt);
$html = $this->wrap_style('php');
return "<!--PHP-Head-->{$html['START']}<!--PHP-EHead-->$txt<!--PHP-Foot-->{$html['END']}<!--PHP-EFoot-->";
}
function wrap_style( $type='quote', $extra="" )
{
$used = array(
'php' => array( 'title' => 'PHP' , 'css_top' => 'phptop' , 'css_main' => 'phpmain' ),
);
return array( 'START' => "<div class='{$used[ $type ]['css_top']}'>{$used[ $type ]['title']}{$extra}</div><div class='{$used[ $type ]['css_main']}'>",
'END' => "</div>"
);
}It's the php tag that I have written for our forum engine. Tell me if it works.
-
Take care, Klaas!
-
Hey Shane. What do you do in your freetime apart from studying for college?
-
Good stuff Chris, keep it coming. If you want to convert all smilies I would be very thankful. Maybe you could zip them up and send them over per email.
By the way, how do you do those? From scratch?
-
Nice, our print pr actions pay back. Welcome aboard David, nice to have you here.
What other RTS games are you playing / have you played?
Make yourself home here - if you have any question or problem, ask a Community Guardian or me.
Cheers, mate!
-
Hi Mike, welcome aboard. I like your nice new blue coat here on the forums.
-
-
Alright, go ahead.
-
Sure Chris go ahead. You maybe also want to come up with a mixture of the IPB and the standard style perhaps, like "WFG style"? Since it's about 50%/50% standard and IPB style (well almost ).
Thanks in advance! Just post some sneak previews here or send them to me per PM.
-
Here are some spiritually speaking for you, Ugo:
1) What season are you currently in regarding your spiritual life?
2) How certain are you that your current belief about god is correct? What would change that?
3) What kinds of things do you pray about most frequently?
Cheers mate.
-
@Klaas: Nah I mean the logo on the left, not the small truck one. The company logo there you know. I am not sure, it looks a bit alone. Maybe you move it a bit more down and put it into a box that blends a bit white onto the gradient like you did already on the left there. Does that make sense?
-
Considering the probable target market...that is production companies that will buy the foot..I would say layout 4 with the big meat photo would be best, since the meat shown there looks like it's of a good quality.
Also generally, layout 4 appeals best to me. However, I would work on the logo placement..it doesn't look quite right alone there on the wide gradient.
Good work on these layouts Klaas.
-
Bah, anybody?
-
Bah guys, this is blatant spam. Stick to the topic and say what you are really thinking.
I am thinking I have to get my barbecue started soon that I am going to have in 30minutes with my parents and some relatives.
-
Yes Desmond what do you mean?
-
Yes, I take requests.. if it is something I can do yes.
-
-
NewEth Review #21 – War of the Worlds (8.6)
in Arts and Entertainment
Posted
Thanks Elf for the nice review.