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.
Not a member yet? Click here to register.
Forgot Password?

page nav

Asked Modified Viewed 2,230 times
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
asked
Senior Member

i want to add a page nav on a custom side but it doesent work

www.php-fusion.co.uk/infusions/forum/attachments/111_1.jpg


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

Quote

$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)
) ENGINE=MyISAM DEFAULT CHARSET=UTF8 COLLATE=utf8_unicode_ci";


my code
//nav
    $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 [No information available / 117 Downloads]
0 replies

6 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

Hi thanx for your response.
i have set in my figurelib settings "1" figure per page but it shows me all.
yes i have print my output :
www.php-fusion.co.uk/infusions/forum/attachments/wee.jpg

i guess someone is wrong

the complete file is here: https://github.com/Catzenjaeger/Figur...ection.php
Edited by Catzenjaeger on 08-07-2016 14:14,
Catzenjaeger attached the following file:
wee.jpg [No information available / 111 Downloads]
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

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
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

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
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

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.) :)
0 replies
C
Catzenjaeger
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
answered
Senior Member

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

example:

Quote


openside();

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

closeside();
Edited by Catzenjaeger on 09-07-2016 18:41,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
  • Senior Member, joined since
  • Contributed 408 posts on the community forums.
  • Started 137 threads in the forums
  • Started this discussions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet