pragmaMx Support Forum

pragmaMx => Coder und Bastlerecke => Thema gestartet von: algebre am 17 Dezember 2010, 15:18:46

Titel: Google Web search module
Beitrag von: algebre am 17 Dezember 2010, 15:18:46
Hi
If you have an adsense account download this module.
this module (+block) do search in the web or in your site ( + 2 other optionals site you choose) and show the search result in your site

Requirements :
- pragmaMx v0.1.11 or higher
- adsense (https://www.google.com/adsense/) client ID

Downloads:
http://www.megaupload.com/?d=8Z0PWIWW

Installation:
1 - unzip
2 - upload
3 - goto "admin.php?op=modules" and activate the new module
3 - admin.php?op=resetPmxCache
4 - goto admin.php?op=web_search and put (adsense client ID, your site url without (http://www.)
5 - enjoy
Titel: Re:Google Web search module
Beitrag von: Sportangler am 18 Dezember 2010, 13:18:10
Hi,
thank you, but:

Fatal error: Call to undefined function mx_write_file() in XXX/modules/web_search/admin/admin.php on line 198

And what kind of ID:

Publisher-ID: pub-XXX
or
AdSense für Suchergebnisseiten: partner-pub-XXX

:bye:
Titel: Re:Google Web search module
Beitrag von: algebre am 18 Dezember 2010, 13:41:54
Hi
I have made a mistake, this function mx_write_file() exists since version 0.1.12
so change in admin.php this code :
<?php
@chmod($conffile, 0777);
    
$file = @fopen($conffile, "w");
    if (
$file) {
        
fwrite($file, $content);
        
fclose($file);
        
$msg = _CHANGESAREOK;
        
$delay = 0;
    } else {
        
$msg = _CHANGESNOTOK;
        
$delay = 5;
    }
    @
chmod($conffile, 0444);
    
    
$msg = _CHANGESAREOK;
    
$delay = 5;
    
mx_write_file($conffile, $content, true);
    
mxRedirect('admin.php?op=web_searchConfig', $msg, $delay);
    
mxSecureLog("SecLog", "Change Web_search config.php");
    
$ok = mx_write_file($conffile, $content, true);
    if (
$ok) {
        
$statmsg = _ADMIN_SETTINGSAVED;
        
$delay = 2;
        include_once(
PMX_SYSTEM_DIR . DS . 'mx_reset.php');
        
resetPmxCache();
    } else {
        
$statmsg = "<big>" . _ADMIN_SETTINGNOSAVED . "</big><p>" . _ADMIN_CANTCHANGE . " (config.php)</p>";
        
$delay = 5;
    }
    
mxRedirect('admin.php?op=web_searchConfig', $statmsg, $delay);


by this:
<?php //ignore this line
@chmod($conffile, 0777);
    
$file = @fopen($conffile, "w");
    if (
$file) {
        
fwrite($file, $content);
        
fclose($file);
        
$msg = _CHANGESAREOK;
        
$delay = 0;
    } else {
        
$msg = _CHANGESNOTOK;
        
$delay = 5;
    }
    @
chmod($conffile, 0444);
    
mxRedirect('admin.php?op=web_searchConfig', $msg, $delay);


ZitatAnd what kind of ID:


pub-2552995021861XXX
Titel: Re:Google Web search module
Beitrag von: algebre am 19 Dezember 2010, 12:24:55
hello
new link (http://www.pmx.xtreemhost.com/Downloads-web_search-view-2.html)
demo (http://www.pmx.xtreemhost.com/web_search.html)