• Ok, I’ve tried to add the most simple of scripts to my sidebar.php and it never works like I tried to add a simple counter with no database just an index1.php and stats.txt and CHMOD the stats to 777 and I added <php include index1.php thing to my sidebar.php and I got an error I’ve had the same troubles with a banner rotator on footer.php and header.php can some1 help this is the most common error I get:

    Warning: main(index1.php): failed to open stream: No such file or directory in /home/r3d/public_html/wp-content/themes/default/sidebar.php on line 67

    Warning: main(): Failed opening ‘index1.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/r3d/public_html/wp-content/themes/default/sidebar.php on line 67

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    This states that there is no index1.php file in the /wp-content/themes/default/ directory. Did you add the required index1.php file to the /wp-content/themes/default/ directory?

    Thread Starter r3d

    (@r3d)

    Ahh ok it was originally in a stats folder which i placed in the default theme directory i tried it again and got this one this time

    Warning: fopen(stats.txt): failed to open stream: Permission denied in /home/r3d/public_html/wp-content/themes/default/index1.php on line 16

    Warning: fputs(): supplied argument is not a valid stream resource in /home/r3d/public_html/wp-content/themes/default/index1.php on line 19

    Warning: fclose(): supplied argument is not a valid stream resource in /home/r3d/public_html/wp-content/themes/default/index1.php on line 20

    Warning: file(stats.txt): failed to open stream: No such file or directory in /home/r3d/public_html/wp-content/themes/default/index1.php on line 23
    Page hits: 1

    Unique hits: 1

    Todays Page hits: 0

    Todays unique hits: 0

    Shows the stats but has an error any ideas?

    Moderator James Huff

    (@macmanx)

    It looks like stats.txt either does not have full read privilages, or your host has disabled fopen(), probably for security reasons. Is there any reason why you can’t use the stats system that your host has provided? They must have given you something like AWStats or Analog.

    Thread Starter r3d

    (@r3d)

    This is simple script it just shows unique hits stuff like that the stats.txt i had to CHMOD it to 777 so it would have privilages i will look into the fopen thing when admin gets on

    Moderator James Huff

    (@macmanx)

    If you are interested, there are plenty of Statistics plugins:

    http://codex.wordpress.org/Plugins/Statistics

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Adding simple scripts NEVER WORKS help’ is closed to new replies.