Jump to content

phpadam

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpadam's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I'm editing a previous coder's code, and I'm running into these errors: Warning: file_put_contents(./cache/model_60054fad9b14fb9a3ef6a039e98e2237): failed to open stream: Permission denied in [fullpath]/inc/acorn.php on line 1427 Warning: fopen(./cache/model_60054fad9b14fb9a3ef6a039e98e2237): failed to open stream: No such file or directory in [fullpath]/inc/acorn.php on line 1304 Warning: include(anmodel:///[fullpath]/inc/models/member.php): failed to open stream: "AN_ModelStream::stream_open" call failed in [fullpath]/inc/acorn.php on line 161 Warning: include(): Failed opening 'anmodel:///[fullpath]/inc/models/member.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in [fullpath]/inc/acorn.php on line 161 Fatal error: Class 'Member' not found in [fullpath]/inc/user_page.php on line 7 I'm guessing they all stem from that initial file_put_contents(), and here is the relevant code (I think): class AN_ViewStream extends AN_Stream { function stream_open($path, $mode, $options, &$opened_path) { $cache = self::cache_path('view_'.md5($path)); $path = self::stream_path($path); if (file_exists($cache) === false || filemtime($path) > filemtime($cache)) { $view_data = file_get_contents($path); if (ini_get('short_open_tag') == false) { $view_data = preg_replace(array('/<\?(?!php)/i', '/<\?php=/i'), array('<?php', '<?php echo '), $view_data); } file_put_contents($cache, $view_data); } if (parent::stream_open($cache, $mode, $options, $opened_path)) { $opened_path = $path; return true; } return false; } } I'm guessing a chmod of some sort is in order? But I'm really not even sure what directory I should be changing the permissions of. If you need to see more code, let me know, but can anyone lend a helping hand to point me in the right direction? Thanks.
  2. Here's my full code, but this question is mostly concerning function cycle() <div id="slideshow"> <div id="main"> <div id="placehold"> </div> <div id="caption"> </div> </div> <div id="roll"> <center> <img src="1.jpg" id="1" alt="Caption1" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(1.jpg)'" /> <img src="2.jpg" id="2" alt="Caption2" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(2.jpg)'" /> <img src="3.jpg" id="3" alt="Caption3" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(3.jpg)'" /> <img src="4.jpg" id="4" alt="Caption4" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(4.jpg)'" /> <img src="5.jpg" id="5" alt="Caption5" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(5.jpg)'" /> <img src="6.jpg" id="6" alt="Caption6" style="width:90px;height:60px;opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" onclick="document.getElementById('main').style.backgroundImage='url(6.jpg)'" /> </center> </div> </div> <script type="text/javascript"> function cycle() { var current = document.getElementById("main").style.backgroundImage; if ( current == '' ) { var numb = 1; } if ( current == "url(6.jpg)" ) { var numb = 1; } if ( current != '' && current != "url(6.jpg)" ) { var numb = current.charAt(4); var numb = parseInt(numb) + 1; } var numbstr = "url("+numb+".jpg)"; document.getElementById("main").style.backgroundImage=numbstr; setTimeout("cycle()", 5000); } onload=function (){cycle()}; </script> As you can see, the script cycles between changing the main picture every five seconds. But when a user clicks on the thumb of that image, the main picture changed as well, yet the script doesn't stop it's rhythm of five seconds, so if a user clicks on a thumbnail at the end of a five second cycle, the picture won't stay up for long. How would I go about resetting the timer to the beginning of five seconds every time a user selects a thumbnail? I realize I will probably have to get rid of setTimeout as it is, and maybe include a global time interval variable? Help please, thanks in advance. -Adam
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.