Hallo, Gast! (Registrieren)

Wir wünschen allen Besuchern frohe Ostern!

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 2 Gast/Gäste
Probleme mit Hide Links to Guest!
#1
Hallo,

ich denke, dass das ein sehr wichtiges Plugin ist. Hide Links to Guests! Alle Links in Beiträgen etc. werden Gästen nicht angezeigt. Das Problem, ich habe ein Forum von MyBB gesehen wo das geht, bei mir läuft das nicht. Ich was nicht warum das nicht klappt. Kann es ein das etwas an dem Code nicht stimmt. Schaut mal rein:

PHP-Code:
<?php
/**
 * Hide Links to Guests
 * Copyright v1.2 DragonFever
 */


function hltg_info()
{
    return array(
        
"name"        => "Hide Links to Guests",
        
"description"    => "Don't show links in the messages to guests.",
        
"website"    => "http://www.mybbdestek.com/",
        
"author"    => "DragonFever",
        
"authorsite"    => "http://www.dragonfever.info/",
        
"version"    => "1.2",
    );
}

function 
hltg_activate()
{
    global 
$db$viewing;
    
    
$hltg_group = array(
        
"gid"            => "NULL",
        
"name"            => "Hide Links to Guests",
        
"title"            => "Hide Links to Guests",
        
"description"    => "Settings for Hide Links to Guests.",
        
"disporder"        => "4",
        
"isdefault"        => "no",
    );
    
    
$db->insert_query(TABLE_PREFIX."settinggroups"$hltg_group);
    
$gid $db->insert_id();
    
    
    
$hltg_setting_1 = array(
        
"sid"            => "NULL",
        
"name"            => "hltg",
        
"title"            => "Showing Text",
        
"description"    => "The following text will show to guests instead of links",
        
"optionscode"    => "textarea",
        
"value"            => 'You Cannot View the Links Before Login the Site. Please Login or Register Our Site..',
        
"disporder"        => '1',
        
"gid"            => intval($gid),
    );

    
$db->insert_query(TABLE_PREFIX."settings"$hltg_setting_1);
    
rebuild_settings();
    
    
$fh fopen('../inc/class_parser.php'"r") or cperror("Could not open file!"); //OPEN FILE
    
$data fread($fhfilesize('../inc/class_parser.php')) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
    
fclose($fh); //CLOSE FILE AGAIN
    
$newdata preg_replace('#'.preg_quote('// Replace MyCode if requested.
        if($options[\'allow_mycode\'] != "no")
        {
            $message = $this->parse_mycode($message, $options);
        }'
).'#','// Replace MyCode if requested.
        if($options[\'allow_mycode\'] != "no")
        {
            // Ziyaretciler Linki Goremez Eklentisi By DragonFever <mhanyak@hotmail.com>
            if($mybb->user[\'usergroup\'] != "1")
        {
            $message = $this->parse_mycode($message, $options);
        }else{
            $message = $this->parse_mycode($message, $options);
            $message = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", "<font color=red><b>{$mybb->settings[\'hltg\']}</b></font>", $message);
        }
        }'
,$data); //REPLACE IN STRING
    
$fw fopen('../inc/class_parser.php'"w") or cperror('Could not open file!'); //OPEN FILE AGAIN
    
$fb fwrite($fw$newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
    
fclose($fw); //CLOSE FILE AGAIN    
}

function 
hltg_deactivate()
{
    global 
$db;
        
//revert index.php must be chmoded 777
    
$fh fopen('../inc/class_parser.php'"r") or cperror("Could not open file!"); //OPEN FILE
    
$data fread($fhfilesize('../inc/class_parser.php')) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
    
fclose($fh); //CLOSE FILE AGAIN
    
$newdata preg_replace('#'.preg_quote('// Replace MyCode if requested.
        if($options[\'allow_mycode\'] != "no")
        {
            // Ziyaretciler Linki Goremez Eklentisi By DragonFever <mhanyak@hotmail.com>
            if($mybb->user[\'usergroup\'] != "1")
        {
            $message = $this->parse_mycode($message, $options);
        }else{
            $message = $this->parse_mycode($message, $options);
            $message = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", "<font color=red><b>{$mybb->settings[\'hltg\']}</b></font>", $message);
        }
        }'
).'#','// Replace MyCode if requested.
        if($options[\'allow_mycode\'] != "no")
        {
            $message = $this->parse_mycode($message, $options);
        }'
,$data); //REPLACE IN STRING
    
$fw fopen('../inc/class_parser.php'"w") or cperror('Could not open file!'); //OPEN FILE AGAIN
    
$fb fwrite($fw$newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
    
fclose($fw); //CLOSE FILE AGAIN
    
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='hltg'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='Hide Links to Guests'");
    
rebuild_settings();

}

if(!
function_exists("rebuild_settings"))
{
    function 
rebuild_settings()
    {
        global 
$db;
        
$query $db->query("SELECT * FROM ".TABLE_PREFIX."settings ORDER BY title ASC");
        while(
$setting $db->fetch_array($query))
        {
            
$setting['value'] = addslashes($setting['value']);
            
$settings .= "\$settings['".$setting['name']."'] = \"".$setting['value']."\";\n";
        }
        
$settings "<?php\n/*********************************\ \n  DO NOT EDIT THIS FILE, PLEASE USE\n  THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?>";
        
$file fopen(MYBB_ROOT."/inc/settings.php""w");
        
fwrite($file$settings);
        
fclose($file);
    }
}
?>

Vielen Dank!!

MFG

Jetzt kostenlos eine Domain registrieren!!
Hier klicken: www.domains-for-free.de
Zitieren
#2
../inc/class_parser.php
../inc/settings.php
Hast du chmod 777 bei diesen Dateien gesetzt?
Mir scheint das Script will diese Dateien beschreiben.
Alternativ kannst du auch versuchen die class_parser.php manuell anzupassen.
http://www.profi-webmaster.com - Gratis Webspace ohne Werbung.
Donated $5,00 USD! Cool
Zitieren
#3
../inc/class_parser.php habe ich auf CHMOD 777 gesetzt weil es in der Beschreibung stand /inc/settings nicht. Werde ich sofort versuchen!

Jetzt kostenlos eine Domain registrieren!!
Hier klicken: www.domains-for-free.de
Zitieren
#4
Habe es versucht. Es geht nicht. Leider nicht!

Jetzt kostenlos eine Domain registrieren!!
Hier klicken: www.domains-for-free.de
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  hide links - ein Forum für alle sichtbar machen Anton 4 3.073 10.07.2013, 17:24
Letzter Beitrag: Anton
  Gäste sehen Links trotz Hide. Devon 2 1.658 12.07.2011, 19:28
Letzter Beitrag: Devon
  Hide Links to Guests for 1.4 Fehler? MiDa 1 1.265 09.05.2011, 23:23
Letzter Beitrag: Falkenauge Mihawk
  Hide-Link Hide-IMG fehler Devidra 5 2.780 12.07.2010, 13:30
Letzter Beitrag: Devidra
  Hide für externe Links Wszene Online 6 2.576 18.01.2010, 17:20
Letzter Beitrag: Michael Malin