31. October 2020 - Zeit
31
Guten Tag
10
GAST
2020
Gebt gut acht, heute ist Halloween
Thread Verfasser: Catzenjaeger
Thread ID: 874
Thread Info
Es gibt 11 Beiträge zu diesem Thema, und es wurde 3943 Mal angesehen.
 Thema drucken
Infusion bei Infuse Datenbank schon füllen
Catzenjaeger
I habe in meiner infusion.php schon einige Datem eingetragen die ich gerne schon bei Installation in die Datenbank geschrieben haben möchte. Allerdings bekomme ich Fehler wenn ich das, was ich hier im Code auskommentiert habe drinlasse.

wisst ihr warum? irgendwo muss ein Fehler sein. Die Tabelle Settings wird nicht befüllt und ich weiss nicht warum.

Hier der Code (der auskommentierte Teil macht Probleme ..

Code 

<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: infusion.php
| Author: Khalid545
| URL: http://khalidb.co.cc/
| E-Mail: khalidd545@gmail.com
|
| Modification: Catzenjaeger
| URL: www.aliencollectors.com
| E-Mail: admin@aliencollectors.com
+--------------------------------------------------------+
| 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).
+--------------------------------------------------------*/

if (!defined("IN_FUSION")) { die("Access Denied"); }
include "infusion_db.php";

$inf_title = $locale['INF_TITLE'];
$inf_description = $locale['INF_DESC'];
$inf_developer = "Catzenjaeger";
$inf_email = "admin@aliencollectors.com";
$inf_weburl = "http://www.aliencollectors.com";



$inf_newtable[1] = DB_FIGURE_CATS." (
      figure_cat_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_cat_name varchar(100) NOT NULL DEFAULT '',
      figure_cat_description text NOT NULL,
      figure_cat_sorting varchar(50) NOT NULL DEFAULT 'download_title ASC',
      figure_cat_access tinyint(3) unsigned NOT NULL DEFAULT '0',
      figure_cat_parent mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_cat_items int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (figure_cat_id)
   ) ENGINE=MyISAM;";
$inf_droptable[1] = DB_FIGURE_CATS;
   
$inf_newtable[2] = DB_FIGURE." (
      figure_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_title varchar(200) NOT NULL DEFAULT '',
      figure_submanufacturer varchar(200) NOT NULL DEFAULT '',
      figure_brand varchar(200) NOT NULL DEFAULT '',
      figure_series varchar(200) NOT NULL DEFAULT '',
      figure_variant varchar(200) NOT NULL DEFAULT '',
      figure_scale varchar(200) NOT NULL DEFAULT '',
      figure_weight varchar(200) NOT NULL DEFAULT '',
      figure_height varchar(200) NOT NULL DEFAULT '',
      figure_width varchar(200) NOT NULL DEFAULT '',
      figure_depth varchar(200) NOT NULL DEFAULT '',
      figure_material varchar(200) NOT NULL DEFAULT '',
      figure_poa varchar(200) NOT NULL DEFAULT '',
      figure_packaging varchar(200) NOT NULL DEFAULT '',
      figure_retailprice varchar(200) NOT NULL DEFAULT '',
      figure_usedprice varchar(200) NOT NULL DEFAULT '',   
      figure_limitation tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
      figure_editionsize varchar(200) NOT NULL DEFAULT '',
      figure_artists varchar(200) NOT NULL DEFAULT '',
      figure_cat mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_accessories text NOT NULL,
      figure_description text NOT NULL,
      figure_url varchar(200) NOT NULL DEFAULT '',
      figure_file varchar(100) NOT NULL DEFAULT '',
      figure_image varchar(100) NOT NULL DEFAULT '',
      figure_name mediumint(8) unsigned NOT NULL DEFAULT '1',
      figure_filesize varchar(20) NOT NULL DEFAULT '',
      figure_datestamp int(10) unsigned NOT NULL DEFAULT '0',
      figure_author varchar(200) NOT NULL DEFAULT '',
      figure_country varchar(200) NOT NULL DEFAULT '',
      figure_manufacturer varchar(200) NOT NULL DEFAULT '',
      figure_pubdate varchar(200) NOT NULL DEFAULT '',
      figure_count int(10) unsigned NOT NULL DEFAULT '0',
      figure_allow_comments tinyint(1) unsigned NOT NULL DEFAULT '1',
      figure_allow_ratings tinyint(1) unsigned NOT NULL DEFAULT '1',
      KEY figure_datestamp (figure_datestamp),
      KEY figure_count (figure_count),
      PRIMARY KEY (figure_id)
   ) ENGINE=MyISAM;";
$inf_droptable[2] = DB_FIGURE;
   
$inf_newtable[3] = DB_FIGURE_SETTINGS." (
      figure_settings_name varchar(200) NOT NULL DEFAULT '',
      figure_settings_value text NOT NULL
   ) ENGINE=MyISAM;";
$inf_droptable[3] = DB_FIGURE_SETTINGS;
   
$inf_newtable[4] = DB_FIGURE_SUBMISSIONS." (
      submit_id mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
      submit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
      submit_datestamp INT(10) UNSIGNED DEFAULT '0' NOT NULL,
      submit_criteria TEXT NOT NULL,
      PRIMARY KEY (submit_id)
   ) ENGINE=MyISAM;";
$inf_droptable[4] = DB_FIGURE_SUBMISSIONS;

$inf_newtable[5] = DB_FIGURE_REPORTS." (
        report_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
        report_datestamp int(10) unsigned NOT NULL DEFAULT '0',
      report_name varchar(50) NOT NULL DEFAULT '1',
      report_ip varchar(20) NOT NULL DEFAULT '0.0.0.0',
      report_figure mediumint(8) unsigned NOT NULL DEFAULT '1',
        PRIMARY KEY (report_id)
    ) ENGINE=MyISAM;";
$inf_droptable[5] = DB_FIGURE_REPORTS;

$inf_newtable[6] = DB_FIGURE_MANUFACTURERS." (
      figure_manufacturer_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_manufacturer_name varchar(100) NOT NULL DEFAULT '',
      figure_manufacturer_description text NOT NULL,
      figure_manufacturer_sorting varchar(50) NOT NULL DEFAULT 'download_title ASC',
      figure_manufacturer_access tinyint(3) unsigned NOT NULL DEFAULT '0',
      figure_manufacturer_parent mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_manufacturer_items int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (figure_manufacturer_id)
   ) ENGINE=MyISAM;";
$inf_droptable[6] = DB_FIGURE_MANUFACTURERS;

$inf_newtable[7] = DB_FIGURE_BRANDS." (
      figure_brand_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_brand_name varchar(100) NOT NULL DEFAULT '',
      figure_brand_description text NOT NULL,
      figure_brand_sorting varchar(50) NOT NULL DEFAULT 'download_title ASC',
      figure_brand_access tinyint(3) unsigned NOT NULL DEFAULT '0',
      figure_brand_parent mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_brand_items int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (figure_brand_id)
   ) ENGINE=MyISAM;";
$inf_droptable[7] = DB_FIGURE_BRANDS;

$inf_newtable[8] = DB_FIGURE_MATERIALS." (
      figure_material_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_material_name varchar(100) NOT NULL DEFAULT '',
      figure_material_description text NOT NULL,
      figure_material_sorting varchar(50) NOT NULL DEFAULT 'download_title ASC',
      figure_material_access tinyint(3) unsigned NOT NULL DEFAULT '0',
      figure_material_parent mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_material_items int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (figure_material_id)
   ) ENGINE=MyISAM;";
$inf_droptable[8] = DB_FIGURE_MATERIALS;

$inf_newtable[9] = DB_FIGURE_SCALES." (
      figure_scale_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      figure_scale_name varchar(100) NOT NULL DEFAULT '',
      figure_scale_description text NOT NULL,
      figure_scale_sorting varchar(50) NOT NULL DEFAULT 'download_title ASC',
      figure_scale_access tinyint(3) unsigned NOT NULL DEFAULT '0',
      figure_scale_parent mediumint(8) unsigned NOT NULL DEFAULT '0',
      figure_scale_items int(10) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (figure_scale_id)
   ) ENGINE=MyISAM;";
$inf_droptable[9] = DB_FIGURE_SCALES;


$inf_insertdbrow[1] = DB_FIGURE_SETTINGS." VALUES ('figure_max_b','150000');";
$inf_insertdbrow[2] = DB_FIGURE_SETTINGS." VALUES ('figure_per_page','10');";
$inf_insertdbrow[3] = DB_FIGURE_SETTINGS." VALUES ('figure_types','.pdf,.doc,.html,.htm,.prc,.pdb,.zip,.rar');";
$inf_insertdbrow[4] = DB_FIGURE_SETTINGS." VALUES ('figure_submit','1');";
$inf_insertdbrow[5] = DB_FIGURE_SETTINGS." VALUES ('guestdownload','1');";
$inf_insertdbrow[6] = DB_FIGURE_SETTINGS." VALUES ('subcats','0');";
$inf_insertdbrow[7] = DB_FIGURE_SETTINGS." VALUES ('display','0');";
$inf_insertdbrow[8] = DB_FIGURE_SETTINGS." VALUES ('figure_per_line','2');";
$inf_insertdbrow[9] = DB_FIGURE_SETTINGS." VALUES ('social_sharing','1');";
$inf_insertdbrow[10] = DB_FIGURE_SETTINGS." VALUES ('related','1');";
$inf_insertdbrow[11] = DB_FIGURE_SETTINGS." VALUES ('submanufacturers','0');";
$inf_insertdbrow[12] = DB_FIGURE_SETTINGS." VALUES ('subbrands','0');";
$inf_insertdbrow[13] = DB_FIGURE_SETTINGS." VALUES ('submaterials','0');";
$inf_insertdbrow[14] = DB_FIGURE_SETTINGS." VALUES ('subscales','0');";

/*
$inf_insertdbrow[1] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('1', 'Alien (1979)')";
$inf_insertdbrow[2] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('2', 'Aliens (1986)')";
$inf_insertdbrow[3] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('3', 'Alien 3 (1992)')";
$inf_insertdbrow[4] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('4', 'Alien: Resurrection (1997)')";
$inf_insertdbrow[5] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('5', 'Alien vs. Predator (2004)')";
$inf_insertdbrow[6] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('6', 'Aliens vs. Predator: Requiem (2007)')";
$inf_insertdbrow[7] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('7', 'Prometheus (2012)')";
$inf_insertdbrow[8] = DB_FIGURE_BRANDS." (figure_brand_id, figure_brand_name) VALUES ('8', 'Alien: Covenant (2017)')";

//$inf_insertdbrow[0] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('0', '- - -')";
$inf_insertdbrow[1] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('1', '01 Inch (2,54 cm)')";
$inf_insertdbrow[2] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('2', '02 Inch (5,08 cm)')";
$inf_insertdbrow[3] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('3', '03 Inch (7,62 cm)')";
$inf_insertdbrow[4] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('4', '04 Inch (9,00 cm)')";
$inf_insertdbrow[5] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('5', '05 Inch (12,70 cm)')";
$inf_insertdbrow[6] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('6', '06 Inch (15,24 cm)')";
$inf_insertdbrow[7] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('7', '07 Inch (17,78 cm)')";
$inf_insertdbrow[8] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('8', '08 Inch (20,32 cm)')";
$inf_insertdbrow[9] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('9', '09 Inch (22,86 cm)')";
$inf_insertdbrow[10] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('10', '10 Inch (25,40 cm)')";
$inf_insertdbrow[11] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('11', '11 Inch (27,94 cm)')";
$inf_insertdbrow[12] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('12', '12 Inch (30,48 cm)')";
$inf_insertdbrow[13] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('13', '13 Inch (33,02 cm)')";
$inf_insertdbrow[14] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('14', '14 Inch (35,56 cm)')";
$inf_insertdbrow[15] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('15', '15 Inch (38,10 cm)')";
$inf_insertdbrow[16] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('16', '16 Inch (40,64 cm)')";
$inf_insertdbrow[17] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('17', '17 Inch (43,18 cm)')";
$inf_insertdbrow[18] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('18', '18 Inch (45,72 cm)')";
$inf_insertdbrow[19] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('19', '19 Inch (48,26 cm)')";
$inf_insertdbrow[20] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('20', '20 Inch (50,80 cm)')";
$inf_insertdbrow[21] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('21', '21 Inch (53,34 cm)')";
$inf_insertdbrow[22] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('22', '22 Inch (55,88 cm)')";
$inf_insertdbrow[23] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('23', '23 Inch (58,42 cm)')";
$inf_insertdbrow[24] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('24', '24 Inch (60,96 cm)')";
$inf_insertdbrow[25] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('25', '25 Inch (63,50 cm)')";
$inf_insertdbrow[26] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('26', '26 Inch (66,04 cm)')";
$inf_insertdbrow[27] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('27', '27 Inch (68,58 cm)')";
$inf_insertdbrow[28] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('28', '28 Inch (71,12 cm)')";
$inf_insertdbrow[29] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('29', '29 Inch (73,66 cm)')";
$inf_insertdbrow[30] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('30', '30 Inch (76,20 cm)')";
$inf_insertdbrow[31] = DB_FIGURE_SCALES." (figure_scale_id, figure_scale_name) VALUES ('31', '- - -')";
*/
$inf_altertable[1] = DB_FIGURE_CATS." ADD figure_cat_parent mediumint(8) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[2] = DB_FIGURE." ADD figure_country varchar(200) NOT NULL DEFAULT ''";
$inf_altertable[3] = DB_FIGURE_CATS." ADD figure_cat_items int(10) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[4] = DB_FIGURE_MANUFACTURERS." ADD figure_manufacturer_parent mediumint(8) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[5] = DB_FIGURE_MANUFACTURERS." ADD figure_manufacturer_items int(10) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[4] = DB_FIGURE_BRANDS." ADD figure_brand_parent mediumint(8) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[5] = DB_FIGURE_BRANDS." ADD figure_brand_items int(10) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[6] = DB_FIGURE_MATERIALS." ADD figure_material_parent mediumint(8) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[7] = DB_FIGURE_MATERIALS." ADD figure_material_items int(10) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[8] = DB_FIGURE_SCALES." ADD figure_scale_parent mediumint(8) unsigned NOT NULL DEFAULT '0'";
$inf_altertable[9] = DB_FIGURE_SCALES." ADD figure_scale_items int(10) unsigned NOT NULL DEFAULT '0'";


if (isset($_GET['defuse']) && isnum($_GET['defuse'])) {
   $result = dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_type='BO'");
   $result = dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_type='B'");
}

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

$inf_sitelink[2] = array(
   "title" => $locale['figure_521'],
   "url" => "submit.php",
   "visibility" => "101"
);

$inf_adminpanel[1] = array(
   "title" => $locale['INF_ADMIN'],
   "image" => "image.gif",
   "panel" => "figure_admin.php",
   "rights" => "BOL"
);
?>

 
Rolly8-HL
Du hörst auf mit
$inf_insertdbrow[14] = DB_FIGURE_SETTINGS."
und willst weitermachen mit
$inf_insertdbrow[1] = DB_FIGURE_BRANDS."

Der DB Name hat damit nichts zu tun, die Nummerische Reihenfolge muss eingehalten werden, aber warum so Umständlich, habe das bei mir so gemacht.

Code 

$inf_insertdbrow[3] = DB_R8HL_MINI_WALL_PIN." (pinn_pinn_id, pinn_pinn_group_name, pinn_pinn_group_description, pinn_pinn_message, pinn_pinn_datestamp, pinn_pinn_visibility, pinn_pinn_language) VALUES
(1, '', '', '/send ', '', 0, '".$settings['locale']."'),
(2, '', '', '/me ', '', 101, '".$settings['locale']."'),
(3, '', '', '/news ', '', 102, '".$settings['locale']."'),
(4, '', '', '/info ', '', 103, '".$settings['locale']."')
";



Damit werden 4 Datensätze angelegt genau so wie von mir vorgegeben.
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
 
Catzenjaeger
cool danke das wars ich habe alles durchnummeriert ejtzt scheint alles drin Smile

dein text kappiere ich nicht so und finde ich unübersichtlich ... vielleicht wenn ich mehr erfahrung habe Smile

Andere Frage habe ich noch: Ich habe die ganze Infusion jetzt so umgebaut das ich viel vorgeben kann (das kann ich alles in der Adminisatration einstellen und vorgeben)

Aber was mache ich zB im folgenden Fall:

Ich gebe zB die Bewegungspunkte die eine Actionfigur hat vor. Nun aber hat die Figur die jemand einreicht nicht diesen wert. Kann man auch so machen das der Einsender auswählen kann und wenn der wert nicht dabei ist selbst eintragen kann? Also ich meine praktisch soll im feld schon ein wert drinstehen. Aber der soll überschreibbar sein.



Noch ein Frage: ich habe in der DB

01 Inch (2,54 cm) Public Edit - Delete
02 Inch (5,08 cm) Public Edit - Delete
03 Inch (7,62 cm) Public Edit - Delete
04 Inch (9,00 cm) Public Edit - Delete
05 Inch (12,70 cm) Public Edit - Delete
06 Inch (15,24 cm) Public Edit - Delete
07 Inch (17,78 cm) Public Edit - Delete
08 Inch (20,32 cm) Public Edit - Delete

wenn ich aber die 01 oder 02 nur als 1 oder 2 schreibe rutzscht das ganze durcheinander in der sortierung. Wie jkann ich das amchen das die reihen folge trotzdem stimmt aber nur 1 oder 2 steht?
 
Rolly8-HL
Zitat: dein text kappiere ich nicht so und finde ich unübersichtlich


Gehe mal in Dein PHP MyAdmin und Exportiere Dir den Datensatz der Tabelle DB_FIGURE_BRANDS als sql und schaue Dir mal die Struktur an.
Da wirst Du den selbe unübersichtlichen Aufbau wieder finden.
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
 
Catzenjaeger
also muss ich immer 01 schreiben - damn
 
Rolly8-HL
Wenn Du die Sortierung auf figure_scale_name anwendest? danke mal ja.
Versuche doch mal nach figure_scale_id zu sortieren?
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
 
Wemi
Warum wollt ihr einen Datensatz in die DB schreiben für ein auto_increment Feld?

Wenn ihr das weglasst. also überall dort wo id steht, dann überlasst ihr der Datenbank den richtigen Eintrag. Und ihr seit auf der sicheren Seite, dass diese einmalige ID nicht doppelt vorkommt und das Script einen Fehler auswirft.

Für die settings gibt es bei PHP-Fusion eine eigene Tabelle und auch entsprechende Funktionen.
Z.B.

Code 

$inf_insertdbrow[] = DB_SETTINGS_INF." (settings_name, settings_value, settings_inf) VALUES('link_follow', '1', 'wm_gastbuch')";



Dann wäre noch die Frage, ob für V7 oder V9. Für die V9 kann man noch einiges mehr an Code sparen. Z.B. wäre die Durchnummerierung überflüssig, also die Zahlen in den eckigen Klammern.

Dann gewöhnt Euch gerade bei der V9 gleich an bei der Erstellung der Tabellen

Code 

ENGINE=MyISAM DEFAULT CHARSET=UTF8 COLLATE=utf8_unicode_ci


zu schreiben, damit es nicht bei einer falschen Grundeinstellung von MySQL zu Umlautfehlern kommt.

Das hier sollte 4 Buchasteben enthalten,

Code 

"rights" => "BOL"


Ist mal bei der V7 eingeführt worden, drei und zweistellige sind für den Core vorbehalten. Es darf hier keine doppelten Einträge innerhalb einer Installation geben.

Code 

"rights" => "CAFI"

wäre für dich eine Variante (Catzenjäger Figures)

Wird die Sprachdatei in der infusion_db.php geladen?
Wenn nicht dann fehlt dies hier auch.

Und folgendes fehlt eigentlich auch noch.

Code 

$inf_folder = "gastbuch_panel";


"Es geht hier um die Frage, ob die Menschheit ohne Religion besser dastünde. Und ich sagte: ja" Ben Moore
 
Catzenjaeger
also am beispiel:
das geht nicht.

wenn ich das hier in mienen infudsion packe bleibt die figure.php weiss

/*


$inf_insertdbrow[141] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', '1-1 Scale')";
$inf_insertdbrow[142] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', '1-2 Scale')";
$inf_insertdbrow[143] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', '1-4 Scale')";
$inf_insertdbrow[144] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', '1-6 Scale')";
$inf_insertdbrow[145] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Actionfigures')";
$inf_insertdbrow[146] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Bootlegs')";
$inf_insertdbrow[147] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Busts')";
$inf_insertdbrow[148] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Dioramas')";
$inf_insertdbrow[149] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Garage Kits')";
$inf_insertdbrow[150] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Jumbo Kenner')";
$inf_insertdbrow[151] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Maquettes')";
$inf_insertdbrow[152] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Merchandise')";
$inf_insertdbrow[153] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Model Kits')";
$inf_insertdbrow[154] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Mini and Trade Figures')";
$inf_insertdbrow[155] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Plush')";
$inf_insertdbrow[156] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Promotion')";
$inf_insertdbrow[157] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Prop Replicas')";
$inf_insertdbrow[158] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Statues')";
$inf_insertdbrow[159] = DB_FIGURE_CATS." (figure_cat_id, figure_cat_name) VALUES ('', 'Other-Unknown')";

*/


hier der code der figure_cats.php

Code 

<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: figure_cats.php
| URL: http://khalidb.co.cc/
| E-Mail: khalidd545@gmail.com 
| URL: http://khalidb.co.cc/
|
| Modification: Catzenjaeger
| URL: www.aliencollectors.com
| E-Mail: admin@aliencollectors.com
|
| Original file:  By 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";
require_once THEMES."templates/admin_header.php";
include "../infusion_db.php";

if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }

if (isset($_GET['status']) && !isset($message)) {
   if ($_GET['status'] == "sn") {
      $message = $locale['figure_210'];
   } elseif ($_GET['status'] == "su") {
      $message = $locale['figure_211'];
   } elseif ($_GET['status'] == "deln") {
      $message = $locale['figure_212']."<br />\n<span class='small'>".$locale['figure_213']."</span>";
   } elseif ($_GET['status'] == "dely") {
      $message = $locale['figure_214'];
   }
   if ($message) {   echo "<div id='close-message'><div class='admin-message'>".$message."</div></div>\n"; }
}

if ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['cat_id']) && isnum($_GET['cat_id']))) {
   $result = dbquery("SELECT * FROM ".DB_FIGURE." WHERE figure_cat='".$_GET['cat_id']."'");
   if (dbrows($result) != 0) {
      redirect(FUSION_SELF.$aidlink."&status=deln");
   } else {
      $result = dbquery("DELETE FROM ".DB_FIGURE_CATS." WHERE figure_cat_id='".$_GET['cat_id']."'");
      redirect(FUSION_SELF.$aidlink."&status=dely");
   }
} else {
   if (isset($_POST['save_cat'])) {
      $cat_name = stripinput($_POST['cat_name']);
      $cat_description = stripinput($_POST['cat_description']);
      $cat_parent = isnum($_POST['cat_parent']) ? $_POST['cat_parent'] : "0";
      $cat_access = isnum($_POST['cat_access']) ? $_POST['cat_access'] : "0";
      if (isnum($_POST['cat_sort_by']) && $_POST['cat_sort_by'] == "1") {
         $cat_sorting = "figure_id ".($_POST['cat_sort_order'] == "ASC" ? "ASC" : "DESC");
      } else if (isnum($_POST['cat_sort_by']) && $_POST['cat_sort_by'] == "2") {
         $cat_sorting = "figure_title ".($_POST['cat_sort_order'] == "ASC" ? "ASC" : "DESC");
      } else if (isnum($_POST['cat_sort_by']) && $_POST['cat_sort_by'] == "3") {
         $cat_sorting = "figure_datestamp ".($_POST['cat_sort_order'] == "ASC" ? "ASC" : "DESC");
      } else {
         $cat_sorting = "figure_title ASC";
      }
      if ($cat_name) {
         if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['cat_id']) && isnum($_GET['cat_id']))) {
            $result = dbquery("UPDATE ".DB_FIGURE_CATS." SET figure_cat_name='$cat_name', figure_cat_parent='$cat_parent', figure_cat_description='$cat_description', figure_cat_sorting='$cat_sorting', figure_cat_access='$cat_access' WHERE figure_cat_id='".$_GET['cat_id']."'");
            redirect(FUSION_SELF.$aidlink."&status=su");
         } else {
            $result = dbquery("INSERT INTO ".DB_FIGURE_CATS." (figure_cat_name, figure_cat_description, figure_cat_sorting, figure_cat_access, figure_cat_parent) VALUES('$cat_name', '$cat_description', '$cat_sorting', '$cat_access', '$cat_parent')");
            redirect(FUSION_SELF.$aidlink."&status=sn");
         }
      } else {
         redirect(FUSION_SELF.$aidlink);
      }
   }
   if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['cat_id']) && isnum($_GET['cat_id']))) {
      $result = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_id='".$_GET['cat_id']."'");
      if (dbrows($result)) {
         $data = dbarray($result);
         $cat_name = $data['figure_cat_name'];
         $cat_description = $data['figure_cat_description'];
         $cat_sorting = explode(" ", $data['figure_cat_sorting']);
         $cat_parent = $data['figure_cat_parent'];
         if ($cat_sorting[0] == "figure_id") { $cat_sort_by = "1"; }
         if ($cat_sorting[0] == "figure_title") { $cat_sort_by = "2"; }
         if ($cat_sorting[0] == "figure_datestamp") { $cat_sort_by = "3"; }
         $cat_sort_order = $cat_sorting[1];
         $cat_access = $data['figure_cat_access'];
         $formaction = FUSION_SELF.$aidlink."&amp;action=edit&amp;cat_id=".$data['figure_cat_id'];
         opentable($locale['figure_200']);
      } else {
         redirect(FUSION_SELF.$aidlink);
      }
   } else {
      $cat_name = "";
      $cat_description = "";
      $cat_sort_by = "figure_title";
      $cat_sort_order = "ASC";
      $cat_parent = "";
      $cat_access = "";
      $formaction = FUSION_SELF.$aidlink;
      opentable($locale['figure_201']);
   }
   $user_groups = getusergroups(); $access_opts = ""; $sel = "";
   while(list($key, $user_group) = each($user_groups)){
      $sel = ($cat_access == $user_group['0'] ? " selected='selected'" : "");
      $access_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
   }
   $editlist = ""; if (isset($_GET['action']) && $_GET['action'] == "edit") { $parent = $data['figure_cat_parent']; } else { $parent = ""; }
   $result2 = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='0' ORDER BY figure_cat_name");
   if (dbrows($result2) != 0) {
      $editlist .= "<option value='0'></option>\n";
      while ($data2 = dbarray($result2)) {
         $editlist .= menu_subcats($data2['figure_cat_id'], $data2['figure_cat_name'],1);
      }
   }
   echo "<form name='addcat' method='post' action='$formaction'>\n";
   echo "<table cellpadding='0' cellspacing='0' width='400' class='center'>\n<tr>\n";
   echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['figure_220']."</td>\n";
   echo "<td class='tbl'><input type='text' name='cat_name' value='".$cat_name."' class='textbox' style='width:200px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   require_once INCLUDES."bbcode_include.php";
   echo "<td width='1%' class='tbl' style='vertical-align:top;white-space:nowrap'>".$locale['figure_221']."</td>\n";
   echo "<td class='tbl'><textarea name='cat_description' cols='70' rows='6' class='textbox' style='width:360px'>".$cat_description."</textarea><br />";
   echo display_bbcodes("360px", "cat_description", "addcat");
   echo "</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['figure_222']."</td>\n";
   echo "<td class='tbl'><select name='cat_sort_by' class='textbox'>\n";
   echo "<option value='1'".($cat_sort_by == "1" ? " selected='selected'" : "").">".$locale['figure_223']."</option>\n";
   echo "<option value='2'".($cat_sort_by == "2" ? " selected='selected'" : "").">".$locale['figure_224']."</option>\n";
   echo "<option value='3'".($cat_sort_by == "3" ? " selected='selected'" : "").">".$locale['figure_225']."</option>\n";
   echo "</select> - <select name='cat_sort_order' class='textbox'>\n";
   echo "<option value='ASC'".($cat_sort_order == "ASC" ? " selected='selected'" : "").">".$locale['figure_226']."</option>\n";
   echo "<option value='DESC'".($cat_sort_order == "DESC" ? " selected='selected'" : "").">".$locale['figure_227']."</option>\n";
   echo "</select></td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td width='1%' class='tbl' style='white-space:nowrap'>".$locale['figure_228']."</td>\n";
   echo "<td class='tbl'><select name='cat_access' class='textbox' style='width:150px;'>\n".$access_opts."</select></td>\n";
   echo "</tr>\n<tr>\n";
   if ($asettings['subcats']) {
      echo "<td width='80' class='tbl'>".$locale['figure_230']."</td>\n";
      echo "<td class='tbl'><select name='cat_parent' class='textbox'>\n".$editlist."</select></td>\n";
      echo "</tr>\n<tr>\n";
   } else echo "<input type='hidden' name='cat_parent' value='".$parent."' />";
   echo "<td align='center' colspan='2' class='tbl'>\n";
   echo "<input type='submit' name='save_cat' value='".$locale['figure_229']."' class='button' /></td>\n";
   echo "</tr>\n</table>\n</form>\n";
   closetable();

   opentable($locale['figure_202']);
   echo "<table width='400' cellspacing='1' cellpadding='0' class='tbl-border center'>\n";
   $result = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='0' ORDER BY figure_cat_name");
   if (dbrows($result) != 0) {
      $i = 0;
      echo "<tr>\n";
      echo "<td class='tbl2'>".$locale['figure_123']."</td>\n";
      echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['figure_241']."</td>\n";
      echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>".$locale['figure_141']."</td>\n";
      echo "</tr>\n";
      while ($data = dbarray($result)) {
         $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
         echo "<tr>\n";
         echo "<td class='".$cell_color."'>".$data['figure_cat_name'];
         if ($data['figure_cat_description']) { echo "<br /><span class='small'>".trimlink($data['figure_cat_description'], 45)."</span></td>\n"; }
         echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getgroupname($data['figure_cat_access'])."</td>\n";
         echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;cat_id=".$data['figure_cat_id']."'>".$locale['figure_142']."</a> -\n";
         echo "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;cat_id=".$data['figure_cat_id']."' onclick=\"return confirm('".$locale['figure_250']."');\">".$locale['figure_131']."</a></td>\n";
         echo "</tr>\n";
         echo subcats($data['figure_cat_id'], 1);
         $i++;
      }
      echo "</table>\n";
   } else {
      echo "<tr><td align='center' class='tbl1'>".$locale['figure_245']."</td></tr>\n</table>\n";
   }
   closetable();
}

function subcats($id, $level) {
   global $aidlink, $locale, $data, $cell_color;
   $sublist = "";
   $sresult[$id] = dbquery("SELECT figure_cat_id, figure_cat_name, figure_cat_description, figure_cat_access FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='".$id."' ORDER BY figure_cat_name");
   if (dbrows($sresult[$id]) != 0) {
      while ($sdata[$id] = dbarray($sresult[$id])) {
         $sublist .= "<tr>\n";
         $sublist .="<td class='$cell_color'>".str_repeat("&mdash; ",$level)." ".$sdata[$id]['figure_cat_name']."<br />\n";
         $sublist .= "<span class='small'>".trimlink($sdata[$id]['figure_cat_description'], 45)."</span></td>\n";
         $sublist .= "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getgroupname($sdata[$id]['figure_cat_access'])."</td>\n";
         $sublist .= "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;cat_id=".$sdata[$id]['figure_cat_id']."'>".$locale['figure_142']."</a> -\n";
         $sublist .= "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;cat_id=".$sdata[$id]['figure_cat_id']."' onclick=\"return confirm('".$locale['figure_250']."');\">".$locale['figure_131']."</a></td>\n";
         $sublist .= "</tr>\n";
         $sublist .= subcats($sdata[$id]['figure_cat_id'], $level+1);
      }
   }
   return $sublist;
}

function menu_subcats($id, $name, $level) {
   global $parent; $sel = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $sel = ($parent == $id ? " selected='selected'" : ""); }
   $list = "<option value='".$id."'$sel>".str_repeat("&nbsp;&nbsp;&nbsp;",$level-1)." ".$name."</option>\n";
   $sresult[$id] = dbquery("SELECT figure_cat_id, figure_cat_name FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='".$id."' ORDER BY figure_cat_name");
   if (dbrows($sresult[$id]) != 0) {
      while ($sdata[$id] = dbarray($sresult[$id])) {
         $list .= menu_subcats($sdata[$id]['figure_cat_id'], $sdata[$id]['figure_cat_name'], $level+1);
      }
   }
   return $list;
}

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


Bearbeitet von Catzenjaeger am 08.05.2016 um 03:18
 
Rolly8-HL
if (!checkrights("BOL") muss mit Deiner Infusion übereinstimmen sonst bekommst Du nur die zu sehen redirect(BASEDIR."index.php" und die ist Weiß weil ohne Inhalt.

Code 

/*
diesr Inhalt kann nicht angelegt werden
*/


Bearbeitet von Rolly8-HL am 08.05.2016 um 12:04
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
 
Catzenjaeger
Zitat: Rolly8-HL schrieb:

if (!checkrights("BOL") muss mit Deiner Infusion übereinstimmen sonst bekommst Du nur die zu sehen redirect(BASEDIR."index.php" und die ist Weiß weil ohne Inhalt.

Code 

/*
diesr Inhalt kann nicht angelegt werden
*/



checkrights ist überall ok

if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
 
Rolly8-HL
Zitat: Ist mal bei der V7 eingeführt worden, drei und zweistellige sind für den Core vorbehalten. Es darf hier keine doppelten Einträge innerhalb einer Installation geben.


Dir wurde der Rat gegeben es mit 4 Zeichen zu versehen vielleicht hilft das ja, selbst benutze ich Grundsätzlich 4.
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
 
Springe ins Forum: