How to SELECT * FROM `lxn_menu` WHERE `span_class` = '2017' ???

I think that I can do that by query_single_row and normal SQL but I I'd to do this in recommended way - PersistentObject. Can I have some advices or even better - examples ???

Best Regards - Jerzy


  • fretzl Administrator
    What are you trying to do exactly?
  • I'd like to write SQL query to loop all menu links with specific class tag for example '2017' (from lxn_menu table). I need it to build function based on cookies to dynamicly display or hide visited album inside menu links
  • acrylian Administrator
    You actually never use the persistenObject class directly. You use the child classes for the actual objects (search the user guide on "object model" and the functions documentation on our site) like albums, images etc. Avoid direct sql queries as much as possible as you are in danger to bypass the rights management. Well you can combine queries with the object model - as the object model does that internally naturally but better avoid this before being familiar.

    The menu_manager plugin provides functions to get the menu items of an menuset. So better us that in combination with the object classes. Sorry, I can't answer more as I fear I don't fully understand what you are trying to do and why ;-)
  • Ok, so I'll try to explain the idea. On my site are old, new and updated albums. These new and updated albums have a red and NEW label on the menu. But not for all viewers because for those who have previously visited these new albums, these albums are old, and for the rest are still new :-) So I have an idea to write a script that checks in the cookies who see if the new page was already seen and if not then it loads in the cookie info about new and updated albums. It would be best to build a menu with the label NEW or without, but I do not think I can handle that and then write a sql script and perhaps jquery. I am very happy with your help and I am very grateful for her, but despite being able to handle php and js and working with WP and Joomla, unfortunately I am not a professional programmer and to understand PersistentObject I am too stupid :-)

    Although now as I look at this description I am no longer sure that I can do it all, but although I wanted to try it!

    Thanks a lot!
  • acrylian Administrator
    You will have in any case some work to do as you basically have to modify the whole menu_manager plugin (either a custom version or extra functions using it).

    To lower you work to do you could also look at the image_album_statistics plugin and its functions. Maybe that fits better as it can list new and updated albums.

    Additionally there is a flag_thumbnail plugin that can flag album thumbs as new as well. Maybe that is also a way to mark new/update albums. Might require some custom work as well.

    Hope that helps a bit.
  • OK, thanks for the ideas, I'll be thinking about it, whatever it is - I'll let you know!
  • acrylian Administrator
    Glad if it helps. There are always several ways to achieve things. And don't forget to later submit your site to the showcase gallery if you like as it looks like a good custom theme example.
  • Ok, so it's done :-)
    First I wrote my own new menu manager but it wasn't so good so I drooped it. After time I just modified orginal menu manager and now it,s works! Almost works because in this moment is able only for albums, but is very simple to write it also for other, I will do it future when I have more time.
    My solution is that:
    menu manager adds into every link in menu unique id of album, news, page etc
    on every entrance on every album, php write in cookies current date&time
    next entrance php reads cookies with previous date , check updated albums and write into cookies list updated albums and also current date & time. Php also counts number updated albums and display info near logo
    Jquery reads cookies and change color on red for updated album in menu
    and thats all :-)
    to inform visitors about new or updated albums is enougth to change updated date album on current time
    time limit for news announce is one year, more time I think is no sense..
    for watch and testing everybody can change in cookie "news" date for the past. For future cookie will be compressed and disabled for edit ..
    So Thank You for help!

Sign In or Register to comment.