hi!
i would like to know if anyone here knows how to use the new way that phpbb uses for the generate_pagination and if you could give me an example... cause i noticed that its done differently from phpbb2
Using phpbbs generate_pagination
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Re: Using phpbbs generate_pagination
Did you see it in functions.php?
and a sample from viewtopic.php
Code: Select all
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
Code: Select all
$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start);
Re: Using phpbbs generate_pagination
I don't think it's changed much at all.
Re: Using phpbbs generate_pagination
sorry if i didn't explain well want i wanted... i didn't mean the function, i meant the whole thing, the sql query and all that... but i already found it, i just didn't wanna go over the code
to use it you would have to make your query then use $db->sql_query_limit and then the generate pagination is just for the links...
to use it you would have to make your query then use $db->sql_query_limit and then the generate pagination is just for the links...
Re: Using phpbbs generate_pagination
Why not work this code?
code:
output:
where "?" ? I don't have any other parameter.
everything is OK. I write manual of test $config['test_per_page'] = 2;
append_sid is not have 2. parameter. if I write 2. parameter is work, but my page don't have any other parameter.
Work: (output: test.php?u=2&start=2)
Not work: (output: test.php&start=2) not have ?
Referance:
code:
Code: Select all
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}test.$phpEx"), $total_bans, $config['test_per_page'], $start),
Code: Select all
test.php&start=2
everything is OK. I write manual of test $config['test_per_page'] = 2;
append_sid is not have 2. parameter. if I write 2. parameter is work, but my page don't have any other parameter.
Work: (output: test.php?u=2&start=2)
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}test.$phpEx", "u=2"), $total_tests, $config['test_per_page'], $start),
Not work: (output: test.php&start=2) not have ?
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}test.$phpEx"), $total_tests, $config['test_per_page'], $start),
Referance:
Code: Select all
/**
* Append session id to url
*
* @param string $url The url the session id needs to be appended to (can have params)
* @param mixed $params String or array of additional url parameters
* @param bool $is_amp Is url using & (true) or & (false)
* @param string $session_id Possibility to use a custom session id instead of the global one
*
* Examples:
* <code>
* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&f=2");
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2');
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false);
* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2));
* </code>
*/
Code: Select all
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
phpBB3 Portal | simple portal for phpBB3 Olympus
phpBB3 Project | phpBB3 mods, add-ons, themes, graphics
phpBB Türkiye | Turkish phpBB community
Re: Using phpbbs generate_pagination
anything for me ?
phpBB3 Portal | simple portal for phpBB3 Olympus
phpBB3 Project | phpBB3 mods, add-ons, themes, graphics
phpBB Türkiye | Turkish phpBB community
Re: Using phpbbs generate_pagination
Try changing test.php&start=2 to test.php?start=2
- Handyman
- Registered User
- Posts: 522
- Joined: Thu Feb 03, 2005 5:09 am
- Location: Where no man has gone before!
- Contact:
Re: Using phpbbs generate_pagination
Rizzn. wrote: Try changing test.php&start=2 to test.php?start=2
The test.php&start=2 is the output.
It's in the code somewhere, but I don't see it either… it looks like it's supposed to.
The append_sid should automatically decide where to put the question mark... so I've looked at that a few times and I still don't get it.
If it were me, I would rewrite something very simple that works, then gradually add stuff to it until you have what you need or it doesn't work… then you should be able to find what needs to be fixed.
My phpBB3 Mods || My Mod Queue
Search Engine Friendly (SEO) URLs || Profile link on Avatar and/or Username || AJAX Chat
Display Posts Anywhere || CashMod || AJAX Quick Edit || AJAX Quick Reply
Search Engine Friendly (SEO) URLs || Profile link on Avatar and/or Username || AJAX Chat
Display Posts Anywhere || CashMod || AJAX Quick Edit || AJAX Quick Reply
Re: Using phpbbs generate_pagination
If you do not append variables, you *must* add a question mark.