Jump to content

StirCrazy

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.babyandBump.com

Profile Information

  • Gender
    Not Telling

StirCrazy's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi folk, Need some of that 'ol phpfreaks magic I'm trying to contruct a page (as a whole) from lots of sub template files. Some of these sub template files call other sub template files (a bit like you would use 'include' to call a php file). I'm currently using this function, but it only constucts the page up to the first sub level template (it doesn't get templates within templates). function contructpage($template) { global $subdir; $templateincludes = getStrsBetween('{template:','}', $template); if (isset($templateincludes)) { foreach ($templateincludes as $value => $tplfile) { if(!($includedtemplate = @file_get_contents($subdir['templates'] . '/' . $tplfile))) { error('no_sub_tpl', $tplfile); } $template = eregi_replace('{template:' . $tplfile. '}', strval($includedtemplate), $template); } } return $template; } $template = file_get_contents('main_template.tpl') $whole_template = contructpage($template); Can anyone help making a function that keeps going until the whole page is made? EG: index.tpl:- file1.tpl:- subfile1.tpl:-
  2. you my friend are a genius! Thank you very much for the help (sorry for the delay in replying, was feeding the baby).
  3. thanks badbad Kinda got it working using below, but is a very dirty way of coding. There must be a patten that matches it. $message = (str_replace('[url]http://www.' . $domain, '', $message)); $message = (str_replace('[url=http://www.' . $domain, '', $message)); $message = (str_replace('[url="http://www.' . $domain, '', $message));[/code] I'll give your way a go and see what happens.
  4. Hey all Having a little problem with pattern matching (because I'm crap at it LOL). I need to remove a variable URL from page text. Problem is the URL is wedged between bbcode. The domain variable:- $removedomain = "domain.com"; Needs to cater for:- with or without http / https :// with or without www. EG: $pagetext = (preg_replace($pattern, '', $pagetext)); Can anyone help me with the correct pattern to remove the right domain? Thanks, S.C>
  5. Hi there, I've used stripos to find the position of part a word. How would I find the full word? EXAMPLE: $string = "this is message text text text text text text text text text text text"; the full word at character position 10 is "message". How word I put that full word ("message") in a variable (for use later)? Thanks in advance.
  6. Thanks for the ultra fast reply mgallforever
  7. I know this is really simple but have brain freeze. How do you include a page but include error.php (or any error file) if the file doesn't happen to exist.... for example include($page . '.php') //if page doesn't exist then... include ('error.php')
  8. Hi folks, Wonder if someone can give me a hand If I had a variable like this:- and an array like this:- How would I find out how many times each word in the array features in $contents ? The preferable return would be an array like this:- Any help would be great Thanks in advance
  9. You genius Works on your version, just have to addapt it now. Thank you utexas_pjm
  10. Hi folks, I'm trying to sensor some text variables (but in a specific way). Looks like this:- $text = "text text text BOB1 text text text"; $replacetext = "*****"; $var1 = array("BOB","JACK","BILLY","HARVEY","JOHN"); $var2 = array("1","2","3","4","5"); If $text has "BOB" anywhere in the variable then check if it has a number from $var2 joined to it. If it has the replace "BOB1" with $replacetext. Any ideas how to do this? Will love you forever if you can help. S.C>
  11. I've just recently upgraded to PHP Version 5.2.3 from 4.4.7 and noticed a problem with one of my GD images. It should use verdana.ttf for the text using the code below imagettftext($image, $fontSize, 0, $margin, 73, $black, $font, $tickerText); But for some reason the text is messed up... and ideas why? S.C>
  12. thanks fenway. can you tell what variables are sent?... say if I selected 1st January 2007 -> 2nd January 2007 (ie. how is the date formatted when parsed in the form). Thanks for your help. S.C>
  13. I'm trying to figure out how this __doPostBack function works in relation to the date form below. I'm trying to get a commission report for another site and want to find out what variables it posts and in what format. Can anyone help? Sample below. Oh and just a side note (that should be in the PHP forum but you may know) Is it possible to post variables using PHP CURL to an .aspx page? Regards, S.C>
×
×
  • 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.