Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BB2Nuke
Author Message
kenspa
Hangin' Around



Joined: Sep 24, 2005
Posts: 48
Location: Spain

PostPosted: Sat May 20, 2017 6:24 pm Reply with quote

Hi
I implemented a printer button to viewtopic.php and used a script that I have for that function. It works fine, but it brings all the posts whereas I ONLY want the post I'm viewing to be printed.

Looked around the code and I think the loop is doing that, I could not find the way to modify:
php Code:
$postrow = $db->sql_fetchrowset($result);

$db->sql_freeresult($result);

// Loop through the posts
for($i = 0; $i < $total_posts; $i++)


I removed it and put:
Code:
$i = 0;

$i++;


Then the first row is returned

I really appreciate any hints.
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Sun May 21, 2017 4:28 am Reply with quote

Well done, you destroyed the whole loop and you created a bunch of php-errors. Change it back, please!
[ Only registered users can see links on this board! Get registered or login! ]

_________________
Github: RavenNuke 
View user's profile Send private message
kenspa







PostPosted: Sun May 21, 2017 1:05 pm Reply with quote

Many thanks neralex!! Embarassed

I already removed it and had to rewrite a new print_script (spent all day Shocked ) for that purpose, without any loops, just some precise calls to the right sql's in the right order, and bob's your uncle!!
Should anybody need it PM me Wink

Thanks again for your quick reply Cheers
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> BB2Nuke

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©