Danke!
Jetzt habe ich nur noch 2 Probleme
- Die Kategorien werden nicht umgewandelt, also die links bleiben dynamisch (Ich glaube das liegt an dieser PHP datei : [code]<?php
// |---------------------------------------------------------------------------|
// | PHP-Fusion 7 Content Management System |
// | Copyright © 2002 - 2005 Nick Jones |
// | http://www.php-fusion.co.uk/ |
// |---------------------------------------------------------------------------|
// | 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). |
// |---------------------------------------------------------------------------|
// | Extended Articles |
// | Copyright © 2008 Rizald ‚Elyn‘ Maxwell f |
// | Filename : functions.php |
// | Read the source easier via Notepad++ |
// | comment fonts changed - Courrier New, 10pt |
// |---------------------------------------------------------------------------|
// | For more informations, please refer to README.TXT |
// |---------------------------------------------------------------------------|
define(‚EXART_THEME‘,$settings[‚theme‘]);
define(‚EXART_SITENAME‘,$settings[‚sitename‘]);
define(‚EXART_TIMEOFFSET‘,$settings[‚timeoffset‘]);
define(‚EXART_GP_LEVEL‘,„101“);
define(‚EXART_GP‘,„iMEMBER“);
define(‚EXART_NAV‘,„1“);
require_once („seoname.php“);
function most_recent_article($locale) {
include_once INFUSIONS.„extended_articles/locale/“.LOCALESET.„articles.php“;
$items = 1; // change the number of latest articles you wanted to show here.
$recent = "";
$result = dbquery("SELECT ta.*,tac.*, tu.user_id,user_name
FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".DB_USERS." tu ON ta.article_name=tu.user_id
WHERE ".groupaccess('article_cat_access')."
ORDER BY article_datestamp
DESC LIMIT 0,$items"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
$d['article_id'] = $data['article_id'];
$d['article_subject'] = stripslashes($data['article_subject']);
$d['article_cat_id'] = $data['article_cat_id'];
$d['article_cat_name'] = stripslashes($data['article_cat_name']);
$d['article_snippet'] = stripslashes($data['article_snippet']);
$d['user_id'] = $data['user_id'];
$d['user_name'] = $data['user_name'];
$d['article_date'] = $data['article_datestamp'];
$d['article_reads'] = $data['article_reads'];
$d['article_comments'] = dbcount("(comment_id)", DB_COMMENTS, "comment_type='A'
AND comment_item_id='".$data['article_id']."'");
$d['article_allow_comments'] = $data['article_allow_comments'];
$theme = THEME;
$showdate = showdate("longdate", $d['article_date']);
//<p class='small'> · <a href='index.php?cat_id={$d['article_cat_id']}'>{$d['article_cat_name']}</a></p>{$d['article_snippet']}</td></tr>
$recent .= "
<tr><td class='tbl2'><strong><a href='readarticle.php?article_id={$d['article_id']}'>{$d['article_subject']}</a></strong></td></tr>
<tr><td class='tbl1' style='text-align:justify'>
<p class='small'> · <a href='".seoname($data['article_subject'])."-r".$data['article_id'].".html'></p>{$d['article_snippet']}</td></tr>
<tr><td align='center' class='tbl2'><small>"
.showForm("A",$d['article_id'])
.articleAuthor($d," ·", "true")
.articleOptions($d,"·")
.closeForm("A",$d['article_id'])
."</small></td></tr>";
}
$most_recent = "<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>".$recent."</table>";
opentable($locale['articles_418']);
echo $most_recent;
closetable();
} else {
echo '';
}
}
function priamos_params($external) {
foreach ($_GET as $key => $val) {
if (!isnum($val) || !in_array($key,$external)) {
redirect(‚index.php‘);
}
}
foreach ($_POST as $key => $val) {
if (!isnum($val) || !in_array($key,$external)) {
redirect(‚index.php‘);
}
}
}
function cat_info($cat_id) {
$article_cat_info = article_cat_info($cat_id);
$info[‚article_cat_name‘] = $article_cat_info[‚article_cat_name‘];
$info[‚parent_id‘] = $article_cat_info[‚article_cat_parent‘];
$article_parent_info = article_cat_info($article_cat_info['article_cat_parent']);
$info['parent_name'] = $article_parent_info['article_cat_name'];
$info['g_parent_id'] = $article_parent_info['article_cat_parent'];
return $info;
}
function article_cat_info($cat_id) {
$result = dbquery(„SELECT article_cat_name, article_cat_parent
FROM „.DB_ARTICLE_CATS.“
WHERE article_cat_id=’$cat_id’“);
$data = dbrows($result);
if ($data != null) {
return dbarray($result);
} else {
return false;
}
}
function articles_navigation($locale) {
$site_url = BASEDIR.‚index.php‘;
$site_name = EXART_SITENAME;
$articles_404 = $locale[‚articles_404‘];
$articles_400 = $locale[‚articles_400‘];
$navigation = "<p><a href='$site_url'>$site_name</a> $articles_404 <a href='index.php'>$articles_400</a></p>";
echo $navigation;
}
function article_statistics($locale,$cat_id,$cat_info) {
$articles_405 = $locale[‚articles_405‘];
$articles_406 = $locale[‚articles_406‘];
if ($cat_id) {
$conditions = "article_cat=’$cat_id’ ";
$result = dbquery(„SELECT SUM(article_reads)
FROM „.DB_ARTICLES.“
WHERE article_cat = ‚$cat_id‘“);
$feedlink = ‚?cat_id=‘.$cat_id;
} else {
$conditions = ‚‘;
$result = dbquery(„SELECT SUM(article_reads)
FROM „.DB_ARTICLES.““);
$feedlink = ‚‘;
}
$rows = dbrows($result);
if ($rows != 0) {
$num_count = dbcount("(article_cat)", DB_ARTICLES, $conditions);
$theme = EXART_THEME;
if ((isset($cat_info['parent_id']) && $cat_info['parent_id'] != null) && $cat_id !== '0') {
$article_cat_parent = $cat_info['parent_id'];
if($article_cat_parent == '0') {
$cat_parent_link = '';
$article_parent_name = $locale['articles_400'];
$article_cat_name = $cat_info['article_cat_name'];
$arrow = 'up';
} else {
$cat_parent_link = '?cat_id='.$article_cat_parent;
$article_parent_name = $cat_info['parent_name'];
$article_cat_name = $cat_info['article_cat_name'];
$arrow = 'up';
}
} else {
$cat_parent_link = '';
$article_parent_name = '';
$article_cat_name = $locale['articles_400'];
}
$articles_407 = $locale['articles_407'];
$i_alt = dbresult($result,0);
$i_alt = $i_alt ? $i_alt : "0";
$statistics = "
<table border='0' cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>
<tr><td class='forum-caption' align='left' colspan='2' rowspan='1'>
<div class='tableHeading'>$articles_405</div></td></tr>
<tr><td class='tbl2' align='center'><a href='feeds/articles.php$feedlink' title='RSS Feed'>
<img src='images/rss/feed-icon-65x77.jpg' border='0' alt='rss-feed-icon' /></a></td>
<td width='100%' align='left' class='tbl1'>";
if($article_parent_name) {
// <span class='small'> · <strong><a href='index.php$cat_parent_link'>$article_parent_name</a>
$statistics .= "
</strong></span><br />";
}
$statistics .= "<span class='small'>$articles_406<strong>$num_count</strong></span><br />
<span class='small'>$articles_407<strong>$i_alt </strong></span><br />";
echo $statistics;
article_reads($locale,$cat_id);
article_searchbox($locale,"a");
}
}
function article_subcategories($locale,$cat_id) {
$res = dbquery(„SELECT *
FROM „.DB_ARTICLE_CATS.“
WHERE „.groupaccess(‚article_cat_access‘).“
AND article_cat_parent = ‚$cat_id‘
ORDER BY article_cat_name“);
$rows = dbrows($res);
if ($rows != 0) {
$counter = 0; $columns = 2;
$str = "<table cellpadding='5' cellspacing='0' width='100%' class='tbl'><tr>";
while ($data = dbarray($res)) {
$scat_num = dbcount("(article_cat)", DB_ARTICLES, "article_cat='".$data['article_cat_id']."'");
//if (!$scat_num) continue;
$scat_url = FUSION_SELF.'?cat_id='.$data['article_cat_id'];
$subcat_name = $data['article_cat_name'];
$theme = EXART_THEME;
if ($data['article_cat_description']) {
$subcat_description = $data['article_cat_description'];
} else {
$subcat_description = '';
}
$articles_416 = $locale['articles_416'];
$articles_412 = $locale['articles_412'];
$str .= "<td valign='top' width='50%'><strong><a href='$scat_url'>$subcat_name</a></strong>
<span class='small2'>($scat_num)</span><br />
<span class='small'>$subcat_description...</span><br />
</td>";
if ($counter != 0 && ($counter % $columns == 0)) {
$str .= "</tr><tr>";
}
$counter++;
}
$str .= "</tr></table>";
opentable($locale['articles_417']);
echo $str;
closetable();
} else {
echo '';
}
}
function article_list($rowstart,$cat_id,$locale) {
$result8 = dbquery(„SELECT article_cat_access, article_cat_sorting
FROM „.DB_ARTICLE_CATS.“
WHERE article_cat_id=’$cat_id’“);
if (dbrows($result8) != 0) {
$cdata = dbarray($result8);
if (checkgroup($cdata[‚article_cat_access‘])) {
$res = 1;
$rows = dbcount("(article_id)", DB_ARTICLES, „article_cat=’$cat_id’“);
if (!isset($rowstart) || !isnum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$i = 1;
$result9 = dbquery(„SELECT article_datestamp,article_subject,
article_snippet,article_reads,article_id
FROM „.DB_ARTICLES.“
WHERE article_cat=’$cat_id’
ORDER BY „.$cdata[‚article_cat_sorting‘].“
LIMIT $rowstart,15“);
$numrows = dbrows($result9);
while ($data = dbarray($result9)) {
if ($data[‚article_datestamp‘]+604800 > time()+
(EXART_TIMEOFFSET*3600)) {
$isnew = ‚[‘.$locale[‚articles_402‘].’]’;
} else {
$isnew = ‚‘;
}
$article_subject = $data['article_subject'];
$article_snippet = stripslashes($data['article_snippet']);
$article_reads = $data['article_reads'];
$article_id = $data['article_id'];
$articles_410 = $locale['articles_410'];
$articles_419 = $locale['articles_419'];
$list_articles = "
<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border' style='margin-bottom:5px;'>
<tr><td colspan='2' class='forum-caption'>$article_subject $isnew </td></tr>
<tr><td colspan='2' class='tbl1'> $article_snippet</td></tr>
<tr><td width='50%' class='tbl2'><strong>$articles_419</strong> $article_reads</td>
<td width='50%' class='tbl1'><center><a href='".seoname($data['article_subject'])."-c".$data['article_id'].".html'>
<strong>$articles_410</strong></a></center>
</td></tr>
</table>";
echo $list_articles;
// <td width='50%' class='tbl1'><center><a href='readarticle.php?article_id=$article_id'>
$i++;
}
if ($rows > 15) {
$pagenav = makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&");
echo "<div align='center' style='margin-top:5px;'>$pagenav</div>";
} else {
$pagenav = '';
echo "<div align='center' style='margin-top:5px;'>$pagenav</div>";
}
} else {
$articles_403 = $locale['articles_403'];
echo "<div align='center' style='margin-top:5px;'>$articles_403</div>";
}
}
}
}
function article_reads($locale,$cat_id) {
if ($cat_id) {
$result1 = dbquery(„SELECT article_id,article_subject,article_reads
FROM „.DB_ARTICLES.“
WHERE article_cat = ‚$cat_id‘
ORDER BY article_reads
DESC LIMIT 0,1“);
} else {
$result1 = dbquery("SELECT article_id,article_subject,article_reads
FROM ".DB_ARTICLES."
ORDER BY article_reads
DESC LIMIT 0,1");
}
if (dbrows($result1) != null) {
while ($data = dbarray($result1)) {
$articles_408 = $locale['articles_408'];
$article_link = "readarticle.php?article_id=".$data['article_id'];
$article_subject = trimlink($data['article_subject'], 100);
if ($data['article_reads']) {
$article_reads = $data['article_reads'];
} else {
$article_reads = '0';
}
echo " <span class='small'>$articles_408 <strong>
<a href='$article_link' title='$article_subject' class='side'>
$article_subject</a> [ $article_reads ]</strong>
</span><br />";
}
}
}
function article_postlink($aid,$locale,$a) {
if (checkgroup(EXART_GP_LEVEL)) {
if (iADMIN) {
$admin_post_link = ‚admin.php‘.$aid;
$articles_415 = $locale[‚articles_415‘];
echo "<center>[ <a href='$admin_post_link'>$articles_415</a> ]</center><br />";
} else {
$member_post_link = '../../submit.php?stype='.$a;
$articles_411 = $locale['articles_411'];
echo "<center>[ <a href='$member_post_link'>$articles_411</a> ]</center><br />";
}
} else {
echo '';
}
}
function article_searchbox($locale,$type) {
$articles_409 = $locale[‚articles_409‘];
echo "
$articles_409
";
}
function render_article2($subject, $article, $info) {
opentable($subject);
echo "
„.($info[‚article_breaks‘] == „y“ ? nl2br($article) : $article).“ |
"
.showForm(„A“,$info[‚article_id‘])
.articleAuthor($info," ·")
.articleOptions($info,"·")
.closeForm(„A“,$info[‚article_id‘])
." |
\n";
closetable();
}
function render_article1($subject, $article, $info) {
opentable($subject);
// <a href=‚index.php?cat_id=".$info[‚article_cat_id‘]."‘>".$info[‚article_cat_name‘].""
echo "
"
.(isset($info[‚navigation‘]) ? „“.$info[‚navigation‘]."" : „“)."
|
"
.($info[‚article_breaks‘] == „y“ ? nl2br($article) : $article)." |
"
.showForm(„A“,$info[‚article_id‘])
.articleAuthor($info," ·")
.articleOptions($info,"·")
.closeForm(„A“,$info[‚article_id‘])
." |
\n";
closetable();
}
function articleAuthor($info,$sep="",$more="",$class="") {
global $locale; $res = „“;
$link_class = $class ? " class=’$class’ " : „“;
$res = „· {$locale[‚global_070‘]} <a href=’“.BASEDIR.„profile.php?lookup=“.$info[‚user_id‘]."’".$link_class.">".$info[‚user_name‘]."\n";
$res .= " {$locale[‚global_071‘]} „.showdate(„longdate“, $info[‚article_date‘]). " „.$sep.“\n“;
if(!empty($more))
$res .= „<a href=‚readarticle.php?article_id={$info[‚article_id‘]}‘>{$locale[‚global_072‘]} „.$sep.“\n“;
if ($info[‚article_allow_comments‘])
$res .= $info[‚article_comments‘].$locale[‚global_073‘]." „.$sep.“\n";
return $res;
}
function articleOptions($info,$sep) {
global $locale; $res = „“;
$res = $info[‚article_reads‘].$locale[‚global_074‘]." „.$sep.“\n";
$res .= „<a href=’“.BASEDIR.„print.php?type=A&item_id=“.$info[‚article_id‘]."’><img src=’".THEME.„images/printer.gif’ alt=’{$locale[‚global_075‘]}’ title=’{$locale[‚global_075‘]}’ style=‚vertical-align:middle;border:0px;‘/>\n“;
return $res;
}
function showForm($item_type,$item_id) {
global $aidlink;
$res = „“;
if ($item_type == „A“) {
if (iADMIN && checkrights($item_type)) $res .= „\n“;
}
return $res;
}
function closeForm($item_type,$item_id) {
global $locale; $res = „“;
if ($item_type == „N“) {
if (iADMIN && checkrights($item_type))
$res .= „·
<img src=’“.IMAGES.„edit.gif’ alt=’“.$locale[‚global_076‘]."’ title=’".$locale[‚global_076‘]."’ style=‚vertical-align:middle;border:0px;‘/>
„;
} elseif ($item_type == „A“) {
if (iADMIN && checkrights($item_type))
$res .= " ·
<img src=’“.IMAGES.„edit.gif’ alt=’“.$locale[‚global_076‘]."’ title=’".$locale[‚global_076‘]."’ style=‚vertical-align:middle;border:0px;‘/>
";
}
return $res;
}
?>[/code] Ich habe schon alles versucht )
2. Umlaute werden falsch dargestellt, im IE sind dann in links wo z.B. ein ä vorkommt, 2 Kästchen enthalten oder im FF ist es dann ein Fragezeichen:(
Wie kann ich das unterbinden ? Normal filtert sowas die seoname.php(sollte sie jedenfalls):
[code] <?
/*****************************************************************
* seoname.php
* -------------------
* This file is part of AMAZECS
*
* @package : amazecs
* @purpose : URL re-write functions
* @copyright : © 2004,2006 Len Johnson
* @mail : GB WEBS, 4 Leominster Walk,
* West Midlands, B45 9SW, UK
* @support : http://www.web-bureau.com/forum/
* @version : $Id: seoname.php,v 1.0.1 $
* @license : http://opensource.org/licenses/gpl-license.php
*
/
/
* GNU Public License
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
***************************************************************/
/
* CHANGELOG
*
* 26.06.06 added seonewsopts function
*/
function seoname($seoit) {
echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />">
// $seoit = strip_tags($seoit);
$seoit = str_replace('=',' ',$seoit);
$seoit = str_replace('/',' ',$seoit);
$seoit = str_replace('\\',' ',$seoit);
$seoit = str_replace('@',' ',$seoit);
$seoit = str_replace('~',' ',$seoit);
$seoit = str_replace('!',' ',$seoit);
$seoit = str_replace('£',' ',$seoit);
$seoit = str_replace('$',' ',$seoit);
$seoit = str_replace('%',' ',$seoit);
$seoit = str_replace('^',' ',$seoit);
$seoit = str_replace('*',' ',$seoit);
$seoit = str_replace('_',' ',$seoit);
$seoit = str_replace('{',' ',$seoit);
$seoit = str_replace('}',' ',$seoit);
$seoit = str_replace('[',' ',$seoit);
$seoit = str_replace(']',' ',$seoit);
$seoit = str_replace('-',' ',$seoit);
$seoit = str_replace(' & ',' ',$seoit);
$seoit = str_replace('"',' ',$seoit);
$seoit = str_replace('.',' ',$seoit);
$seoit = str_replace('\'',' ',$seoit);
$seoit = str_replace(',',' ',$seoit);
$seoit = str_replace(' ','-',$seoit);
$seoit = str_replace(' ','-',$seoit);
$seoit = str_replace(' ','-',$seoit);
$seoit = str_replace(':','',$seoit);
$seoit = str_replace('#','',$seoit);
$seoit = str_replace('(','',$seoit);
$seoit = str_replace(')','',$seoit);
$seoit = str_replace('---','-',$seoit);
$seoit = str_replace('--','-',$seoit);
$seoit = str_replace("ö", "&ouuml;", $seoit);
echo "<script>alert('$seoit')</script>";
$seoit = strtolower($seoit);
return $seoit;
}[/code]
Danke!
MfG,
DHMH