Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
i want to add a page nav on a custom side but it doesent work


i get the settings ($asettings) from $fil_settings = get_settings("figurelib"); and the settings DB table where i have "figure_per_page"

this is my table


$inf_newtable[] = DB_FIGURE_USERFIGURES." (
figure_userfigures_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
figure_userfigures_figure_id varchar(100) NOT NULL DEFAULT '',
figure_userfigures_user_id varchar(100) NOT NULL DEFAULT '',
figure_userfigures_sorting varchar(50) NOT NULL DEFAULT '',
figure_userfigures_language VARCHAR(50) NOT NULL DEFAULT '".LANGUAGE."',
PRIMARY KEY (figure_userfigures_id)

my code
    $fil_settings = get_settings("figurelib");
      $max_rows = dbcount("(figure_userfigures_id)", DB_FIGURE_USERFIGURES, "figure_userfigures_user_id='".$userdata['user_id']."'");   

      $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_rows ? $_GET['rowstart'] : 0;
      if ($max_rows != 0) {
         $result = dbquery("SELECT * FROM ".DB_FIGURE_USERFIGURES." WHERE figure_userfigures_user_id='".$userdata['user_id']." LIMIT ".$_GET['rowstart'].",".$asettings['figure_per_page']);
         echo $result;
         $numrows = dbrows($result);
         $info['figure_rows'] = $numrows;
         $info['page_nav'] = $max_rows > $asettings['figure_per_page'] ? makepagenav($_GET['rowstart'], $asettings['figure_per_page'], $max_rows, 3, INFUSIONS."figurelib/mycollection.php?&amp;") : 0;
         echo $info['page_nav'] ? "<div class='text-right'>".$info['page_nav']."</div>" : '';
Catzenjaeger attached the following file:
111_1.jpg [40.44kB / 50 Downloads]

6 replies

This code is working.. and in your screenshot there is a page nav. I don't understand the problem.

  $info['page_nav'] = $max_rows > $asettings['figure_per_page'] ? makepagenav($_GET['rowstart'], $asettings['figure_per_page'], $max_rows, 3, INFUSIONS."figurelib/mycollection.php?&amp;") : "";

Have you printed out your output?

print_p("Max rows found - $max_rows ");
print_p("Item per page ".$asettings['figure_per_page']);

Always try to debug as it answers about 99% of the question.
Catzenjaeger attached the following file:
wee.jpg [29.95kB / 40 Downloads]
Just took a glanse at it, and I see $asettings['figure_per_page'] should it not be $fil_settings ?. it is defined on top
$fil_settings = get_settings("figurelib"); so correct setting is not called and the pagenav won´t work
Unfortunately, this is not the solution.

i have declard it global
both versions works:

echo $asettings['figure_per_page']; --> show 1
echo $fil_settings['figure_per_page']; --> show 1

In other words, variable and values are all available. I think the code is wrong
Check the codes, compare and test. There are plenty of working examples in the 9 Infusions included.
That how it works, even if we make a new function or come up with new methods and so forth, we often need to go back and check, like how on earth did I do that now again. That is what dev often is about. ( check - cross refer, re-mind your self how you thought in the first place.) :)
is it possible that I have misplaced it?
fogive me .. i have check all infusions but everywhere is different .. i see no schematic :)

I have the very bottom of the script (see GitHub). Does this have not up in and then in between the normal code? I would indeed provide only the content of a code between openside and closside with a page nav

i sit since hours on it :( damn




SQL query for my list of all figures
show all figures
here pagenav?

author Catzenjaeger
forumCode Snippet and functions - 8
replies7 posts
viewed1,336 times
activeLast updated on 3 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, Catzenjaeger, Chan