Page 1 of 1

Pagination or Counter of Entries?

Posted: 04 Mar 2009, 20:39
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

Re: Pagination or Counter of Entries?

Posted: 08 Mar 2009, 12:42
by Jan
Hi, sorry I don't understand, there is pagination, see:
https://www.phoca.cz/demo/phoca-guestbook-demo

Jan

Re: Pagination or Counter of Entries?

Posted: 11 Mar 2009, 16:23
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

Re: Pagination or Counter of Entries?

Posted: 11 Mar 2009, 23:31
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

Re: Pagination or Counter of Entries?

Posted: 12 Mar 2009, 10:11
by Hessi
Hi Jan,

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

TIA
Michael

Re: Pagination or Counter of Entries?

Posted: 12 Mar 2009, 19:50
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

Re: Pagination or Counter of Entries?

Posted: 14 Mar 2009, 20:00
by Jan
see Parameter Basic in Parameters Component - Pagination, Display Select...

Jan

Re: Pagination or Counter of Entries?

Posted: 18 Mar 2009, 00:15
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

Re: Pagination or Counter of Entries?

Posted: 19 Mar 2009, 13:00
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

Re: Pagination or Counter of Entries?

Posted: 19 Mar 2009, 14:58
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.