$this-> Bugs me
Moderator: General Moderators
$this-> Bugs me
I have a lot of these in my script that work on my old server but dont on my new one.
$this->
Is there a work around?
I dont have the money i used to so cant afford a scripter to help and i can do basic php but i dont know what they are and google isnt much help 8-(
Thanks
$this->
Is there a work around?
I dont have the money i used to so cant afford a scripter to help and i can do basic php but i dont know what they are and google isnt much help 8-(
Thanks
Re: $this-> Bugs me
What PHP version is on your new server?
Code: Select all
<?php
echo PHP_VERSION;
?>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: $this-> Bugs me
I think its the new PHP 5 which doesnt support the problem thats why its breaking and the server company wont change it 
I just wondered if there was a work around for it?
I just wondered if there was a work around for it?
Re: $this-> Bugs me
It is object notation which PHP5 supports.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: $this-> Bugs me
What are the errors you are receiving?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: $this-> Bugs me
Fatal error: Using $this when not in object context in /home/q/u/quidfree/web/public_html/lib/emt-plugins/validatelink.php on line 19
Re: $this-> Bugs me
Post your code from lines ~10 - ~30
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: $this-> Bugs me
Code: Select all
$GLOBALS['EMT_PLUGIN_DESCS']['validatelink'] = 'A link that a user clicks to validate their account';
/**
*
*
*/
function emt_validatelink_onload(&$this, $params = array())
{ // must add a tag with the same format that we will be using
$this->add_tag('{checksum}');
$linkBase = 'http://'.SITE_DOMAIN.'/activate.php?username={username}&check={checksum}';
foreach ($params as $replace => $data)
{
if ($this->isHTML)
{
$text = isset($data['text']) ? $data['text'] : $linkBase;
$link = '<a href="'.$linkBase.'" target=_blank>'.$text.'</a>';
}
else
Last edited by Benjamin on Fri Oct 08, 2010 2:53 pm, edited 1 time in total.
Reason: Added [syntax=php] tags.
Reason: Added [syntax=php] tags.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: $this-> Bugs me
In that function, rename $this to anything else. "$this" is reserved for class scope.
Re: $this-> Bugs me
i did and now this has been shown to me
Fatal error: Call to a member function add_tag() on a non-object in /home/q/u/quidfree/web/public_html/lib/emt-plugins/validatelink.php on line 19
i replaced it with:
$GLOBALS['EMT_PLUGIN_DESCS']['validatelink'] = 'A link that a user clicks to validate their account';
/**
*
*
*/
function emt_validatelink_onload(&$this, $params = array())
{ // must add a tag with the same format that we will be using
$haveit->add_tag('{checksum}');
$linkBase = 'http://'.SITE_DOMAIN.'/activate.php?username={username}&check={checksum}';
foreach ($params as $replace => $data)
{
if ($haveit->isHTML)
{
$text = isset($data['text']) ? $data['text'] : $linkBase;
$link = '<a href="'.$linkBase.'" target=_blank>'.$text.'</a>';
}
else
Fatal error: Call to a member function add_tag() on a non-object in /home/q/u/quidfree/web/public_html/lib/emt-plugins/validatelink.php on line 19
i replaced it with:
$GLOBALS['EMT_PLUGIN_DESCS']['validatelink'] = 'A link that a user clicks to validate their account';
/**
*
*
*/
function emt_validatelink_onload(&$this, $params = array())
{ // must add a tag with the same format that we will be using
$haveit->add_tag('{checksum}');
$linkBase = 'http://'.SITE_DOMAIN.'/activate.php?username={username}&check={checksum}';
foreach ($params as $replace => $data)
{
if ($haveit->isHTML)
{
$text = isset($data['text']) ? $data['text'] : $linkBase;
$link = '<a href="'.$linkBase.'" target=_blank>'.$text.'</a>';
}
else
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: $this-> Bugs me
I said all instances of $this 
Hint.. function parameters.
Hint.. function parameters.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: $this-> Bugs me
It's no wonder sometimes people think we're mind readersJohn Cartwright wrote:I said all instances of $this
Hint.. function parameters.
Re: $this-> Bugs me
sorry guys taht works just other problems now i hate it whe 2 servers are not exactly configuired the same
Re: $this-> Bugs me
Try to be aware of practicing writing your code so that it will work on any server configuration!gotornot wrote:sorry guys taht works just other problems now i hate it whe 2 servers are not exactly configuired the same
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.