I want to use a solution by @toscho to display and rotate some quotes. The unchanged code works very well, but if I replace the
protected function get_rand()
{
return rand( 1, 1000 );
}
with (from here)
protected function get_rand()
{
$array = file("wp-content/plugins/quotes-rotator/quotes.txt");
$r = rand(0,count($array)-1);
return $array[rand(0,count($array)-1)];
}
the code works well only at the first page load, but when I press the 'New' button to display a new quote the system outputs an error:
Warning: file(wp-content/plugins/quotes-rotator/quotes.txt): failed to open stream: No such file or directory in /var/www/.../public_html/wp-content/plugins/quotes-rotator/ajax-shortcode-demo.php on line 106
What is wrong here?