Przedszkolak
Postów: 1
Data rejestracji: 22.09.2009 02:11
|
Witam,
Na wstępie pragnę się ze wszystkimi przywitać - serdeczne Howgh! ;)
Mój pierwszy, debiutancki wątek na tym Forum zawiera kwestię, której nijak nie potrafię samodzielnie rozwiązać.
Wykorzystałem cały potencjał szukajki... nie znalazłszy podobnego przypadku, wziąłem się za założenie nowego tematu.
Do rzeczy - zbudowałem w oparciu o Fusion 6.01.18 portal poetycki dla przyjaciela -> tutaj: http://www.poeci....p?cat_id=1
Standardowy skrypt articles.php zastąpiłem świetnym infusion'em autorstwa Len'a Johnson'a - TWB ARTICLES INFUSION 1.0.1
Problem: czy można wyświetlić stopkę artykułu (wiersza) na liście artykułów w kategorii - czyli stopka miałaby być widoczna przed czytaniem
artykułu. W tym wypadku pod aktywnym linkiem z tytułem wiersza widoczna jest linia Liczba odsłon: XX - w jej miejsce chciałbym wstawić
pełną stopkę... no może bez opcji drukowania :)
W załączeniu dwa pliki odpowiadające za listing artykułów:
1. Priamos.php
<?php
// error_reporting (E_ALL);
/**
* priamos.php
* This file is part of PRIAMOS
*
* @package : PRIAMOS
* @purpose : Functions
* @copyright : (C) 2006 Len Johnson
* @support : http://www.web-bu...
* @license : Released under the terms & conditions of v2 of the
* GNU General Public License. For details refer to
* the included gpl.txt file or visit http://gnu.org
* @version : $Id: priamos.php,v 1.0.0 $
*/
/**
* @ignore
*/
if (!defined("IN_FUSION")) { header("Location: ../../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";
function priamos_params($external) {
foreach ($_GET as $key => $val) {
if (!isNum($val) || !in_array($key,$external)) {
fallback('index.php');
}
}
foreach ($_POST as $key => $val) {
if (!isNum($val) || !in_array($key,$external)) {
fallback('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_PREFIX."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 = PRIAM_SITENAME;
$articles_404 = $locale['articles_404'];
$articles_400 = $locale['articles_400'];
include 'html/navigation_html.php';
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_PREFIX."articles
WHERE article_cat = '$cat_id'");
$feedlink = '?cat_id='.$cat_id;
} else {
$conditions = '';
$result = dbquery("SELECT SUM(article_reads)
FROM ".DB_PREFIX."articles");
$feedlink = '';
}
$rows = dbrows($result);
if ($rows != 0) {
$num_count = dbcount("(article_cat)", "articles", $conditions);
$theme = PRIAM_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";
include 'html/statistics_html.php';
echo $statistics;
article_reads($locale,$cat_id);
article_searchbox($locale,"a");
}
}
function article_subcategories($locale,$cat_id) {
$result7 = dbquery("SELECT *
FROM ".DB_PREFIX."article_cats
WHERE ".groupaccess('article_cat_access')."
AND article_cat_parent = '$cat_id'
ORDER BY article_cat_name");
$rows = dbrows($result7);
if ($rows != 0) {
$counter = 0; $columns = 2;
opentable("Zbiór wszystkich wierszy");
include 'html/subcategories_html.php';
echo $subcategories1;
while ($data = dbarray($result7)) {
$subcategories_num = dbcount("(article_cat)", "articles", "article_cat='"
.$data['article_cat_id']."'");
//if (!$subcategories_num) continue;
$subcategories_url = FUSION_SELF.'?cat_id='.$data['article_cat_id'];
$subcat_name = $data['article_cat_name'];
$theme = PRIAM_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'];
include 'html/subcategories_info_html.php';
if ($counter != 0 && ($counter % $columns == 0)) {
echo $subcategories2;
}
echo $subcategories3;
$counter++;
}
include 'html/subcategories_html.php';
echo $subcategories4;
closetable();
tablebreak();
} else {
echo '';
}
}
function article_list($rowstart,$cat_id,$locale) {
$result8 = dbquery("SELECT article_cat_access, article_cat_sorting
FROM ".DB_PREFIX."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)", "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_PREFIX."articles
WHERE article_cat='$cat_id'
ORDER BY ".$cdata['article_cat_sorting']."
LIMIT $rowstart,20");
$numrows = dbrows($result9);
while ($data = dbarray($result9)) {
if ($data['article_datestamp']+1 > time()+
(PRIAM_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'];
include 'html/list_articles_html.php';
echo $list_articles;
$i++;
}
if ($rows > 20) {
$pagenav = makePageNav($rowstart,20,$rows,3,FUSION_SELF."?cat_id=$cat_id&");
include 'html/show_nav_html.php';
echo $show_nav;
} else {
$pagenav = '';
include 'html/show_nav_html.php';
echo $show_nav;
}
} else {
$articles_403 = $locale['articles_403'];
include 'html/no_articles_html.php';
echo $no_articles;
}
}
}
}
function article_reads($locale,$cat_id) {
if ($cat_id) {
$result1 = dbquery("SELECT article_id,article_subject,article_reads
FROM ".DB_PREFIX."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_PREFIX."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';
}
include 'html/reads_html.php';
echo $reads;
}
}
}
function article_searchbox($locale,$type) {
$articles_409 = $locale['articles_409'];
include 'html/searchbox_html.php';
echo $searchbox;
}
?> Kliknij i zaczekaj na załadowanie kodu ...
2. list_articles_html.php
<?php
$list_articles = <<<_END_
<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'
style='margin-bottom:5px;'>
<tr>
<td width='65%' class='forum-caption'><center><a href='readarticle.php?article_id=$article_id' class='white'><b>$article_subject</b></a></center></td>
<td width='35%' class='forum-caption'> $article_snippet</td>
</tr>
<tr>
<tr>
<td colspan='2' class='tbl2'><b> $articles_419</b> $article_reads </td>
</tr>
</table>
_END_;
?>
Kliknij i zaczekaj na załadowanie kodu ...
Dziękuję bardzo za okazanie zainteresowania i ew. podsunięcia sugestii, co mogę z tym kalafiorem zrobić :|
PW od moderatora:
- Przeniesienie tematu - Pieka 23.10 - 19:29
|