Content Management System - CMS : eXV2 
Home
News
Forum
Downloads
Download Module
Sitemap
Partnerseiten
RSS News
Kontakt/Info
Sprache
EnglishFrench
Suchen
Login
Nickname
Passwort

Registrieren?
Passwort?
Navigation
 Home News  Forum Neueste Beiträge  Downloads Download Module eXV² Themes  Weblinks Tutorial Changelog 2.3.1 Jobcenter Gebrauchtmarkt OSMap  Sponsor Kalendersystem Sitemap Partnerseiten RSS News Kontakt/Info Webseiten Wetter
Willkommen im Free Web CMS : eXV² Forum!
  Forenarchiv
     Module
  NewsBlock - Anzeige der Anzahl Beiträge limitieren

Forum : Module

Titel : NewsBlock - Anzeige der Anzahl Beiträge limitieren

© 2004-2012 www.exv2.de
http://www.exv2.de

URL dieser Diskussion
http://www.exv2.de/modules/newbb_plus/viewtopic.php?topic_id=2856&forum=11


 herman :

03.10.2005 20:47
 Ich würde gerne in meinem News-Block die max. Anzahl der angezeigten Beiträge auf fünf beschränken. Weiss aber nicht, wo ich das in der Datei anpassen muss :

Zitat:
<?php
// $Id: news_top.php,v 1.1 2003/08/31 12:16:29 half-dead Exp $
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// < http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: Half-Dead
// Author Website : http://www.e-xoops.com
// License Type : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //

//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_news_top_show($options) {
global $db, $myts;

$block = array();
$block['content'] = "";
// bama Bug error_reporting, wenn kein Aktikel vorhanden
$block['title'] = "";
/*
if (!empty($options[4]) && is_numeric($options[4])) {
$extra = "AND topicid=".$options[4];
}
*/
if (!empty($options[4]) && is_numeric($options[4])) {
$extra = "AND topicid=".$options[4];
}else{
$extra = "";
}


$sql = "
SELECT storyid, title, published, counter
FROM ".$db->prefix("stories")."
WHERE published<".time()."
AND published>0
$extra
ORDER BY published DESC";

if ( empty($options[3]) || !is_numeric($options[3]) ) {
$options[3] = 5;
}

if ( empty($options[2]) || !is_numeric($options[2]) ) {
$options[2] = 19;
}

$result = $db->query($sql, $options[3], 0);
while ( list($storyid, $title, $published, $counter) = $db->fetch_row($result) ) {
$title = $myts->makeTboxData4Show($title);
if ( strlen($title) > $options[2] ) {
$title = substr($title, 0, $options[2])."..";
}

$block['content'] .= "
 <big>·</big>
".$title."";

if ($options[0] == "published") {
$block['title'] = _MB_NEWS_TITLE4;
if ($options[1] == 1) {
$block['content'] .= " (".formatTimestamp($published, "s").")";
}
$block['content'] .= "
";

} elseif ($options[0] == "counter") {
$block['title'] = _MB_NEWS_TITLE5;
if ($options[1] == 1) {
$block['content'] .= " (".$counter.")";
}
$block['content'] .= "
";
}
}
$block['content'] .= "";

return $block;
}

//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
function b_news_top_edit($options) {
global $db;

$form = "<input type='hidden' name='options[0]' value='".$options[0]."' />";
$form .= "";

// Show Date/Hits?
$form .= "";


// TRIM
$form .= "

";


// LIMIT TO
$form .= "

";

// LIMIT TO CATS
include_once(XOOPS_ROOT_PATH."/class/xoopstree.php");
$cats = new XoopsTree($db->prefix("topics"), "topic_id", "topic_pid");
ob_start();
$cats->makeMySelBox("topic_title", "topic_title", $options[4], 1, "options[4]");
$content = ob_get_contents();
ob_end_clean();

$form .= "

";

$form .= "
"._MB_NEWS_SHOW." ".$options[0].":";

$chk = "";
if ($options[1] == 0) {
$chk = " checked='checked'";
}
$form .= "<input type='radio' class='radio' name='options[1]' value='0'".$chk." />"._NO."";

$chk = "";
if ($options[1] == 1) {
$chk = " checked='checked'";
}
$form .= "<input type='radio' class='radio' name='options[1]' value='1'".$chk." />"._YES."
"._MB_NEWS_TRIM."<input type='text' class='text' size='3' maxlength='2' name='options[2]' value='".$options[2]."'>
"._MB_NEWS_LIMIT."<input type='text' class='text' name='options[3]' value='".$options[3]."' size='3' maxlength='2' />
"._MB_NEWS_LIMIT."$content
";

return $form;
}
?>



deutschland

 bama :

03.10.2005 21:39
 im Adminmenü -> Blöcke
den Top News Block, Spalte ganz rechts, bearbeiten

da kannst du unten im Formular alles einstellen
Partnerseiten
http://www.exv2-filecenter.de/modules/news_ml/

Vote für eXV2
php
Kontakt/Info
  Kontakt
  Impressum
  Link zu uns
  AGB
  Datenschutzhinweis
Downloads
  eXV² Core
  Core Sprachfiles
eXV² Filecenter
  Downloads
  Download Module
  eXV² Themes
  Multilanguage Module
  Sprachfiles eXV² Module
eXV² Support
  France