Jump to content

zcrow

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

zcrow's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=386515:date=Jun 21 2006, 11:13 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 21 2006, 11:13 AM) [snapback]386515[/snapback][/div][div class=\'quotemain\'][!--quotec--] What... and you want us to write it for you? Take a look at the [a href=\"http://au.php.net/ereg_replace\" target=\"_blank\"]ereg_replace[/a] function. [/quote] This is my very first post to these forums. Not exactly a welcoming attitude. I came here hoping for help because I'm stuck. In the scale of things I guess I am a one or none green box kind of guy. Thank you for suggesting the ereg_replace function which I will look into but it doesn't really help us newcomers to start off with an attitude.
  2. Thanks. I'm not expecting someone to write it for me but I wasn't sure how to do it. I thought there might be an easy-ish way to use the existing script and modifying it. I will check out those function suggestions and see where that leads me.
  3. I've got a script that paginates long articles into multiple pages. The article stored in the db has this code inserted where page breaks are supposed to happen: <p>[PAGE1]</p> content <p>[PAGE2]</p> etc. This all works fine and I don't need any changes here but what I do need to do is create a print version of the article which would effectively display the entire text for the article and remove any instances of <p>[PAGE1]</p>, etc. If anyone could help me with this I would really appreciate it. The code for doing the page breaks looks like this: //break article into pages if there are pages $originaltext = $row_rs['content']; $total=substr_count($originaltext,"[PAGE"); if ($_GET['pg'] && $_GET['pg']<$total+1) { $i=$_GET['pg']; } else { $i=1; } // Next page $k=$i+1; $page="[PAGE".$i."]"; $nextpage="[PAGE".$k."]"; $start=strpos($originaltext,$page); $start=$start+strlen($page)+1; $end=strpos($originaltext,$nextpage); $length=$end-($start+$pagesize); $totalpages = $total; if ($i==$total) { $text=substr($originaltext,$start); } else { $text=substr($originaltext,$start,$length); } //Removes end of </p> tag from page numbers $text = substr($text,3);
×
×
  • 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.