Hvem er her? 1 gæst(er)
frontpage.php
Zirconium
Lagt på d. 06-01-2011 20:27
Begynder
Antal indlæg: 3
Tilmeldt: 03/11/2007 20:52
Hejsa !
Jeg ha hentet frontpage.php her fra siden, og har forsøgt at lægge koden ind til den nyhedsfunktion du også bruger her, men det ser ikke helt ud til at virke.
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of the
| GNU Affero GPL v3.
+----------------------------------------------------+
| Frontpage.php til phpfusion v7)
| af: kenneth Christensen ()
| Web: wwww.assensvej.dk
|
+----------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once THEMES."templates/footer.php";
$num_of_news_items = 5;
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name, user_status FROM ".DB_PREFIX."news tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT 0,".$num_of_news_items
);
$i = 0;
echo "<table align='center' cellpadding='0' cellspacing='5' width='100%'>\n";
while ($data = dbarray($result)) {
$news_subject = stripslashes($data['news_subject']);
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
$news_cat_image = "";
if ($data['news_cat_image']) {
$news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px' /></a>";
} else {
$news_cat_image = "";
}
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
echo "<tr>\n<td valign='top' class='tbl1 border'><div style='text-align:center; font-weight:bold; color:#04678C;' class='tbl2 show_item'>".$news_subject."</div>\n";
echo "<div ".($i != 0 ? "class='news_display'" : "")." style='width:100%;'>\n<br />".$news_news."<br /><br />
<div style='text-align:center;' class='tbl2'>".newsposter($news_info," ·").newsopts($news_info,"·").itemoptions("N",$news_info['news_id'])."</div>\n</div>\n</td>\n</tr>\n";
$i++;
}
echo "<tr>\n<td valign='top' class='tbl1 border'><div style='text-align:center; font-weight:bold;' class='tbl2'><a href='".BASEDIR."news.php'>Alle nyheder</a></div>\n</td>\n</tr>\n</table>\n";
?>
Skrevet d. 22-11-2024 14:36
Reklame Agent
Antal indlæg: n^x
Tilmeldt: Altid
IP : localhost
assensvej
Lagt på d. 06-01-2011 20:39
Superadministrator
Antal indlæg: 1735
Tilmeldt: 15/01/2006 11:36
Det er forde at den kode du har lagt ind skal ligge i et element og ikke i frontpage.php
koden du har set er der også en ande kode du skal have ind i din header.php
header.php
Kode echo "<script type='text/javascript'>
$(document).ready(function() {
$('.news_display').css('display', 'none');
$('.show_item').click(function () { $(this).next().slideToggle(\"normal\"); });
});
</script>\n</head>\n<body>\n";
og den kode du skal lægge i elemente (center panel)
element
Kode $num_of_news_items = 5;
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name, user_status FROM ".DB_PREFIX."news tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT 0,".$num_of_news_items
);
$i = 0;
echo "<table align='center' cellpadding='0' cellspacing='5' width='100%'>\n";
while ($data = dbarray($result)) {
$news_subject = stripslashes($data['news_subject']);
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"user_status" => $data['user_status'],
"news_date" => $data['news_datestamp'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
$news_cat_image = "";
if ($data['news_cat_image']) {
$news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px' /></a>";
} else {
$news_cat_image = "";
}
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
echo "<tr>\n<td valign='top' class='tbl1 border'><div style='text-align:center; font-weight:bold; color:#04678C;' class='tbl2 show_item'>".$news_subject."</div>\n";
echo "<div ".($i != 0 ? "class='news_display'" : "")." style='width:100%;'>\n<br />".$news_news."<br /><br />
<div style='text-align:center;' class='tbl2'>".newsposter($news_info," ·").newsopts($news_info,"·").itemoptions("N",$news_info['news_id'])."</div>\n</div>\n</td>\n</tr>\n";
$i++;
}
echo "<tr>\n<td valign='top' class='tbl1 border'><div style='text-align:center; font-weight:bold;' class='tbl2'><a href='".BASEDIR."news.php'>Alle nyheder</a></div>\n</td>\n</tr>\n</table>\n";
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
Zirconium
Lagt på d. 06-01-2011 20:47
Begynder
Antal indlæg: 3
Tilmeldt: 03/11/2007 20:52
Det har jeg så prøvet lige nu, og får følgende fejl:
arse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /hsphere/local/home/zirconiu/xn--hjemlseshunde-fnb.dk/themes/templates/panels.php(78) : eval()'d code on line 5
Kan jeg ikke få den frontpage.php du har, hvor kun nyhedsdelen er med ? :-)
assensvej
Lagt på d. 06-01-2011 21:12
Superadministrator
Antal indlæg: 1735
Tilmeldt: 15/01/2006 11:36
jamen min frontpage.php
ser sådan her ud
Kode <?php
/*---------------------------------------------------+
| PHP-Fusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of the
| GNU Affero GPL v3.
+----------------------------------------------------+
| Frontpage.php til phpfusion v7)
| af: kenneth Christensen ()
| Web: wwww.assensvej.dk
|
+----------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once THEMES."templates/footer.php";
?>
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
Spring til debat:
Kravlegården på Assensvej
Assensvej.dk
MOD's /7.02
Temaer /7.02
Generel debat - PHP-Fusion /7.02
Nye Themes fra Assensvej.dk
MOD's /7.01
Infusioner /7.01
Temaer /7.01
Tips og tricks,elementer mm /7.01
Generel debat - PHP-Fusion /7.01
MOD's v7
Infusioner v7
Temaer v7
Tips og tricks,elementer mm v7
Generel debat - PHP-Fusion v7
vise dine Temaer/show your Themes
Themes
Theme Requests
Showcase
Hvad sker der på Assensvej.dk
De løse debater
Fra Bruger til Bruger.
Lidt sjov
Jule vittigheder og historie
Facebook
YouTube