*

BabyDunk

  • ****
  • 161 posts
[Help] pagination on public profile
« on: July 08, 2016, 07:12:16 PM »
Hello Frosticek

i have pagination on the public profile but i want to hide links and text if the items displayed is less than 10.

this doesnt work but am i going in the right direction? is their anything you could point out for me?
Code: [Select]
   <div class="propag">
         <?php if( osc_count_items() > 10) { ?>
          <label for="profileitems"><span><?php _e('Check out more from this seller''patricia') ; ?></span></label>
         <?php echo osc_pagination_items(); ?>
          <?php } else if ( osc_item_count() < 10 )  { ?>
          <?php _e('''patricia'); } ?>
        </div>
      <?php } else { ?>
        <div class="empty"><?php _e('No listings posted by this seller''patricia'); ?></div>
      <?php ?>
    </div>
  </div>


Thanks in Advance
Chris
« Last Edit: July 09, 2016, 02:16:17 AM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: pagination on public profile
« Reply #1 on: July 08, 2016, 09:22:52 PM »
@BabyDunk
Where are you trying to place this?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: pagination on public profile
« Reply #2 on: July 09, 2016, 01:34:34 AM »
Hi Frosticek

this is for user-public-profile.php, i have pagination working but im just having trouble hiding the pagination list and text when the listing count is 10 or less


i know that last line i added just isnt right but not sure what it needs to be.

Code: [Select]
   <?php _e('''patricia'); } ?>

do i need to loop back to the start before the pagination code?

Cheers for the time
Chris
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: [Help] pagination on public profile
« Reply #3 on: July 10, 2016, 03:53:20 PM »
@BabyDunk
You may try to use
Code: [Select]
osc_reset_items();
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: [Help] pagination on public profile
« Reply #4 on: July 15, 2016, 06:17:43 PM »
That is pagination hidden when items displayed are less than 10. thanks for the pointer @Frosticek. i also misspelt the item count function for the else control flow.

i nearly have it just right. i think or maybe i am over thinking it. but if im correct, the elseif control flow will only hide the pagination if count is 9 or less. and i dont know how to write the if control flow to look forward to the other pages to see if their are any extra items to count.

Am i think correctly

Code: [Select]
           
<div class="propag">
         <?php if( osc_count_items() >= 10) { ?>
          <label for="profileitems"><span><?php _e('Check out more from this seller''patricia') ; ?></span></label>
         <?php echo osc_pagination_items(); ?>
          <?php } elseif ( osc_count_items() < 10 )  { ?>
          <?php osc_reset_items(); } ?>
        </div>



Thanks again
Chris
« Last Edit: July 15, 2016, 10:43:57 PM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

MB Themes

Re: [Help] pagination on public profile
« Reply #5 on: July 15, 2016, 08:16:46 PM »
@BabyDunk
There is no need to use elseif, you can just place else here.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BabyDunk

  • ****
  • 161 posts
Re: [Help] pagination on public profile
« Reply #6 on: July 15, 2016, 10:38:56 PM »
Hi Frosticek

i get an error if i use
Code: [Select]
else but with
Code: [Select]
if or
Code: [Select]
elseif i dont get errors and all works fine.


Chris
« Last Edit: July 15, 2016, 10:43:27 PM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

BabyDunk

  • ****
  • 161 posts
Re: [Help] pagination on public profile
« Reply #7 on: July 15, 2016, 10:49:49 PM »
aaah i get it now  :D

i am abit slow but i get their in the end haha

i also changed the class  to keep the theme style :D
Code: [Select]
      <div class="paginate">
         <?php if( osc_count_items() >= 10) { ?>
         <?php echo osc_pagination_items(); ?>
          <?php } else { ?>
          <?php osc_reset_items(); } ?>
        </div>


Cheers Frosticek
« Last Edit: July 16, 2016, 12:28:11 AM by BabyDunk »
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D

*

BabyDunk

  • ****
  • 161 posts
Re: [Help] pagination on public profile
« Reply #8 on: July 21, 2016, 11:52:34 PM »
everything i was trying in this post was in vain.
i did indeed get the pagination to hide when their was less that 10 items but this would then hide pagination on the next page. which for me would just confuse.

this is the best option for me at the moment.
Code: [Select]
      <div class="paginate">
         <?php echo osc_pagination_items(); ?>
        </div>

cheers ;)
I Am A Noob But I Am Here To Learn.
Please be patient ;) ;D