Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #16  
Old 20 May 2012, 13:03
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by snoopytas View Post
The render uses 'eval' 'nuff said

Kym
OK, but I ran this modified version of the benchmark:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


and I got these results:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


vs. these for the original version:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


That's 6.5 times slower vs 134 times slower, and seems to indicate that eval() isn't the main offender.
Reply With Quote
  #17  
Old 20 May 2012, 13:12
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
It's basically the overhead required for variable registration and object creation that makes rending templates in a loop pretty slow.
Reply With Quote
  #18  
Old 20 May 2012, 13:41
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Yeah, I played around more and found that my times dropped from 1.5 to 0.7 just by not calling register_globals().
Reply With Quote
  #19  
Old 20 May 2012, 14:41
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by Andreas View Post
If it is a "static" link - yes, it should be added to the navigation table upon Add-on installation.
(Which will happen automatically if you have already added that link on your developement system, assigned in to the Add-on and exported the XML).
But if it's not a static link? I'm supposed to tell user's to do it themselves now because vBulletin thinks they want more control over their navbar? Respectfully, most user's do not want total control, they want things done for them.

I've come up with this code, it's not efficient but it works, I will work on efficiency-

nhawk I know you mentioned making a database change but I prefer to avoid db edits if possible.

This example adds a link to Quick Links
No phrase needed.

On navigation_tab_complete hook:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Mind you that needs to be run for each new link which itself will likely be some kind of loop.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #20  
Old 20 May 2012, 15:06
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Originally Posted by BirdOPrey5 View Post
But if it's not a static link?
That is a problem

I do not know the exact ideas behind Navigation Manager , but I think it simply wasn't designed with dynamic links in mind as vBulletin itself (except vBulletin CMS) does not do that.

As I see it, there are currently three alternatives (of which none is realldy ideal):
  • Programatically create/update/delete links in navigation manager based on the Add-on data
    Pro: Full control over the links
    Con: Rather complicated management for the Add-on, might requires extensive changes to the logic
  • Don't create any links and leave it up to the user
  • Pro: Full control, no additional work the for Add-on author
    Con: A lot of work for the Administrator
  • Create links at runtime
    Pro: Fairly easy to do
    Con: Zero control over placement in Navigation Manager, code can be a little bit inefficient

IMHO the best solution would be if the Navigation Manager would offer "Dynamic Content" items which would just act as placeholders in ACP and are only being filled with content on the frontend when needed.
This would be easy to implement and maintain for Add-ons and would still give the Administrator the power to control placement, etc.

http://tracker.vbulletin.com/browse/VBIV-15123
Reply With Quote
  #21  
Old 20 May 2012, 16:19
nhawk nhawk is offline
 
Join Date: Jan 2011
Originally Posted by BirdOPrey5 View Post
But if it's not a static link? I'm supposed to tell user's to do it themselves now because vBulletin thinks they want more control over their navbar? Respectfully, most user's do not want total control, they want things done for them.

I've come up with this code, it's not efficient but it works, I will work on efficiency-

nhawk I know you mentioned making a database change but I prefer to avoid db edits if possible.

This example adds a link to Quick Links
No phrase needed.

On navigation_tab_complete hook:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Mind you that needs to be run for each new link which itself will likely be some kind of loop.
I thought of doing it that way, an actually had it done that way. But then there's no control by the admin as to where it goes (as pointed out by Andreas) and I changed to the DB write.

The advantage of doing it in the DB is the admin can move it around to any menu once it's created. After working with it a bit, I found management really isn't difficult. It's only a couple of DB writes at application type creation (in my mod) and then I'm done with it. No need to parse out a special template or anything else in vB 4.2.

And the nice thing is that when the product is uninstalled, the navigation and phrase info gets deleted like it should.

Last edited by nhawk; 20 May 2012 at 16:29.
Reply With Quote
  #22  
Old 20 May 2012, 16:56
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
The advantage of doing it in the DB is the admin can move it around to any menu once it's created. After working with it a bit, I found management really isn't difficult. It's only a couple of DB writes at application type creation (in my mod) and then I'm done with it. No need to parse out a special template or anything else in vB 4.2.

And the nice thing is that when the product is uninstalled, the navigation and phrase info gets deleted like it should.
Keep in mind that links created this way will be deleted when your Add-on is upgraded:
http://tracker.vbulletin.com/browse/VBIV-14959

To avoid this you would have to do some trickery in your installation code.

If anyone feels that this issue is important, please vote for it
Reply With Quote
  #23  
Old 20 May 2012, 20:13
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Originally Posted by Andreas View Post
Keep in mind that links created this way will be deleted when your Add-on is upgraded:
http://tracker.vbulletin.com/browse/VBIV-14959

To avoid this you would have to do some trickery in your installation code.

If anyone feels that this issue is important, please vote for it
Voted... But I do think it's working logically now, consistent with plugins and templates. Seems like nav elements should have a special setting though.
__________________
-Joe
Former vBulletin.org Staff Member

(@BirdOPrey5) Former vb.org Moderator. Fighting for a free & independent vb.org.
BirdOPrey5.com - Exclusive VB Mods! (Formerly Qapla.com) | Joe's Ultimate Off Topic
Note - I do not read my PMs often, do not expect quick replies.
Reply With Quote
  #24  
Old 20 May 2012, 22:03
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Consistent with Plug-ins, yes - but not consistent with how it worked in previous vBulletin versions:

In previous versions Add-ons usually added their links into the Navbar by rendering their own templates on a certain template Hook.

If the Administrator modified those templates (eg. if he added another link), an upgrade of the Add-on would not overwrite this modification - the link would still be there after an upgrade.

Most items (Settings, Cron-Jobs, FAQ, Admin-Help, etc.) do have a volatile flag to handle "custom items" on upgrades, and this is what is missing here.
Reply With Quote
  #25  
Old 20 May 2012, 22:05
Badshah93's Avatar
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Real name: Aayush Agrawal
Originally Posted by BirdOPrey5 View Post
But if it's not a static link? I'm supposed to tell user's to do it themselves now because vBulletin thinks they want more control over their navbar? Respectfully, most user's do not want total control, they want things done for them.

I've come up with this code, it's not efficient but it works, I will work on efficiency-

nhawk I know you mentioned making a database change but I prefer to avoid db edits if possible.

This example adds a link to Quick Links
No phrase needed.

On navigation_tab_complete hook:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Mind you that needs to be run for each new link which itself will likely be some kind of loop.
does 'name' key exist in tabdata[children] array, because when i print_r the tabdata array i did not find a word called "name" anywhere.

Well i liked vb 4.2.0 navigation manager and specially for my new mod. Yes i still have to create one plugin which i was doing in earlier version also but i won't have to create new template for it to use vb:each function.

i am creating a new mod which has one tab and under which there are 5 menu by default. (which i will create it through navigation manager)
there are 3 menu who's links are not fixed, it changes for each usergroup, so i will be creating array of links for those menus which i was for doing in earlier version also.

i don't know how others are going to place their dynamic links inside menu, but i will be doing this way

Plugin Hook: set_navigation_tab_main

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Benefits of this method:

1) admin can add new menu inside "mytabname" easily through navigation manager
2) admin can add new links inside any menu. (even those menu which have dynamic links)
3) admin can change displayorder, title of any menu.
4) admin can change title of any links through navigation. (for dynamic links through phrase manager)
5) it hardly effects overall performance. (.1 extra second)
Reply With Quote
  #26  
Old 21 May 2012, 12:07
nhawk nhawk is offline
 
Join Date: Jan 2011
Originally Posted by Andreas View Post
Keep in mind that links created this way will be deleted when your Add-on is upgraded:
http://tracker.vbulletin.com/browse/VBIV-14959

To avoid this you would have to do some trickery in your installation code.

If anyone feels that this issue is important, please vote for it
Voted.

But a workaround for that is to create another product that only contains navigation items. Then the navigation items don't get overwritten if the main product is updated.
Reply With Quote
  #27  
Old 21 May 2012, 12:29
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Yep, that would work but doesn't seem that user friendly

Another workaround would be to do some installation code trickery to add already existing items to the XML data.
Reply With Quote
  #28  
Old 21 May 2012, 13:05
nhawk nhawk is offline
 
Join Date: Jan 2011
Originally Posted by Andreas View Post
Yep, that would work but doesn't seem that user friendly

Another workaround would be to do some installation code trickery to add already existing items to the XML data.
I agree it's not that user friendly, but it seemed to be the most fool-proof way of doing it.

The funny thing is (if I'm reading that bug report right) if an admin adds 10 or 20 navigation tabs/menu selections to a stock vB installation using the vBulletin product as the parent, and then updates vB, all of those changes will be lost with the upgrade.

That's a bug to me! The admin will have to re-insert the changes he made each time he upgrades vB.

So that's not an improvement request.
Reply With Quote
  #29  
Old 23 May 2012, 07:52
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Real name: Rick-owner, Kym-admin
This is Paul M's blog on how to use the Navigation Manager

https://www.vbulletin.com/forum/entr...amp-Navigation

Kym
__________________
www.AusPhotography.net.au a.k.a. AP is a photography forum where members share their photography, photo editing skills and techniques. We run regular photographic competitions; Rick (site owner) and Kym (site tech) using this account
*** Home of the AP fully comprehensive vb4 photographic competition management solution ***
Reply With Quote
  #30  
Old 23 May 2012, 09:42
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
Originally Posted by nhawk View Post
The funny thing is (if I'm reading that bug report right) if an admin adds 10 or 20 navigation tabs/menu selections to a stock vB installation using the vBulletin product as the parent, and then updates vB, all of those changes will be lost with the upgrade.
They will not, the upgrade process does not remove any tabs/menus/links belonging to the core 'vbulletin' product.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
Reply

Similar Article
Article Author Type Replies Last Post
Administrative and Maintenance Tools Navigation Manager Enhancements Andreas vBulletin 4.x Add-ons 337 03 Jan 2018 15:58



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:45.

Layout Options | Width: Wide Color: