31, October 2014

Mypagina display bug? - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets
Topic: Mypagina display bug?
« previous next »
Pages: [1] Print

Author Topic: Mypagina display bug?  (Read 1489 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Dec 02, 2007, 03:30:55 pm »

Hi Olaf. thanks for sharing this class. I am new in DB and PHP and this class made my life easier.

I just download the recent version (yesterday I set ed up the one in PHPClasses) and found a problem. The records (as per example) wasn't displaying well. So I changed the funcion page_info as follows:

Code:
function page_info($str1) {
             $str = " %d - %d of %d";
$first_rec_no = ($this->set_page() * $this->rows_on_page) + 1;
$last_rec_no = $first_rec_no + $this->rows_on_page - 1;
$last_rec_no = ($last_rec_no > $this->get_total_rows()) ? $this->get_total_rows() : $last_rec_no;
$info = sprintf($str, $first_rec_no, $last_rec_no, $this->get_total_rows());
return $info;
}

You can see the "to" parameter was causing this internal string $str not working fine (unless I made some mistake somewhere else (most probably).
I changed the internal parameter name to str1 (in order to not modify anything else)
and add the $str as direct assignment inside the function.

Just to share this.

Regards,
Guest


Email
« Reply #1 on: Dec 02, 2007, 10:56:48 pm »

is this based on the latest version from my website?

I have this (working) function:

Code:
// this info will tell the visitor which number of records are shown on the current page
function page_info($str = "Result: %d - %d of %d") {
$first_rec_no = ($this->set_page() * $this->rows_on_page) + 1;
$last_rec_no = $first_rec_no + $this->rows_on_page - 1;
$last_rec_no = ($last_rec_no > $this->get_total_rows()) ? $this->get_total_rows() : $last_rec_no;
$info = sprintf($str, $first_rec_no, $last_rec_no, $this->get_total_rows());
return $info;
}

the code on phpclasses.org is not the current version
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Dec 02, 2007, 11:30:57 pm »

Olaf,
I took the code in your page and modified as posted.

The problem I guess is the call to the function  page_info("to");  didn't returns anything like Result: 1  - 5 of 25

More clear now?

Regards,
Guest


Email
« Reply #3 on: Dec 03, 2007, 06:06:34 am »

you need to use a string like "Result: %d - %d of %d"
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7411
Bookmark this thread : Digg Del.icio.us Dzone more....

Instabuck - The easy way to sell digital products online
Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets
Topic: Mypagina display bug?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct 31, 2014, 09:21:18 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2014 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.