PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Hilfe beim include
Beitrag
<blockquote data-quote="ackermaennchen" data-source="post: 2512842" data-attributes="member: 4585"><p>Hallo Freunde der php Strings <img src="/styles/default/xenforo/smilies/biggrin.gif" class="smilie" loading="lazy" alt=":D" title="Big Grin :D" data-shortname=":D" /></p><p></p><p>Bin mal wieder am verzweifeln. Folgendes, Ich möchte auf meiner startseite gerne einen Blog für einen newsfeed einfügen.</p><p></p><p>der sich hier befindet: </p><p></p><p>Bisher habe ich auf meiner index.php im Root eine start.php eingebunden, die als erstes geladen werden soll. In der start.php wurde per iframe ein externer Blog geladen (Blogger) hat super funktioniert.</p><p>Da sich der iframe aber nicht dynamisch angepasst hat sondern ne feste größe hatte, war es irgendwie lästig, mit jeder news die ich veröffentlicht habe auch wieder den Iframe anzupassen um unötige scrollerei zu vermeiden.</p><p></p><p>So nun hab ich meine start.php soweit abgeändert das ich den iframe rausgeschmissen habe und nun den Blog oben intigrieren möchte.</p><p></p><p>[php]<?php include"/flatpress-1.0.2/index.php"; ?>[/php]</p><p></p><p>Der Code der index lautet:</p><p>[html]<body></p><p><div id="header"></p><p><h1><a href="http://www.tc.lofer.at" title="www.tc.lofer.at" class="notetxt">www.tc.lofer.at</a></h1></p><p> <?php include "navi_top.php"; ?></p><p> <?php include "navi.php"; ?></p><p></div></p><p><div id="contentcontainer"></p><p><div id="content"></p><p> </p><p> <?php</p><p>ini_set('display_errors', 1);</p><p>if(!isset($_GET['page'])){</p><p></p><p>$checkpage = "start";</p><p></p><p>}else{</p><p></p><p>$erlaubt = array( "start" => 1,</p><p> "termine" => 1,</p><p> "vorstand" => 1,</p><p> "bespannung" => 1,</p><p> "impressum"=>1,</p><p> "sitemap"=>1,</p><p> "kontakt"=>1,</p><p> "mitglied"=>1,</p><p> "gebuehr"=>1,</p><p> "trainer"=>1,</p><p> "/flatpress-1.0.2/index"=>1,);</p><p>$checkpage = isset($erlaubt[$_GET["page"]]) ? $_GET["page"] : "start";</p><p>}</p><p>include ($checkpage .".php");</p><p>?></p><p></div></div></p><p><div id="space" class="clear"></div></p><p><div id="footercontainer" class="clear"></p><p><div id="footer"></div></p><p></div></p><p><script type="text/javascript" src="http://www.tc.lofer.at/stat/track.php?mode=js"></script></p><p><noscript><img src="http://www.tc.lofer.at/stat/track_noscript.php" border="0" alt="" width="1" height="1"></noscript></p><p></body>[/html]</p><p></p><p>Rufe ich nun diie seite auf bekomme ich folgende Fehlermeldung:</p><p></p><p><strong>Warning</strong>: include(/flatpress-1.0.2/index.php) []: failed to open stream: No such file or directory in <strong>/usr/home/</strong> on line <strong>9</strong></p><p></p><p><strong>Warning</strong>: include() []: Failed opening '/flatpress-1.0.2/index.php' for inclusion (include_path='.:/usr/local/share/pear') in <strong>/usr/home/</strong> on line <strong>9</strong></p><p></p><p>Änder ich den Pfad in der start php. </p><p>in </p><p>[php]<?php include"flatpress-1.0.2/index.php"; ?>[/php]</p><p>Dann ruft er nicht mehr meine index.php im root auf, sondern die setup.php aus dem flatpress. Die er aber nicht finden kann, obwohl sie auf dem server liegt. Bzw er sucht die setup.php im root wo sie ja auch nicht ist.</p><p></p><p>ich füge mal noch den Code der index.php vom Blog ein:</p><p>[php]<?php</p><p> </p><p> include 'defaults.php';</p><p> include INCLUDES_DIR . 'includes.php';</p><p> include SMARTY_DIR . 'SmartyValidate.class.php';</p><p> </p><p> define('MOD_INDEX', 1);</p><p></p><p></p><p> if (!file_exists(CONFIG_FILE))</p><p> utils_redirect('setup.php');</p><p></p><p></p><p></p><p> /* local function defines follow */</p><p> </p><p> function index_permatitle($val, $sep) {</p><p> global $fpdb;</p><p> $q =& $fpdb->getQuery();</p><p> list($id, $e) = @$q->peekEntry();</p><p> if ($e)</p><p> return "{$e['subject']} {$sep} $val ";</p><p> else return $val;</p><p> }</p><p></p><p> function index_gentitle($val, $sep) {</p><p> global $title;</p><p> return "$val $sep $title";</p><p> }</p><p></p><p> function index_404error() {</p><p> global $smarty, $lang;</p><p> @utils_status_header(404);</p><p> $module='default.tpl';</p><p> </p><p> $smarty->assign('subject', $lang['404error']['subject']);</p><p> $smarty->assign('content', $lang['404error']['content']);</p><p></p><p></p><p> $smarty->assign('rawcontent', true);</p><p></p><p> return $module;</p><p> }</p><p> </p><p> </p><p> function index_singlepost(&$params, &$module) {</p><p> </p><p> global $fpdb, $theme, $fp_params;</p><p> </p><p> $params['id'] = $fp_params['entry'];</p><p> $params['fullparse']=true;</p><p> $fpdb->query($params);</p><p></p><p> if (@$theme['hassingle'])</p><p> $module='single.tpl'; </p><p> </p><p> add_filter('wp_title', 'index_permatitle', 10, 2);</p><p> </p><p> if (isset($fp_params['comments'])) {</p><p> </p><p> $module = 'comments.tpl';</p><p> $params['comments'] = true;</p><p> </p><p> include('comments.php');</p><p> </p><p> }</p><p> </p><p> }</p><p> </p><p> function index_staticpage($page, $explicit_req, &$params, &$module) {</p><p> </p><p> global $smarty, $title;</p><p></p><p> if (static_exists($page)) {</p><p> $arr = static_parse($page);</p><p> $title = $arr['subject'];</p><p></p><p> if ($explicit_req)</p><p> add_filter('wp_title', 'index_gentitle', 1, 2);</p><p> </p><p> $smarty->assign('static_id', $page);</p><p> $smarty->assign('static_page',$arr);</p><p> </p><p> return $module='static.tpl';</p><p> }</p><p> </p><p> if (user_loggedin())</p><p> utils_redirect('admin.php?p=static&action=write&page='.$page);</p><p> else</p><p> $module = index_404error();</p><p></p><p> return $module;</p><p> </p><p> }</p><p> </p><p> function index_showposts(&$params, &$module) {</p><p> </p><p> global $fp_params;</p><p> </p><p> if (isset($fp_params['d']) && $fp_params['d'])</p><p> $params['d'] = $fp_params['d'];</p><p> </p><p> if (isset($fp_params['m']) && $fp_params['m'])</p><p> $params['m'] = $fp_params['m'];</p><p> </p><p> if (isset($fp_params['y']) && $fp_params['y'])</p><p> $params['y'] = $fp_params['y'];</p><p> </p><p> if (isset($fp_params['start']) && $fp_params['start'])</p><p> $params['start'] = intval($fp_params['start']);</p><p> </p><p> if (isset($fp_params['count']) && $fp_params['count'])</p><p> $params['count'] = intval($fp_params['count']);</p><p> if (isset($fp_params['category']) && is_numeric($fp_params['category']))</p><p> $params['category'] = intval($fp_params['category']);</p><p> </p><p> if (isset($fp_params['cat']) && is_numeric($fp_params['cat']))</p><p> $params['category'] = intval($fp_params['cat']);</p><p> </p><p> if (isset($fp_params['not']) && is_numeric($fp_params['not']))</p><p> $params['exclude'] = intval($fp_params['not']);</p><p> </p><p> </p><p> if (isset($fp_params['random'])) {</p><p> if (empty($fp_params['random']))</p><p> $params['random'] = 1;</p><p> elseif (is_numeric($fp_params['random']))</p><p> $params['random'] = intval($fp_params['random']);</p><p> }</p><p> </p><p> if ((isset($fp_params['paged'])) && is_numeric($fp_params['paged']) && $fp_params['paged']>0)</p><p> $params['page']=$fp_params['paged'];</p><p> else</p><p> $params['page'] = 1;</p><p></p><p> }</p><p> </p><p> function index_main() {</p><p> </p><p> global $fpdb, $smarty, $fp_config, $fp_params;</p><p> $params = array();</p><p> $module = 'index.tpl' ;</p><p> $can404 = true;</p><p> </p><p> </p><p> if (!empty($fp_params['entry'])) {</p><p> </p><p> index_singlepost($params, $module);</p><p> </p><p> } elseif (</p><p> </p><p> ($explicit_req = $page = @$fp_params['page']) ||</p><p> (empty($fp_params) && $page = @$fp_config['general']['startpage'])</p><p> </p><p> ) {</p><p> </p><p> index_staticpage($page, $explicit_req, $params, $module);</p><p> return $module;</p><p> </p><p> } elseif (!empty($_GET['q'])) {</p><p> include('search.php');</p><p> $module = search_main();</p><p> } else {</p><p> </p><p> if (!empty($fp_params['feed'])){</p><p></p><p> $can404=false;</p><p> </p><p> switch($fp_params['feed']) {</p><p> case 'atom':</p><p> header('Content-type: application/atom+xml');</p><p> $module = SHARED_TPLS . 'atom.tpl';</p><p> break;</p><p> case 'rss2':</p><p> default:</p><p> header('Content-type: application/rss+xml');</p><p> $module = SHARED_TPLS . 'rss.tpl';</p><p> }</p><p> </p><p> </p><p> }</p><p> </p><p> index_showposts($params, $module);</p><p> </p><p> }</p><p> </p><p> $params['fullparse'] = true;</p><p> </p><p> $fpdb->query($params);</p><p></p><p> $q =& $fpdb->getQuery();</p><p> list($id, $e) = $q->peekEntry();</p><p></p><p> /* no entry found : 404 */</p><p></p><p> if (!$e && $can404)</p><p> $module = index_404error();</p><p> </p><p> return $module;</p><p> </p><p> }</p><p></p><p> function index_display() {</p><p> global $smarty;</p><p> </p><p> </p><p> $module = index_main();</p><p> </p><p> theme_init($smarty);</p><p> </p><p> $smarty->display($module);</p><p> </p><p> unset($smarty);</p><p> </p><p> do_action('shutdown');</p><p> </p><p> }</p><p></p><p> </p><p> system_init();</p><p> index_display();</p><p> </p><p></p><p> </p><p>?></p><p>[/php]</p><p></p><p>Ich hoffe ihr könnt mir da irgendwie auf die sprünge helfen.</p><p></p><p>Danke</p></blockquote><p></p>
[QUOTE="ackermaennchen, post: 2512842, member: 4585"] Hallo Freunde der php Strings :D Bin mal wieder am verzweifeln. Folgendes, Ich möchte auf meiner startseite gerne einen Blog für einen newsfeed einfügen. der sich hier befindet: Bisher habe ich auf meiner index.php im Root eine start.php eingebunden, die als erstes geladen werden soll. In der start.php wurde per iframe ein externer Blog geladen (Blogger) hat super funktioniert. Da sich der iframe aber nicht dynamisch angepasst hat sondern ne feste größe hatte, war es irgendwie lästig, mit jeder news die ich veröffentlicht habe auch wieder den Iframe anzupassen um unötige scrollerei zu vermeiden. So nun hab ich meine start.php soweit abgeändert das ich den iframe rausgeschmissen habe und nun den Blog oben intigrieren möchte. [php]<?php include"/flatpress-1.0.2/index.php"; ?>[/php] Der Code der index lautet: [html]<body> <div id="header"> <h1><a href="http://www.tc.lofer.at" title="www.tc.lofer.at" class="notetxt">www.tc.lofer.at</a></h1> <?php include "navi_top.php"; ?> <?php include "navi.php"; ?> </div> <div id="contentcontainer"> <div id="content"> <?php ini_set('display_errors', 1); if(!isset($_GET['page'])){ $checkpage = "start"; }else{ $erlaubt = array( "start" => 1, "termine" => 1, "vorstand" => 1, "bespannung" => 1, "impressum"=>1, "sitemap"=>1, "kontakt"=>1, "mitglied"=>1, "gebuehr"=>1, "trainer"=>1, "/flatpress-1.0.2/index"=>1,); $checkpage = isset($erlaubt[$_GET["page"]]) ? $_GET["page"] : "start"; } include ($checkpage .".php"); ?> </div></div> <div id="space" class="clear"></div> <div id="footercontainer" class="clear"> <div id="footer"></div> </div> <script type="text/javascript" src="http://www.tc.lofer.at/stat/track.php?mode=js"></script> <noscript><img src="http://www.tc.lofer.at/stat/track_noscript.php" border="0" alt="" width="1" height="1"></noscript> </body>[/html] Rufe ich nun diie seite auf bekomme ich folgende Fehlermeldung: [B]Warning[/B]: include(/flatpress-1.0.2/index.php) []: failed to open stream: No such file or directory in [B]/usr/home/[/B] on line [B]9[/B] [B]Warning[/B]: include() []: Failed opening '/flatpress-1.0.2/index.php' for inclusion (include_path='.:/usr/local/share/pear') in [B]/usr/home/[/B] on line [B]9[/B] Änder ich den Pfad in der start php. in [php]<?php include"flatpress-1.0.2/index.php"; ?>[/php] Dann ruft er nicht mehr meine index.php im root auf, sondern die setup.php aus dem flatpress. Die er aber nicht finden kann, obwohl sie auf dem server liegt. Bzw er sucht die setup.php im root wo sie ja auch nicht ist. ich füge mal noch den Code der index.php vom Blog ein: [php]<?php include 'defaults.php'; include INCLUDES_DIR . 'includes.php'; include SMARTY_DIR . 'SmartyValidate.class.php'; define('MOD_INDEX', 1); if (!file_exists(CONFIG_FILE)) utils_redirect('setup.php'); /* local function defines follow */ function index_permatitle($val, $sep) { global $fpdb; $q =& $fpdb->getQuery(); list($id, $e) = @$q->peekEntry(); if ($e) return "{$e['subject']} {$sep} $val "; else return $val; } function index_gentitle($val, $sep) { global $title; return "$val $sep $title"; } function index_404error() { global $smarty, $lang; @utils_status_header(404); $module='default.tpl'; $smarty->assign('subject', $lang['404error']['subject']); $smarty->assign('content', $lang['404error']['content']); $smarty->assign('rawcontent', true); return $module; } function index_singlepost(&$params, &$module) { global $fpdb, $theme, $fp_params; $params['id'] = $fp_params['entry']; $params['fullparse']=true; $fpdb->query($params); if (@$theme['hassingle']) $module='single.tpl'; add_filter('wp_title', 'index_permatitle', 10, 2); if (isset($fp_params['comments'])) { $module = 'comments.tpl'; $params['comments'] = true; include('comments.php'); } } function index_staticpage($page, $explicit_req, &$params, &$module) { global $smarty, $title; if (static_exists($page)) { $arr = static_parse($page); $title = $arr['subject']; if ($explicit_req) add_filter('wp_title', 'index_gentitle', 1, 2); $smarty->assign('static_id', $page); $smarty->assign('static_page',$arr); return $module='static.tpl'; } if (user_loggedin()) utils_redirect('admin.php?p=static&action=write&page='.$page); else $module = index_404error(); return $module; } function index_showposts(&$params, &$module) { global $fp_params; if (isset($fp_params['d']) && $fp_params['d']) $params['d'] = $fp_params['d']; if (isset($fp_params['m']) && $fp_params['m']) $params['m'] = $fp_params['m']; if (isset($fp_params['y']) && $fp_params['y']) $params['y'] = $fp_params['y']; if (isset($fp_params['start']) && $fp_params['start']) $params['start'] = intval($fp_params['start']); if (isset($fp_params['count']) && $fp_params['count']) $params['count'] = intval($fp_params['count']); if (isset($fp_params['category']) && is_numeric($fp_params['category'])) $params['category'] = intval($fp_params['category']); if (isset($fp_params['cat']) && is_numeric($fp_params['cat'])) $params['category'] = intval($fp_params['cat']); if (isset($fp_params['not']) && is_numeric($fp_params['not'])) $params['exclude'] = intval($fp_params['not']); if (isset($fp_params['random'])) { if (empty($fp_params['random'])) $params['random'] = 1; elseif (is_numeric($fp_params['random'])) $params['random'] = intval($fp_params['random']); } if ((isset($fp_params['paged'])) && is_numeric($fp_params['paged']) && $fp_params['paged']>0) $params['page']=$fp_params['paged']; else $params['page'] = 1; } function index_main() { global $fpdb, $smarty, $fp_config, $fp_params; $params = array(); $module = 'index.tpl' ; $can404 = true; if (!empty($fp_params['entry'])) { index_singlepost($params, $module); } elseif ( ($explicit_req = $page = @$fp_params['page']) || (empty($fp_params) && $page = @$fp_config['general']['startpage']) ) { index_staticpage($page, $explicit_req, $params, $module); return $module; } elseif (!empty($_GET['q'])) { include('search.php'); $module = search_main(); } else { if (!empty($fp_params['feed'])){ $can404=false; switch($fp_params['feed']) { case 'atom': header('Content-type: application/atom+xml'); $module = SHARED_TPLS . 'atom.tpl'; break; case 'rss2': default: header('Content-type: application/rss+xml'); $module = SHARED_TPLS . 'rss.tpl'; } } index_showposts($params, $module); } $params['fullparse'] = true; $fpdb->query($params); $q =& $fpdb->getQuery(); list($id, $e) = $q->peekEntry(); /* no entry found : 404 */ if (!$e && $can404) $module = index_404error(); return $module; } function index_display() { global $smarty; $module = index_main(); theme_init($smarty); $smarty->display($module); unset($smarty); do_action('shutdown'); } system_init(); index_display(); ?> [/php] Ich hoffe ihr könnt mir da irgendwie auf die sprünge helfen. Danke [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 7, ▼ = 3, ◇ = 2 und die Summe von ▲ und ▼ durch ◇ geteilt wird, was ist das Ergebnis?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Hilfe beim include
Oben