• Ask, answer, and discuss all things having to do with the product brands that you own, use, and love. Please feel free to look around, and browse about the forum!

  • Tips and Tricks Forum is the best source of computer and technology troubleshooting advice from a community of experts.


 
Thread Rating:
  • 0 Vote(s) - 0 Average
Watermark Plugin! Fatal error: Call to a member function Clear Cache()
Watermark Plugin! Fatal error: Call to a member function Clear Cache()
09-28-2013 - 08:35 PM
 fjam
Moderator

*****




  • Posts: 83
  • Joined: Jan 2013
  • Reputation: 1
To solve the problem: Fatal error: Call to a member function Clear Cache() on a non-object in /inc/plugins/watermark.php on line 367


(09-30-2011 08:37 AM)flash.tato Wrote:  
(09-22-2011 05:34 PM)B0BBY Wrote:  i get this error when i try to change the path to watermark image:
Fatal error: Call to a member function ClearCache() on a non-object in /home/bobby/public_html/forum/inc/plugins/watermark.php on line 367

if i edit "watermark.php" and put there $this->wpic = MYBB_ROOT . "inc/plugins/mylogo.gif";
it's working fine.

i have a better ideea... auto generate a logo with "username @ forum name" and have an option " watermark all my pictures"
in this way all usesr have their pictures branded with their names and forum name Big Grin.

I fixed that problem. Watermark class wasn't istantiated in admin cp now it is

any changed? I was installed the newest version but it's not work
Fatal error: Call to a member function ClearCache() on a non-object in ***************/inc/plugins/watermark.php on line 368

(09-22-2011 05:34 PM)B0BBY Wrote:  i get this error when i try to change the path to watermark image:
Fatal error: Call to a member function ClearCache() on a non-object in /home/bobby/public_html/forum/inc/plugins/watermark.php on line 367

if i edit "watermark.php" and put there $this->wpic = MYBB_ROOT . "inc/plugins/mylogo.gif";
it's working fine.

i have a better ideea... auto generate a logo with "username @ forum name" and have an option " watermark all my pictures"
in this way all usesr have their pictures branded with their names and forum name Big Grin.

Many thanks, it work fine!

(02-03-2013 08:29 AM)Topielec Wrote:  
(05-28-2012 03:33 PM)scottwstevenson Wrote:  
(12-02-2011 05:38 AM)Jayfore Wrote:  
(12-02-2011 02:42 AM)flash.tato Wrote:  My mistake, you've just to use one underscore on both sides (not two, i know my mistake on documenting the feature).

Also keep in mind that _root_ has an ending slash so in your case would be:
Code:
_root_images/icons/globe.png

And it continues to not work, then create manually a folder under uploads named watermark_cache, that should do the trick.

Let me know as i didn't find any major faults in the code.

It's actually behaving the same way, with 1 underscore on either side and leaving the trailing slash out:
Code:
_root_images/icons/bell.gif

...And I do have the FORUM_ROOT/uploads/watermark_cache folder created (777 permissions).

On your own site, if you intentionally type in the wrong file location, does it behave like this, and just give you a blank screen like this? If yes, could it be improved to give an error instead? Not sure that would help whatever is happening for me right now, but it would be good for others.

I thought I'd bump this up, as this is an almost exact transcript of what I've been going through.

Any solutions?...

-Scott

Hi,

The same problem here! Sad Any ideas?

Hi,
to solve this problem you can find this code in watermark.php file:

PHP Code:
class Watermark
{

    private 
$cache_dir;
    
    private 
$wpic;

    function 
__construct()
    {
        global 
$mybb;
        
$this->wpic str_ireplace("_root_"MYBB_ROOT$mybb->settings['watermark_file']);
        
$this->cache_dir MYBB_ROOT "uploads/watermark_cache/";
    } 

and change it to:

PHP Code:
class Watermark
{

    private 
$cache_dir;
    
    private 
$wpic;

    function 
__construct()
    {
        global 
$mybb;
        
$this->wpic str_ireplace("_root_"MYBB_ROOT$mybb->settings['watermark_file']);
        
$this->cache_dir MYBB_ROOT "uploads/watermark_cache/";
        
$this->wpic MYBB_ROOT "URL OF YOUR WATER MARK IMAGE EX: images/watermark.png";
    } 
(This post was last modified: 09-28-2013 08:42 PM by fjam.)
Quote
RE: Watermark Plugin! Fatal error: Call to a member function Clear Cache()
09-28-2013 - 09:40 PM
 lj3011
Junior Member

**




  • Posts: 1
  • Joined: Feb 2013
  • Reputation: 0
When you change the watermark's URL file as follow figure:

[attachment=89]

after click to Save Settings you will see:

[attachment=90]

Fatal error: Call to a member function Clear Cache() on a non-object in /inc/plugins/watermark.php on line 367

@fjam: Many thanks! It's very useful
Quote


Forum Jump:


User(s) browsing this thread: 1 Guest(s)