Pagination or Counter of Entries?

Phoca Guestbook - creating guestbooks in Joomla! CMS
Hessi
Phoca Member
Phoca Member
Posts: 27
Joined: 04 Mar 2009, 20:23

Pagination or Counter of Entries?

Post by Hessi »

Hi Jan,

first I have to thank your for this very userful and outstanding guestbook. :)

I abused your component as a kind of "enrolled guest list".
Just have a look, please: http://www.homecon.net/index.php/anmeldung

Great, it does nearly everything I wanted.
It is possible to have a pagination for the entries?
Number one have to be the first entry.

Or a total counter? Like this:
"Total number of enrolled guests: 12"

I don't know very well php, therfore I have to ask. I guess it's only a matter of the phocabook-template, isn't it? :?

Thanks a lot! :wink:
Kind regards
Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48704
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Pagination or Counter of Entries?

Post by Jan »

Hi, sorry I don't understand, there is pagination, see:
https://www.phoca.cz/demo/phoca-guestbook-demo

Jan
If you find Phoca extensions useful, please support the project
Hessi
Phoca Member
Phoca Member
Posts: 27
Joined: 04 Mar 2009, 20:23

Re: Pagination or Counter of Entries?

Post by Hessi »

Hi Jan,

o.k., I have to attach a picture :)
Pleas have a look. I added a paginattion (per entry) in red.

Regards
Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48704
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Pagination or Counter of Entries?

Post by Jan »

Hi, if you mean the numbering then there is no numbering so it need to be customized... the id should be displayed next to head in the box.

Jan
If you find Phoca extensions useful, please support the project
Hessi
Phoca Member
Phoca Member
Posts: 27
Joined: 04 Mar 2009, 20:23

Re: Pagination or Counter of Entries?

Post by Hessi »

Hi Jan,

where can i find it?
.../models/phocaguestbook.php?

TIA
Michael
vfx
Phoca Member
Phoca Member
Posts: 21
Joined: 16 Oct 2008, 00:28

Re: Pagination or Counter of Entries?

Post by vfx »

how do you remove Page 1 of 2? or something like that? I looked into the com_content/category and tried to remove the pagination code. But that didn't work. Where should I look in the guestbook code?

Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48704
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Pagination or Counter of Entries?

Post by Jan »

see Parameter Basic in Parameters Component - Pagination, Display Select...

Jan
If you find Phoca extensions useful, please support the project
Hessi
Phoca Member
Phoca Member
Posts: 27
Joined: 04 Mar 2009, 20:23

Re: Pagination or Counter of Entries?

Post by Hessi »

Hi Jan,

can you tell me the name of the variable for the "#" (the number of the entry, see attachment) and where I can modify the template to display the number in the Frontend?

"#" Titel
Entry

=

1 Hessi
Ich komme gerne.

TIA
Michael
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48704
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Pagination or Counter of Entries?

Post by Jan »

there is no variable for # but object from database $object->id ... so e.g. in:
\components\com_phocagallery\views\category\tmpl\default.php it is $value->id

Jan
If you find Phoca extensions useful, please support the project
Hessi
Phoca Member
Phoca Member
Posts: 27
Joined: 04 Mar 2009, 20:23

Re: Pagination or Counter of Entries?

Post by Hessi »

Hi Jan,

"Phocagallery"? :wink:
Hmmm, in Phocaguestbook I guess it will be:
/components/com_phocaguestbook/views/phocaguestbook/view.html.php

I'd added an echo under:

Code: Select all

//Create new object, if user fill not all data, no redirection and he gets the data he added (he doesn't loss it)
...
//Title
if (isset($post['title']))		{$formdata->set('title', 
echo 'Placeholder for Numbering'
$post['title']);}
else						{$formdata->set('title', '');}
O.k., I have no idea for php for real, I used the method "trial and error".
In this case I'm unsure how the code realy works. :oops:
I hoped this area is for displaying the entry of the DB on screen, but it seems to be the generation of the values for the variables, isn't it?

Any idea, where I can add the variable for numbering?
Sorry for asking silly questions.

Kind Regards
Michael

P.S.: I've found a little "bug": a Date hasn't to be displayed with spaces in format dd.mmm.yyyy, therfore, I'd changed the entry in PARAMS:

Code: Select all

case 3:
			$tmpl['date_format'] =	'%d.%m.%Y';
			break;
It's only a little "optimation", unfortunately I'm not able to support pgb in a more usefully way.
Post Reply