Joined: Feb 01, 2007 Posts: 9 Location: Australia baby!
Posted: Sat Mar 08, 2008 3:00 pm Post subject: [--pagebreak--] in a custom module
Hey buddy, first up you're still doin a friggin great job- thanks so much for your work and support of the phpnuke system over the years. My question is about the [--pagebreak--] function within a custom module page. I don't know how exactly to code it up and am wondering if you can help me out? I will give you a link so you can see the details easily:
I can find the code within the Content module's index.php that splits up pages, but it's quite long and I don't exactly understand how it is splitting up the pages. Especially where I want to copy the code into my own module and have it work. Not a clue where to start to be honest. If you can offer me any help, it would be majorly appreciated!
Also on a totally different topic, have you seen Mighty_Y anywhere lately!?!? portedmods and area51 both seem to have died! Is Mighty_Y no longer around? (I ask cuz I'm looking to get his Attach Mod working again hehe)
Well basically you would read the entire contents and use PHP's split() function to break it down by the pagebreaks.
And then figure out which page you're supposed to be reading.
There's a lot of code to generate the page numberings and such, but it shouldn't be too complicated.
I haven't seen Mighty_Y.
I am working on getting the latest Attachment_Mod working. Just have to polish it up to release it _________________ Evaders99 Webmaster Administrator Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
Joined: Feb 01, 2007 Posts: 9 Location: Australia baby!
Posted: Sun Mar 09, 2008 6:25 am Post subject:
ahh very glad to hear you are polishing it up for release mate! think I will hold out until you are finished as from what I have read the attach mod in its currently released state has some security issues. Sad to hear you haven't heard from Mighty though, he was a total gun. It would be a major shame if he's bowed out of the scene completely after all this bs with the portedmods.com owner etc.. :/
Any chance you could try and remember to let me know when it's ready to be released? I'm more than happy to help you test it if you like beforehand. I'm running current versions of phpnuke and bbtonuke
Any way you could help me through this page splitting thing in a slightly more descript fashion? I've never seen the split() function and dont exactly understand how you can split one page and keep track of what is to be considered page1, page2 etc. It's extremely cryptic to me mate!
Attachment_mod is a security issue... mainly it allows uploading of files to your server!
It's really how much you trust your users not to upload bad stuff on there.
I'll try and let you know when its ready for release.
Really I can't give you any code off-hand. I can hardly decrypt some of the phpNuke code sometimes...
Basic pseudo-code
Code:
$contents = QUERY ON CONTENT#
$contents_array = split('[--pagebreak--]',$contents);
if ($page_number < count($contents_array))
DISPLAY($contents_array[$page_number]);
_________________ Evaders99 Webmaster Administrator Fighting is terrible, but not as terrible as losing the will to fight.
- SW:Rebellion Network - Evaders Squadron Coding -
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum