bobbyg
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/47640777475ce61275311.jpg)
Joined: Dec 05, 2007
Posts: 212
Location: Tampa, Florida
|
Posted:
Sat Jul 30, 2011 8:46 pm |
|
I am using http://jscroller2.markusbordihn.de/ for several blocks on http://raintreevillagecondos.com. I got the Old Articles to scroll but the problem I am having is the "Old Articles" title also scrolls.
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and */
/* XHTML compliance fixes by Raven and Montego. */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
if (!isset($see)) {$see = ''; } // added by Guardin as variable wasnt defined
if (!isset($dummy)) { $dummy = ''; } // add by Guardian as variable was not defined
if (!isset($articlecomm)) { $articlecomm = ''; } // add by fkelly as variable was not defined
if (!isset($time2)) { $time2 = ''; } // add by fkelly as variable was not defined
$content = '';
getusrinfo($user);
if ($multilingual == 1) {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\' AND (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
} else {
$querylang = 'where (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
if ($new_topic != 0) {
$querylang .= ' AND topic=\''.intval($new_topic).'\'';
}
}
} else {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\'';
} else {
$querylang = '';
if ($new_topic != 0) {
$querylang = 'WHERE topic=\''.intval($new_topic).'\'';
}
}
}
if (isset($userinfo['storynum']) AND $user_news == 1) {
$storynum = $userinfo['storynum'];
} else {
$storynum = $storyhome;
}
$boxstuff = '<table border="0" width="100%">';
$boxTitle = _PASTARTICLES;
[b]?>
<p><script type="text/javascript" src="jscroller2.js"></script></p>
<div id="scroller_container">
<div class="jscroller2_up jscroller2_speed-20 jscroller2_alternate jscroller2_mousemove">
<?[/b]
$sql = 'SELECT sid, title, time, comments FROM '.$prefix.'_stories '.$querylang.' ORDER BY time DESC LIMIT '.$storynum.', '.$oldnum;
$result = $db->sql_query($sql);
$vari = 0;
while (list($sid, $title, $time, $comments) = $db->sql_fetchrow($result)) {
$sid = intval($sid);
$title = stripslashes($title);
$see = 1;
setlocale(LC_TIME, $locale);
ereg ('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime2);
$datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
$datetime2 = ucfirst($datetime2);
if ($articlecomm == 1) {
$comments = '('.$comments.')';
} else {
$comments = '';
}
if($time2==$datetime2) {
$boxstuff .= '<tr><td valign="top"><strong><big>·</big></strong></td><td> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</td></tr>';
} else {
if(empty($a)) {
$boxstuff .= '<tr><td colspan="2"><b>'.$datetime2.'</b></td></tr><tr><td valign="top"><strong><big>·</big></strong></td><td> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</td></tr>';
$time2 = $datetime2;
$a = 1;
} else {
$boxstuff .= '<tr><td colspan="2"><b>'.$datetime2.'</b></td></tr><tr><td valign="top"><strong><big>·</big></strong></td><td> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</td></tr>';
$time2 = $datetime2;
}
}
$vari++;
if ($vari==$oldnum) {
$min = $oldnum + $storynum;
$dummy = 1;
}
}
if ($dummy == 1 AND is_active('Stories_Archive')) {
$boxstuff .= '</table><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
} else {
$boxstuff .= '</table>';
}
if ($see == 1) {
$content = $boxstuff;
}
[b]$content .= ' </div></div>'."\n";[/b]?>
|
--- Edited to add "code" tags - Killing-Hours |
|
|
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 01, 2011 2:13 pm |
|
bobbyg wrote: | I have made several attempts to get the block title outside of the scroller without success. I am hoping someone might have a suggestion that would make this work. You can see it on my site mentioned bove. |
i have found a solution for you!
at 1st you must load the js script into your header. open the directory /includes/custom_files/ and make a file called custom_head.php. here can load your js- or css-files into your header before the body was started. now open this file and put this line into it:
Code:<script type="text/javascript" src="jscroller2.js"></script>
|
notice:
for all others who read this thread. i use in my example the js-file from the authors page:
http://jscroller2.markusbordihn.de/download/
Code:<script type="text/javascript" src="jscroller2-1.61.js"></script>
|
now you can search the right place for your scrolling div-containers. i have modify the block without tables and change it to div and spans. now can give the containers css ids or/and classes to change width and height in your theme.
block-Old_Articles.php:
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and */
/* XHTML compliance fixes by Raven and Montego. */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
if (!isset($see)) {$see = ''; } // added by Guardin as variable wasnt defined
if (!isset($dummy)) { $dummy = ''; } // add by Guardian as variable was not defined
if (!isset($articlecomm)) { $articlecomm = ''; } // add by fkelly as variable was not defined
if (!isset($time2)) { $time2 = ''; } // add by fkelly as variable was not defined
$content = '';
getusrinfo($user);
if ($multilingual == 1) {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\' AND (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
} else {
$querylang = 'where (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
if ($new_topic != 0) {
$querylang .= ' AND topic=\''.intval($new_topic).'\'';
}
}
} else {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\'';
} else {
$querylang = '';
if ($new_topic != 0) {
$querylang = 'WHERE topic=\''.intval($new_topic).'\'';
}
}
}
if (isset($userinfo['storynum']) AND $user_news == 1) {
$storynum = $userinfo['storynum'];
} else {
$storynum = $storyhome;
}
// old table replaced with div
$boxstuff = '<div style="margin:0; padding:0; width:100%">';
$boxTitle = _PASTARTICLES;
$sql = 'SELECT sid, title, time, comments FROM '.$prefix.'_stories '.$querylang.' ORDER BY time DESC LIMIT '.$storynum.', '.$oldnum;
$result = $db->sql_query($sql);
$vari = 0;
// open both slider divs
$boxstuff .= '<div id="scroller_containerX">';
$boxstuff .= '<div class="jscroller2_up jscroller2_speed-20 jscroller2_alternate jscroller2_mousemove" style="white-space:nowrap; margin: 0;">';
while (list($sid, $title, $time, $comments) = $db->sql_fetchrow($result)) {
$sid = intval($sid);
$title = stripslashes($title);
$see = 1;
setlocale(LC_TIME, $locale);
ereg ('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime2);
$datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
$datetime2 = ucfirst($datetime2);
if ($articlecomm == 1) {
$comments = '('.$comments.')';
} else {
$comments = '';
}
if($time2==$datetime2) {
$boxstuff .= '<span><strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span>';
$boxstuff .= '<br />';
} else {
if(empty($a)) {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= '<strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span>';
$boxstuff .= '<br />';
$time2 = $datetime2;
$a = 1;
} else {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= '<strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span>';
$boxstuff .= '<br />';
$time2 = $datetime2;
}
}
$vari++;
if ($vari==$oldnum) {
$min = $oldnum + $storynum;
$dummy = 1;
}
}
// close both slider divs
$boxstuff .= '</div>';
$boxstuff .= '</div>';
if ($dummy == 1 AND is_active('Stories_Archive')) {
$boxstuff .= '</div><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
} else {
$boxstuff .= '</div>';
}
if ($see == 1) {
$content = $boxstuff;
}
?>
|
css-code:
Code:#scroller_containerX {width:168px; height:100px; margin-left:3px; overflow:hidden;}
#scroller_containerX {overflow:auto; height:100px; width:168px; overflow-x:hidden; overflow-y:hidden;}
|
EDIT: i think... for myself... to much divs
i tried a another modify of this block and changed to ul & li with one div.
at 1st, i added a new css-class into the css-file of my theme. (if you don't need clear:both; (no floating before), delete it.):
Code:.oldarticleUL {clear:both; margin:0; padding:0; list-style:none;}
|
i have modified the complete block-file again and put my ul & li example in my first version.
block-Old_Articles.php:
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and */
/* XHTML compliance fixes by Raven and Montego. */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
if (!isset($see)) {$see = ''; } // added by Guardin as variable wasnt defined
if (!isset($dummy)) { $dummy = ''; } // add by Guardian as variable was not defined
if (!isset($articlecomm)) { $articlecomm = ''; } // add by fkelly as variable was not defined
if (!isset($time2)) { $time2 = ''; } // add by fkelly as variable was not defined
$content = '';
getusrinfo($user);
if ($multilingual == 1) {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\' AND (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
} else {
$querylang = 'where (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
if ($new_topic != 0) {
$querylang .= ' AND topic=\''.intval($new_topic).'\'';
}
}
} else {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\'';
} else {
$querylang = '';
if ($new_topic != 0) {
$querylang = 'WHERE topic=\''.intval($new_topic).'\'';
}
}
}
if (isset($userinfo['storynum']) AND $user_news == 1) {
$storynum = $userinfo['storynum'];
} else {
$storynum = $storyhome;
}
//$boxstuff = '<div style="margin:0; padding:0; width:100%">';
// ul example
$boxstuff = '<ul class="oldarticleUL">';
$boxTitle = _PASTARTICLES;
$sql = 'SELECT sid, title, time, comments FROM '.$prefix.'_stories '.$querylang.' ORDER BY time DESC LIMIT '.$storynum.', '.$oldnum;
$result = $db->sql_query($sql);
$vari = 0;
// open slider divs
// $boxstuff .= '<div id="scroller_containerX">';
// li example
$boxstuff .= '<li id="scroller_containerX">';
$boxstuff .= '<div class="jscroller2_up jscroller2_speed-20 jscroller2_alternate jscroller2_mousemove" style="white-space:nowrap; margin:0;">';
while (list($sid, $title, $time, $comments) = $db->sql_fetchrow($result)) {
$sid = intval($sid);
$title = stripslashes($title);
$see = 1;
setlocale(LC_TIME, $locale);
// set new timestamp
// $tempstamp = new DateTime($time);
// $newtstamp = $tempstamp->format('l, d.m.Y');
ereg ('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime2);
$datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
$datetime2 = ucfirst($datetime2);
if ($articlecomm == 1) {
$comments = '('.$comments.')';
} else {
$comments = '';
}
if($time2==$datetime2) {
$boxstuff .= '<span><strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span><br />';
} else {
if(empty($a)) {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= '<strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span><br />';
$time2 = $datetime2;
$a = 1;
} else {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= '<strong><big>·</big></strong> <a href="modules.php?name=News&file=article&sid='.$sid.'">'.$title.'</a> '.$comments.'</span><br />';
$time2 = $datetime2;
}
}
$vari++;
if ($vari==$oldnum) {
$min = $oldnum + $storynum;
$dummy = 1;
}
}
// close slider divs
// $boxstuff .= '</div>';
$boxstuff .= '</div>';
// li example close
$boxstuff .= '</li>';
if ($dummy == 1 AND is_active('Stories_Archive')) {
// $boxstuff .= '</div><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
// ul example close
$boxstuff .= '</ul><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
} else {
// $boxstuff .= '</div>';
// ul example close
$boxstuff .= '</ul>';
}
if ($see == 1) {
$content = $boxstuff;
}
?>
|
EDIT: i think... i missed the topic name
i tried a another way and added the topictext into this block and if it its active, you can set a char count. if you disable the topic title in the block-file, then you can see only the story title with a own char count seeting.
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/************************************************************************/
/* Additional code clean-up, performance enhancements, and W3C and */
/* XHTML compliance fixes by Raven and Montego. */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
if (!isset($see)) {$see = ''; } // added by Guardin as variable wasnt defined
if (!isset($dummy)) { $dummy = ''; } // add by Guardian as variable was not defined
if (!isset($articlecomm)) { $articlecomm = ''; } // add by fkelly as variable was not defined
if (!isset($time2)) { $time2 = ''; } // add by fkelly as variable was not defined
// block settings: name of the topic before the title
$topictitle_on = 'on'; // set to another one or leave it empty '' and the topicname was not dislayed
$topictitle_on_count = '12'; // set topic title char count, if $topictitle_on = 'on';
$topictitle_on_storytitle_count = '20'; // set story title char count, if $topictitle_on = 'on';
$topictitle_off_storytitle_count = '34'; // set story title char count, if $topictitle_on = '';
$content = '';
getusrinfo($user);
if ($multilingual == 1) {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\' AND (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
} else {
$querylang = 'where (alanguage=\''.$currentlang.'\' OR alanguage=\'\')';
if ($new_topic != 0) {
$querylang .= ' AND topic=\''.intval($new_topic).'\'';
}
}
} else {
if ($categories == 1) {
$querylang = 'where catid=\''.intval($cat).'\'';
} else {
$querylang = '';
if ($new_topic != 0) {
$querylang = 'WHERE topic=\''.intval($new_topic).'\'';
}
}
}
if (isset($userinfo['storynum']) AND $user_news == 1) {
$storynum = $userinfo['storynum'];
} else {
$storynum = $storyhome;
}
//$boxstuff = '<div style="margin:0; padding:0; width:100%">';
// ul example
$boxstuff = '<ul class="oldarticleUL">';
$boxTitle = _PASTARTICLES;
$sql = 'SELECT s.sid, s.title, s.time, s.topic, s.comments, t.topictext, t.topicid FROM '.$prefix.'_stories s LEFT JOIN ' . $prefix . '_topics t ON t.topicid = s.topic '.$querylang.' ORDER BY s.time DESC LIMIT '.$storynum.', '.$oldnum;
$result = $db->sql_query($sql);
$vari = 0;
// open silder divs
// $boxstuff .= '<div id="scroller_containerX">';
// li example
$boxstuff .= '<li id="scroller_containerX">';
$boxstuff .= '<div class="jscroller2_up jscroller2_speed-20 jscroller2_alternate jscroller2_mousemove" style="white-space:nowrap; margin:0;">';
while (list($sid, $title, $time, $topic, $topictext, $topicid, $comments) = $db->sql_fetchrow($result)) {
$sid = intval($sid);
if ($topictitle_on == 'on') {
$topic2 = stripslashes($topicid);
$topictitle = stripslashes($topicid);
if ($topic2 != "") {
if(strlen($topic2) > $topictitle_on_count) {
$topic2 = substr($topic2,0, $topictitle_on_count-2)."..";
}
}
$title = stripslashes($title);
$storytitle = stripslashes($title);
if ($title != "") {
if(strlen($title) > $topictitle_on_storytitle_count) {
$title = substr($title,0, $topictitle_on_storytitle_count-2)."..";
}
}
$topicname_on = '<a href="modules.php?name=News&new_topic='.$topic.'" title="'.$topictitle.'">'.$topic2.'</a> ';
} else {
$topicname_on = '';
$title = stripslashes($title);
$storytitle = stripslashes($title);
if ($title != "") {
if(strlen($title) > $topictitle_off_storytitle_count) {
$title = substr($title,0, $topictitle_off_storytitle_count-2)."..";
}
}
}
$see = 1;
setlocale(LC_TIME, $locale);
ereg ('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $time, $datetime2);
$datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
$datetime2 = ucfirst($datetime2);
if ($articlecomm == 1) {
$comments = '<br />('.$comments.')';
} else {
$comments = '';
}
if($time2==$datetime2) {
$boxstuff .= '<span>'.$topicname_on.'<small>•</small> <a href="modules.php?name=News&file=article&sid='.$sid.'" title="'.$storytitle.'">'.$title.'</a> '.$comments.'</span><br />';
} else {
if(empty($a)) {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= ''.$topicname_on.'<small>•</small> <a href="modules.php?name=News&file=article&sid='.$sid.'" title="'.$storytitle.'">'.$title.'</a> '.$comments.'</span><br />';
$time2 = $datetime2;
$a = 1;
} else {
$boxstuff .= '<span><b>'.$datetime2.'</b><br />';
$boxstuff .= ''.$topicname_on.'<small>•</small> <a href="modules.php?name=News&file=article&sid='.$sid.'" title="'.$storytitle.'">'.$title.'</a> '.$comments.'</span><br />';
$time2 = $datetime2;
}
}
$vari++;
if ($vari==$oldnum) {
$min = $oldnum + $storynum;
$dummy = 1;
}
}
// close silder divs
// $boxstuff .= '</div>';
$boxstuff .= '</div>';
// li example close
$boxstuff .= '</li>';
if ($dummy == 1 AND is_active('Stories_Archive')) {
// $boxstuff .= '</div><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
// ul example close
$boxstuff .= '</ul><br /><a href="archive.html"><b>'._OLDERARTICLES.'</b></a>';
} else {
// $boxstuff .= '</div>';
// ul example close
$boxstuff .= '</ul>';
}
if ($see == 1) {
$content = $boxstuff;
}
?>
|
![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|