+ Reply to Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Trying to add the following php script...

  1. #21
    Hello Brian,

    You created an array with image name and url but then you scan the directory with images.
    Do you want to show random flag?
    You can randomize it without scanning the directory. Also please read my comments in the code. You created smarty condition in php file!
    Use my file!
    Attached Files Attached Files
    Viktor,
    Flynax technical department,
    Best wishes.

  2. #22
    Quote Originally Posted by Viktor View Post
    Hello Brian,

    You created an array with image name and url but then you scan the directory with images.
    Do you want to show random flag?
    You can randomize it without scanning the directory. Also please read my comments in the code. You created smarty condition in php file!
    Use my file!
    VIktor,

    You changed the code incorrectly. I did not want to randomize on every refresh, as your modification does, (although I can get the original code in this thread) I just wanted to resolve the issue where the php code would not get removed from the header when I goto other pages, like about or contact page for example, also when I change the location the flag code in the header would get removed...I worked late last night, so I am just getting started, I will check your previous post then post to see if that is working...

    Thank you
    Brian

  3. #23
    Viktor,

    I updated the condition per your message, but still I am not getting my php code to display on pages outside of the home or add-listing pages...When I go to the login page, as an example the url becomes this:

    localhost/flynax/login/flags/ee.png
    Here's the the abbreviated version of my common.inc.php page. I just put part of the $links
    array

    PHP Code:
    Only registered members can view the code
    Brian
    Last edited by Brian Jester; May 2, 2018 at 04:54 PM.

  4. #24
    Quote Originally Posted by Viktor View Post
    Hello Brian,

    You created an array with image name and url but then you scan the directory with images.
    Do you want to show random flag?
    You can randomize it without scanning the directory. Also please read my comments in the code. You created smarty condition in php file!
    Use my file!
    Regarding your message, I want to show a random image, but I wanted it to display a different flag based on a 24 hour interval, such as at 12 mid-night every day. Not sure if your message means the same as what I am asking, as I had a lot of complications getting the code done correctly from another website...I have had someone else do the coding for the flag code I posted here, just to make it clear that I didn't do any of the php coding on my own. If it helps to display the flag randomly, in the sense that it changes on every refresh, I can live with that, as long as the php flag code will work on all pages of the website.

    Brian
    Last edited by Brian Jester; May 2, 2018 at 06:58 PM.

  5. #25
    Hello Brian,

    Yes, I understand now what you need.
    I think your code is correct, Would you please explain to me what is wrong for now?
    Viktor,
    Flynax technical department,
    Best wishes.

  6. #26
    Quote Originally Posted by Viktor View Post
    Hello Brian,

    Yes, I understand now what you need.
    I think your code is correct, Would you please explain to me what is wrong for now?
    Hello Viktor,

    I am going to test it again, as I upgraded my linux to 18.04...Sorry for the late reply. I am going to restore my header, and check it again, maybe it will work this time. I will post back in a little while.

    Brian

  7. #27
    Hello Viktor,

    Following your post #21, I have replaced my common.inc.php file with yours, and although it does display the image (flag) on the home and add-listing pages, when I added the login page to the condition it didn't display the image or the alt text in the header for the flag. Do you have another idea to make this work? Edit: Also, my other 'admin created' pages, (from admin panel -> content -> pages) or the location pages (http://localhost/flynax/united-states/) the flag doesn't show when I click on to those pages as well.

    I changed the smarty condition to the following:
    Code:
    Only registered members can view the code.
    The page to the login is a path like:
    Code:
    Only registered members can view the code.
    Thanks again!
    Brian
    Last edited by Brian Jester; May 3, 2018 at 10:29 PM. Reason: Other pages that the flags doesn't display on...

  8. #28
    Hello Brian,

    If you want to see the flag on 3 pages only you can use your condition but exist 2 errors. Take following condition:

    PHP Code:
    Only registered members can view the code
    Viktor,
    Flynax technical department,
    Best wishes.

  9. #29
    [QUOTE=Viktor;22770]Hello Brian,

    If you want to see the flag on 3 pages only you can use your condition but exist 2 errors. Take following condition:

    PHP Code:
    Only registered members can view the code
    /QUOTE]

    Hello Viktor,

    That code still doesn't make it work on three pages, only works on the home page and add-listing page. As I mentioned I would like it to work site wide, meaning all page and location pages.

    Edit: It still is not working, but I did find a partial solution, when I access http://localhost/flynax/login.html (after logging into the website, the flag shows, but if the url is just http://localhost/flynax/login/ it does NOT work, any suggestions to fix that?

    It still does NOT work on the location pages, and I have to check again with the contact page and other pages.

    Edit: On the login page, the site defaults to: http://localhost/flynax/login/ (Flag does NOT work at that url) when I add the login.html to the condition, it works sometimes, I cleared the tmp files, still not correct.

    Brian
    Last edited by Brian Jester; May 4, 2018 at 05:59 AM.

  10. #30
    Hello Brian,

    Please write:

    PHP Code:
    Only registered members can view the code
    and check what a key will be on the login page and add this key to the condition.
    Viktor,
    Flynax technical department,
    Best wishes.

+ Reply to Thread