Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
p01-contact : simply add contact forms in your pages
I had an error after implementing this into my website. It was related to the difference in saving the user-file in the different versions of GetSimple. I came up with the following solutions/hack:
Replace the admin_email function with the code below (p01-contact_gs.php ; line: 66)
Code:
function admin_email()
{
    if(file_exists(GSDATAOTHERPATH . 'user.xml'))
    {
        $data = getXML(GSDATAOTHERPATH . 'user.xml');
        return $data->EMAIL;
    }

    $dir = scandir(GSUSERSPATH);
    foreach($dir as $file)
    {
        if(preg_match('/\.xml/', $file) > 0)
        {
            $data = getXML(GSUSERSPATH.$file);
            return $data->EMAIL;
        }
    }
}

This little change in code checks if the file is found in the DATAOTHERPATH/user.xml else it will take the first file found in the GSUSERPATH. It's not the best solution, but it works for me. Maybe it works for some of you too!
Reply


Messages In This Thread
RE: p01-contact : simply add contact forms in your pages - by pchulpleusden - 2013-08-08, 05:16:59
askcopy syntax Not Working - by celextel - 2019-05-24, 01:54:40
RE: askcopy syntax Not Working - by celextel - 2019-05-28, 01:51:47



Users browsing this thread: 1 Guest(s)