close× Call Us +49 (1805) 01 29 59

Datalus
Thread Author: DarkLevi
Thread ID: 2358
Thread Info
Es gibt 7 Beiträge zu diesem Thema, und es wurde 2989 mal angesehen.
Wer ist hier? 1 Gäste
 Thema drucken
Zweite Article-seite
DarkLevi
moin,

ich hab ma versucht ne infusion von basti umzubasteln, da ich eine zweite UNABHÄNGIGE artikrl-seite brauche

dabei bin ich auf 2 probleme gestoßen die ich als php noob nicht selber lösen kann, wär schön wenn ihr mir da helfen könntet, da ich leider auch kein mir verständliches tut auf google gefunden hab

1. ich möchte 2 neue db's erstellen, und die erste wird ja wunderbar erstellt, nur die zweite nicht, und ich hab keine ahnung wieso, hier ist der code:

infusion.php


<?php
if (!defined("IN_FUSION") || !checkrights("I")) { die("Access Denied"); }

$inf_newtable[1] = DB_ARTICLE_MUSIK_CATS_ENTRY." (
article_cat_musik_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
article_cat_musik_name VARCHAR(100) NOT NULL DEFAULT '',
article_cat_musik_description VARCHAR(200) NOT NULL DEFAULT '',
article_cat_musik_sorting VARCHAR(500) NOT NULL DEFAULT 'article_subject ASC',
article_cat_musik_access TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (article_cat_musik_id)
) TYPE=MyISAM;";

$inf_newtable[2] = DB_MUSIK_ARTICLES_ENTRY." (
musik_article_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
musik_article_cat MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
musik_article_subject VARCHAR(200) NOT NULL DEFAULT '',
musik_article_snippet TEXT NOT NULL,
musik_article_article TEXT NOT NULL,
musik_article_draft TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
musik_article_breaks CHAR(1) NOT NULL DEFAULT '',
musik_article_name MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1',
musik_article_datestamp INT(10) UNSIGNED NOT NULL DEFAULT '0',
musik_article_reads MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
musik_article_allow_comments TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
musik_article_allow_ratings TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
PRIMARY KEY (musik_article_id),
KEY article_datestamp (article_datestamp),
KEY article_reads (article_reads)
) TYPE=MyISAM;";

$inf_insertdbrow[1] = DB_ARTICLE_MUSIK_CATS_ENTRY." (article_cat_musik_id, article_cat_musik_name, article_cat_musik_description, article_cat_musik_sorting, article_cat_musik_access) VALUES ('0', 'Musik', '&Uuml;ber die Musik von Lathara', 'article_id ASC', '0')";

$inf_insertdbrow[2] = DB_MUSIK_ARTICLES_ENTRY." (musik_article_id, musik_article_cat, musik_article_subject, musik_article_snippet, musik_article_article, musik_article_draft, musik_article_breaks, musik_article_name, musik_article_datestamp, musik_article_reads, musik_article_allow_comments, musik_article_allow_ratings) VALUES ('0', '0', 'Musik', '', '0', '0', '0', '0', '0', '0', '0', '0')";

$inf_droptable[1] = DB_ARTICLE_MUSIK_CATS_ENTRY;
$inf_droptable[2] = DB_MUSIK_ARTICLES_ENTRY;

$inf_adminpanel[1] = array(
   "title" => $locale['704'],
   "image" => "image.gif",
   "panel" => "admin/musik_admin.php",
   "rights" => "musik"
);

$inf_sitelink[1] = array(
   "title" => $locale['704'],
   "url" => "musik.php",
   "visibility" => "0"
);

?>


und die infusion_db.php:


<?php

if (!defined("DB_ARTICLE_MUSIK_CATS_ENTRY")) {
   define("DB_ARTICLE_MUSIK_CATS_ENTRY", DB_PREFIX."article_musik_cats");
}

if (!defined("DB_MUSIK_ARTICLES_ENTRY")) {
   define("DB_MUSIK_ARTICLES_ENTRY", DB_PREFIX."article_musik");
}

?>


2. so nun zum zweiten, ich hab einfach ma versucht die articles admin anzupassen, aber die wird mir bei "Infusionen" nicht angezeigt, wieso nicht? was zum teufel hab ich da falsch gemacht?


<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: articles.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";

if (!checkrights("A") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("error.php?id=1"); }

// Includes
require_once INFUSIONS."musik/infusion_db.php";
require_once THEMES."templates/admin_header.php";

// Language Files
if (file_exists(INFUSIONS."musik/locale/".$settings['locale'].".php")) {
   include INFUSIONS."musik/locale/".$settings['locale'].".php";
} else {
   include INFUSIONS."musik/locale/English.php";
}

if ($settings['tinymce_enabled'] == 1) {
   echo "<script language='javascript' type='text/javascript'>advanced();</script>\n";
} else {
   require_once INCLUDES."html_buttons_include.php";
}

if (isset($_GET['status']) && !isset($message)) {
   if ($_GET['status'] == "sn") {
      $message = $locale['410'];
   } elseif ($_GET['status'] == "su") {
      $message = $locale['411'];
   } elseif ($_GET['status'] == "del") {
      $message = $locale['412'];
   }
   if ($message) {   echo "<div class='admin-message'>".$message."</div>\n"; }
}

$result = dbquery("SELECT * FROM ".DB_ARTICLE_MUSIK_CATS);
if (dbrows($result)) {
   if (isset($_POST['save'])) {
      $subject = stripinput($_POST['subject']);
      $body = addslash($_POST['body']);
      $body2 = addslash($_POST['body2']);
      $draft = isset($_POST['article_draft']) ? "1" : "0";
      if ($settings['tinymce_enabled'] != 1) { $breaks = isset($_POST['line_breaks']) ? "y" : "n"; } else { $breaks = "n"; }
      $comments = isset($_POST['musik_article_comments']) ? "1" : "0";
      $ratings = isset($_POST['musik_article_ratings']) ? "1" : "0";
      if (isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id'])) {
         $result = dbquery("UPDATE ".DB_MUSIK_ARTICLES_ENTRY." SET article_cat_musik='".intval($_POST['musik_article_cat'])."', musik_article_subject='$subject', musik_article_snippet='$body', musik_article_article='$body2', musik_article_draft='$draft', musik_article_breaks='$breaks', musik_article_allow_comments='$comments', musik_article_allow_ratings='$ratings' WHERE musik_article_id='".$_POST['musik_article_id']."'");
         redirect(FUSION_SELF.$aidlink."&status=su");
      } else {
         $result = dbquery("INSERT INTO ".DB_MUSIK_ARTICLES_ENTRY." (musik_article_cat, musik_article_subject, musik_article_snippet, musik_article_article, musik_article_draft, musik_article_breaks, musik_article_name, musik_article_datestamp, musik_article_reads, musik_article_allow_comments, musik_article_allow_ratings) VALUES ('".intval($_POST['musik_article_cat'])."', '$subject', '$body', '$body2', '$draft', '$breaks', '".$userdata['user_id']."', '".time()."', '0', '$comments', '$ratings')");
         redirect(FUSION_SELF.$aidlink."&status=sn");
      }
   } else if (isset($_POST['delete']) && (isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id']))) {
      $result = dbquery("DELETE FROM ".DB_MUSIK_ARTICLES_ENTRY." WHERE article_id='".$_POST['musik_article_id']."'");
      $result = dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_item_id='".$_POST['musik_article_id']."' and comment_type='A'");
      $result = dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_item_id='".$_POST['musik_article_id']."' and rating_type='A'");
      redirect(FUSION_SELF.$aidlink."&status=del");
   } else {
      if (isset($_POST['preview'])) {
         $article_cat = $_POST['musik_article_cat'];
         $subject = stripinput($_POST['subject']);
         $body = phpentities(stripslash($_POST['body']));
         $body2 = phpentities(stripslash($_POST['body2']));
         $bodypreview = str_replace("src='".str_replace("../", "", IMAGES_A), "src='".IMAGES_A, stripslash($_POST['body']));
         $body2preview = str_replace("src='".str_replace("../", "", IMAGES_A), "src='".IMAGES_A, stripslash($_POST['body2']));
         $draft = isset($_POST['musik_article_draft']) ? " checked='checked'" : "";
         if (isset($_POST['line_breaks'])) {
            $breaks = " checked='checked'";
            $bodypreview = nl2br($bodypreview);
            $body2preview = nl2br($body2preview);
         } else {
            $breaks = "";
         }
         $comments = isset($_POST['musik_article_comments']) ? " checked='checked'" : "";
         $ratings = isset($_POST['musik_article_ratings']) ? " checked='checked'" : "";
         opentable($subject);
         echo $bodypreview."\n";
         closetable();
         opentable($subject);
         echo $body2preview."\n";
         closetable();
      }
      $result = dbquery("SELECT * FROM ".DB_MUSIK_ARTICLES_ENTRY." ORDER BY musik_article_draft DESC, musik_article_datestamp DESC");
      if (dbrows($result)) {
         $editlist = ""; $sel = "";
         while ($data = dbarray($result)) {
            if ((isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id'])) || (isset($_GET['musik_article_id']) && isnum($_GET['musik_article_id']))) {
               $article_id = isset($_POST['musik_article_id']) ? $_POST['musik_article_id'] : $_GET['musik_article_id'];
               $sel = ($article_id == $data['musik_article_id'] ? " selected='selected'" : "");
            } else {
               $sel = "";
            }
            $editlist .= "<option value='".$data['musik_article_id']."'".$sel.">".($data['musik_article_draft'] ? $locale['433']." " : "").$data['musik_article_subject']."</option>\n";
         }
         opentable($locale['402']);
         echo "<div style='text-align:center'>\n<form name='selectform' method='post' action='".FUSION_SELF.$aidlink."&amp;action=edit'>\n";
         echo "<select name='article_id' class='textbox' style='width:250px;'>\n".$editlist."</select>\n";
         echo "<input type='submit' name='edit' value='".$locale['420']."' class='button' />\n";
         echo "<input type='submit' name='delete' value='".$locale['421']."' onclick='return DeleteArticle();' class='button' />\n";
         echo "</form>\n</div>\n";
         closetable();
      }

      if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id'])) || (isset($_GET['musik_article_id']) && isnum($_GET['musik_article_id']))) {
         $result = dbquery("SELECT * FROM ".DB_MUSIK_ARTICLES_ENTRY." WHERE musik_article_id='".(isset($_POST['musik_article_id']) ? $_POST['musik_article_id'] : $_GET['musik_article_id'])."'");
         if (dbrows($result)) {
            $data = dbarray($result);
            $article_cat = $data['musik_article_cat'];
            $subject = $data['musik_article_subject'];
            $body = phpentities(stripslashes($data['musik_article_snippet']));
            $body2 = phpentities(stripslashes($data['musik_article_article']));
            $draft = $data['musik_article_draft'] ? " checked='checked'" : "";
            $breaks = $data['musik_article_breaks'] == "y" ? " checked='checked'" : "";
            $comments = $data['musik_article_allow_comments'] ? " checked='checked'" : "";
            $ratings = $data['musik_article_allow_ratings'] ? " checked='checked'" : "";
         } else {
            redirect(FUSION_SELF.$aidlink);
         }
      }
      if ((isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id'])) || (isset($_GET['musik_article_id']) && isnum($_GET['musik_article_id']))) {
         opentable($locale['401']);
      } else {
         if (!isset($_POST['preview'])) {
            $subject = "";
            $body = "";
            $body2 = "";
            $draft = "";
            $breaks = " checked='checked'";
            $comments = " checked='checked'";
            $ratings = " checked='checked'";
         }
         opentable($locale['400']);
      }
      $result = dbquery("SELECT * FROM ".DB_ARTICLE_MUSIK_CATS." ORDER BY article_cat_musik_name DESC");
      $catlist = ""; $sel = "";
      while ($data = dbarray($result)) {
         if (isset($article_cat)) $sel = ($article_cat == $data['article_cat_musik_id'] ? " selected='selected'" : "");
         $catlist .= "<option value='".$data['article_cat_musik_id']."'$sel>".$data['article_cat_musik_name']."</option>\n";
      }
      echo "<form name='inputform' method='post' action='".FUSION_SELF.$aidlink."' onsubmit='return ValidateForm(this)'>\n";
      echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
      echo "<td width='100' class='tbl'>".$locale['422']."</td>\n";
      echo "<td class='tbl'><select name='article_cat' class='textbox' style='width:250px;'>".$catlist."</select></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td width='100' class='tbl'>".$locale['423']."</td>\n";
      echo "<td class='tbl'><input type='text' name='subject' value='$subject' class='textbox' style='width:250px;' /></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td valign='top' width='100' class='tbl'>".$locale['424']."</td>\n";
      echo "<td class='tbl'><textarea name='body' cols='95' rows='5' class='textbox' style='width:98%'>".$body."</textarea></td>\n";
      echo "</tr>\n";
      if ($settings['tinymce_enabled'] != 1) {
         echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
         echo display_html("inputform", "body", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";
      }
      echo "<tr>\n<td valign='top' width='100' class='tbl'>".$locale['425']."</td>\n";
      echo "<td class='tbl'><textarea name='body2' cols='95' rows='10' class='textbox' style='width:98%'>".$body2."</textarea></td>\n";
      echo "</tr>\n";
      if ($settings['tinymce_enabled'] != 1) {
         echo "<tr>\n<td class='tbl'></td><td class='tbl'>\n";
         echo "<input type='button' value='".$locale['432']."' class='button' style='width:80px;' onclick=\"insertText('body2', '<--PAGEBREAK-->');\" />\n";
         echo display_html("inputform", "body2", true, true, true, IMAGES_A);
         echo "</td>\n</tr>\n";
      }
      echo "<tr>\n";
      echo "<td class='tbl'></td><td class='tbl'>\n";
      echo "<label><input type='checkbox' name='article_draft' value='yes'".$draft." /> ".$locale['426']."</label><br />\n";
      if ($settings['tinymce_enabled'] != 1) { echo "<label><input type='checkbox' name='line_breaks' value='yes'".$breaks." /> ".$locale['427']."</label><br />\n"; }
      echo "<label><input type='checkbox' name='musik_article_comments' value='yes'".$comments." /> ".$locale['428']."</label><br />\n";
      echo "<label><input type='checkbox' name='musik_article_ratings' value='yes'".$ratings." /> ".$locale['429']."</label></td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td align='center' colspan='2' class='tbl'><br />\n";
      if ((isset($_POST['musik_article_id']) && isnum($_POST['musik_article_id'])) || (isset($_GET['musik_article_id']) && isnum($_GET['musik_article_id']))) {
         echo "<input type='hidden' name='musik_article_id' value='".(isset($_POST['musik_article_id']) ? $_POST['musik_article_id'] : $_GET['musik_article_id'])."' />\n";
      }
      echo "<input type='submit' name='preview' value='".$locale['430']."' class='button' />\n";
      echo "<input type='submit' name='save' value='".$locale['431']."' class='button' /></td>\n";
      echo "</tr>\n</table>\n</form>\n";
      closetable();
      echo "<script type='text/javascript'>"."\n"."function DeleteArticle() {\n";
      echo "return confirm('".$locale['451']."');\n}\n";
      echo "function ValidateForm(frm) {"."\n"."if(frm.subject.value=='') {\n";
      echo "alert('".$locale['450']."');"."\n"."return false;\n}\n}\n</script>\n";
   }
} else {
   opentable($locale['403']);
   echo "<div style='text-align:center'>".$locale['452']."<br />\n".$locale['453']."<br />\n";
   closetable();
}

require_once THEMES."templates/footer.php";
?>


wär echt ganz ganz ganz super wenn ihr mir da helfen könntet, und einigermaßen erklären was ich da falsch mach

Gruß
Levi
 
SC-Ad-Bot
 
emblinux
zu 1. Dann schau dir die 2 Tabelle nochmal an, welche Felder die hat und was du aber als Key festlegen willst, da stimmt was nicht überein.

zu. 2. Ich denke mal es liegt an dem Recht, was du in der infusion.db festlegst. Dieses darf maximal nur 4 Zeichen haben und sollte nach Möglichkeit große Buchstaben haben. (muss aber nicht, ist nur wegen der Einheitlichkeit) Und das Recht solltest du dann aber auch in der Admin-Datei abfragen und nicht das Recht von den Artikeln.

So wie ich das sehe hast du nur versucht durch diverse Umbenennungen was zu erreichen, nur reicht das meistens nicht aus.
Das Lernen ist wie ein Meer ohne Ufer. Konfuzius

Alles wird Gut!

KEIN Support per Mail, ICQ oder PN !
www.heiseclan.de/fusion/sig.gif

www.heiseclan.de/geosig.gif
 
DarkLevi
super vielen vielen dank erstmal, soweits funktioniert es mim menu und den db's, dangöööööö

die rechte hab ich jetzt in "MU" geändert, aber wo und wie hinterlege ich die denn?

weil so kommt jetzt verständlicherweise "Use of undefined constant MU_ADMIN - assumed 'MU_ADMIN'" wo mussn da die def hin? Hilfe

vielen dank schonmal
 
DarkLevi
ich glaub wir haben uns da jetzt etwas missverstanden, ich hab jetzt:

in der menu-file:

if (!checkrights("MU") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("error.php?id=1"); }


und in der fusion:

$inf_adminpanel[1] = array(
   "title" => $locale['704'],
   "image" => "image.gif",
   "panel" => "admin/musik_admin.php",
   "rights" => "MU"
);


stehen
und nu kommt


 Use of undefined constant MU_ADMIN - assumed 'MU_ADMIN' in /***/***/***/***/infusions/musik/admin/musik_admin.php on line 27


also muss ich ihm ja sagen was "MU_ADMIN" ist, und da happerts

oder hab ich des jetzte komplett falsch verstanden?

EDIT: kommt in der admin_menu vor:


// Check: Admin Rights
if (!MU_ADMIN) redirect("error.php?id=2");

Bearbeitet von DarkLevi am 01.02.2010 00000002 16:17
 
emblinux
Das mit dem MU ist soweit ok. Nur was du da mit dem MU_ADMIN gemacht hast verstehe ich nicht ganz. Wie hieß denn die Variable davor, ich gehe mal davon aus, dass du nur wieder was umbenannt hast.
Das Lernen ist wie ein Meer ohne Ufer. Konfuzius

Alles wird Gut!

KEIN Support per Mail, ICQ oder PN !
www.heiseclan.de/fusion/sig.gif

www.heiseclan.de/geosig.gif
 
DarkLevi

Zitat

DarkLevi schrieb:
EDIT: kommt in der admin_menu vor:


// Check: Admin Rights
if (!MU_ADMIN) redirect("error.php?id=2");


ok ok hat sich erledigt *rofl*

hab die zeile schlicht und ergreifend gelöscht und schon gings *dau*

danke euch
 
DarkLevi

Zitat

DarkLevi schrieb:

Zitat

DarkLevi schrieb:
EDIT: kommt in der admin_menu vor:


// Check: Admin Rights
if (!MU_ADMIN) redirect("error.php?id=2");


ok ok hat sich erledigt *rofl*

hab die zeile schlicht und ergreifend gelöscht und schon gings *dau*

danke euch


EDIT: hab dass alles auf dem guestbook von basti rumgebastelt, und bei dem war die zeie als "GB_ADMIN" drinn, deswegen hab ich die übernommen, hab eh net verstanen wofür die gut sein soll

EDIT2: kann den thread leider nicht als gelöst markieren, da komm ich immer auf ne andere seite eures forums
Bearbeitet von DarkLevi am 01.02.2010 00000002 17:10
 
Springe ins Forum:

 Ähnliche Themen 

TEST
Thema Forum Antworten Letzter Beitrag
Breuchte ma eure hilfe bei der suche einer seite Games, Spiele & Co. 2 18.09.2016 00000009 15:23
neue seite ohne menue HTML, CSS 4 31.05.2016 00000005 07:38
Eigene Seite macht keine Absätze. Allgemeine Diskussionen 2 02.11.2015 00000011 17:09
PHP auf eine externe seite ohne Iframe einbinden Allgemeine Support Fragen 3 05.08.2012 00000008 12:10
Beim parsen der seite is ein fehler aufgetreten Allgemeine Support Fragen 6 17.06.2012 00000006 08:58