Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.38 veröffentlicht (30.04.24)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
Parse Error im Pluginscript
#1
Hallo Community

Da ich ja einen Link zum YouTube Channel in einem Profil anzeigen lassen habe, möchte ich es mit einem Plugin für andere Nutzer vereinfachen. Jedoch gibt es Probleme. Es gibt immer nur "Parse error: syntax error, unexpected T_STRING in /var/syscp/webs/gamenews/forum/inc/plugins/ytprofile.php on line 42." aus.

Code:
Code:
<?php

if(!defined("IN_MYBB"))
{
  die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("datahandler_user_update", "ytprofile_update");

function ytprofile_info()
{
  return array(
        "name"            => "YouTube Channel im Profil",
        "description"    => "Erlaubt im Profil einen Link zum YouTube Channel anzugeben",
        "website"        => "http://falkenauge.kilu.de",
        "author"        => "Daniel Gatti",
        "authorsite"    => "http://falkenauge.kilu.de",
        "version"        => "1.0",
        "guid"            => "6cf34b98912ceb938211f8873f83cef1",
        "compatibility" => "14*",
  );
}

function ytprofile_activate()
{
  global $db;
  
  /* TODO: Should the possibility be added to disable ytprofile from admin cp? */
  $db->query("ALTER TABLE ".TABLE_PREFIX."users  ADD ytprofile VARCHAR(50) unsigned NOT NULL AFTER website");
  
  /* TODO: Language support? */
  require_once MYBB_ROOT."inc/adminfunctions_templates.php";

  /* Insert fields into usercp for editing */
  find_replace_templatesets('usercp_profile','#{\$user\[\'website\'\]\}\" /\></td>#',
         '{$user[\'website\']}" /></td>
</tr>
<tr>
<td colspan="3"><span class="smalltext">YouTube Channel:</span></td>
</tr>
<tr>
<td><input type="text" class="textbox" name="YouTube Channel" size="25" maxlength="75" value="{$user['ytprofile']}" /></td>
</tr>');

  /* Insert fields into member profile */
  find_replace_templatesets('member_profile','#{\$memprofile\[\'website\'\]\}</a></td>#',
        '{$memprofile[\'website\']}</a></td>
</tr>
<tr>
<td class="trow1"><strong>YouTube Channel</strong></td>
<td class="trow1"><a href="http://www.youtube.com/user/{$memprofile['ytprofile']}" target="_blank">{$memprofile['ytprofile']}</a></td>
</tr>');
}

function ytprofile_deactivate()
{
  global $db;

  $db->query("ALTER TABLE ".TABLE_PREFIX."users DROP COLUMN ytprofile");

  require_once MYBB_ROOT."inc/adminfunctions_templates.php";

  find_replace_templatesets('usercp_profile',
      preg_quote('#{$user[\'website\']}" /></td>
</tr>
<tr>
<td colspan="3"><span class="smalltext">YouTube Channel:</span></td>
</tr>
<tr>
<td><input type="text" class="textbox" name="YouTube Channel" size="25" maxlength="75" value="{$user['ytprofile']}" /></td>
</tr>#'),
      '{$user[\'website\']}" /></td>',0);

   find_replace_templatesets('member_profile',
        preg_quote('#{$memprofile[\'website\']}</a></td>
</tr>
<tr>
<td class="trow1"><strong>YouTube Channel</strong></td>
<td class="trow1"><a href="http://www.youtube.com/user/{$memprofile['ytprofile']}" target="_blank">{$memprofile['ytprofile']}</a></td>
</tr>#'),
      '{$memprofile[\'website\']}</a></td>',0);
}

function ytprofile_update($ytprofile)
{
  global $mybb;

  if (isset($mybb->input['ytprofile']))
   {
      $ytprofile->user_update_data['ytprofile'] = $mybb->input['ytprofile'];
   }
}

Ich habe zur Hilfe ein ähnliches Plugin genommen. Funktioniert ja leider nicht, ich hoffe, ihr könnt mir helfen.

Für die dies interessieren:
Skype schrieb:[04:52:47] Robert: immer ruhig bleiben, sonst wird das nix
[04:54:13] Maverick: Naja, ich poste jetzt eh grade im MyBB Coder Forum
[04:54:37] Robert: schnell verstärkung holen ^^
[04:55:22] Maverick: Richtig^^
Zitieren


Nachrichten in diesem Thema
Parse Error im Pluginscript - von Falkenauge Mihawk - 20.02.2010, 05:57