a simple problem (38 posts)

  1. TonyWright
    Posted 10 years ago #

    i'm trying to add the 'better image rotator' from


    on to http://www.rapnews.co.uk

    as you can see, the command in my sidemenu is showing as code, and not the image.

  2. TonyWright
    Posted 10 years ago #

    does anyone have any suggestions? im going mad trying to get this to work.

    it should be a simple task.

    the instructions say to add a line at the top of the sidebar file which i do, and then another line where i want the banner to display.

    but the code is displayed at the top of my sidebar and a little further down. not the actual banner.

  3. First thing - patience. By replying to your own message, you've knocked it off the list of psots with no answers that some people monitor, which reduces your chance of getting a reply...

    Second - post the content of your sidebar.php (with the code you've added) at http://paste.uni.cc/ (or another pastebin) and post the link back here. This will (hopefully) enable someone to see what's going wrong.

  4. TonyWright
    Posted 10 years ago #

    the paste can be seen here:


    the site is http://www.rapnews.co.uk but ive taken out the code that isn't working so things dont look ugly for visitors in the meantime.

  5. I can see what's happened.

    Where you have & lt ; (without the spaces) you should have < on line 1 and line 69. I guess you copied exactly what was shown on the webpage? I think that got mangled in copying and pasting, and nobody's fixed it.

  6. TonyWright
    Posted 10 years ago #

    so simply add an < at the front of line 1 and 69?

    ok thanks ill try it.

  7. TonyWright
    Posted 10 years ago #

    im afraid this didn't help.

  8. TonyWright
    Posted 10 years ago #


  9. Did you replace the incorrect letters?

    Line 1: <?php include('rotator.php'); ?>

    Line 69: <?php showImage(); ?>

  10. TonyWright
    Posted 10 years ago #

    thanks. im now using that code.

    but it pushes all of the links on my sidemenu right down to the bottom of the page, and displays the error:

    Fatal error: Call to undefined function: showimage() in /home/hiphopne/public_html/wp-content/themes/default/sidebar.php on line 68

  11. Presumably "showimage()" is a function in rotator.php?

    You might need to put the path to where you've saved rotator.php in line 1, so that it can be found.

    The path will be something like this:

    <?php include('/home/hiphopne/public_html/rotator.php');>

    (that's if it's in your root folder - if it's in wp-content, for instance, you'll need to add that to the path)

  12. TonyWright
    Posted 10 years ago #

    I expanded the location of the rotator.php it's in the same folder as the sidebar anyway though.

    now getting the error:

    Parse error: parse error, unexpected '>' in /home/hiphopne/public_html/wp-content/themes/default/sidebar.php on line 1

    i tried deleted the last > and it said the error was on line 3

  13. Can you put the current contents of sidebar.php into the pastebin again, and post the new link here?

  14. TonyWright
    Posted 10 years ago #

    Hi. The pastebin of sidebar.php is at http://paste.uni.cc/7884

    this doesn't contain any of the code ive been trying to get to work.

  15. Umm, we do need to see what you're trying to make work...

  16. TonyWright
    Posted 10 years ago #

    well you're aware of the two lines which i've been putting in to get the rotator to work. you've been telling me various varities of these two lines. but none of them work.

    the installation instructions says:

    <?php include('rotator.php'); ?>

    <?php showImage(); ?>

    the first line is meant to go at the top of the whole php.
    the second is meant to go wherever i want the image to appear.

  17. If those lines are inserted as described, then it should be working.

    Messages about "unexpected >" imply a typo either in what you've added, or in the file you're including. Unless we can see the file in the state that caused the error message, it's very difficult to advise you what to do.

  18. TonyWright
    Posted 10 years ago #

    pasted sidebar.php with crappy coding included:


    thank you very much.

  19. Hmmm. Both lines 1 and 69 look fine. If you're still getting the "unexpected '>'" error with that, then there may be something broken in the copy of rotator.php that you've downloaded.

    Unless anyone else has any ideas?

  20. TonyWright
    Posted 10 years ago #

    i dont think anyone wants to help me :-(

    here's the pastebin of the rotator.php


    for some reason it's one continous line.

    thank you for your continued patience and help. much appreciated.

  21. TonyWright
    Posted 10 years ago #


    It seems that you were right. There was a problem with the rotator.php being a continous one line.

    I pasted the script into textpad and straightened that up properly.

    Now I'm getting a different error at the bottom of the sidemenu at http://www.rapnews.co.uk

    It says:

    Unable to read ini file.

    Do I need to install a plugin that lets ini's be read, like I had to install a plugin to enable php within pages?

  22. jaseone
    Posted 10 years ago #

    Try replacing rotator.php with this sanitized version:


  23. jaseone
    Posted 10 years ago #

    d'oh... wasted time reformatting that myself...

    Where is your ini file located? It should be in the same directory as rotator.php

  24. TonyWright
    Posted 10 years ago #

    my ini file is located correctly, in the same place as the rotator and sidebar php's.

    not only did the error 'unable to read ini file' appear, but the footer of my page disappeared.

    using you gratefully received sanitized version, the 'unable to read' error appeared in the sidebar, whilst the page footer disappeared along with my 'random quote' script and a category which was being displayed.

    starting to think i should give up trying to set this up for sponsors and just close my website down!


  25. jaseone
    Posted 10 years ago #

    Sounds like the user that PHP runs as doesn't have access to read the ini file so in your FTP program or your cPanel's file manager try changing the permissions (commonly referred to as CHMOD) to 766.

  26. TonyWright
    Posted 10 years ago #

    im the top user. i have full power to do everything. but just for the sake of things, how can i double check this?

  27. TonyWright
    Posted 10 years ago #

    i changed the permissions of the sidebar php, image.ini and rotator php files to 766, but i still get the 'unable to read ini file' error. i've even changed the whole public folder to 766 and i get the same error.

    do i change all the permissions back? is this a security risk?


  28. jaseone
    Posted 10 years ago #

    Try setting:

    $IMG_CONFIG_FILE = 'home/hiphopne/public_html/images.ini';

    (editing the path appropriately for where the ini file is.

    chmod'ng everything like that wasn't really a good idea but there is no simple way to set everything back to what they were but anything that needs to be writable will cause errors now as those directories/files need to be 777.

  29. TonyWright
    Posted 10 years ago #

    I'm afraid adding that line didn't work. It simply appeared as text on the sidebar. I was putting it where I was previously placing:

    <?php showImage(); ?>

  30. jaseone
    Posted 10 years ago #

    Sorry I meant try editing rotator.php and replace the current line that sets $IMG_CONFIG_FILE with something similar to what I quoted above with the full path to the file.

Topic Closed

This topic has been closed to new replies.

About this Topic