Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Sun Nov 29, 2009 2:58 pm
Eduardo, ok, worked on this a little bit and here is what I came up with:
Code:
<?php
if (!defined('BLOCK_FILE')) {
Header('Location: ../index.php');
die();
}
$blkh = 10; // Number of lines high
$blkw = 45; // Number of characters wide 0 = unused
$scron = 1; // Turn scrolling on by setting to 1
$scrdr = 'up'; // Scroll direction (up, down, left, or right)
$scrhg = 200; // Scroller height in pixels
$scrwd = 145; // Scroller width in pixels
$speed = 2; // Speed Of Scroll
$scrolldelay = 75; // Scroll delay - small the number the smoother the scroll
global $prefix, $db;
$content = '';
$result = $db->sql_query('SELECT `cid`, `title` FROM `' . $prefix . '_pages_categories` ORDER BY `title`');
if ($db->sql_numrows($result) > 0) {
if ($scron == 1) {
$content .= '<marquee behavior="scroll" direction="'.$scrdr.'" height="'.$scrhg.'" width="'.$scrwd.'" scrollamount="'.$speed.'" scrolldelay="'.$scrolldelay.'" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
$content .= '<div id="ContentLast"><ul>'; // special 'id' is provided so can style the <ul> tags according to personal liking via ".ContentLast ul" and ".ContentLast ul ul"
// Cycle through each category
while (list($cid, $title) = $db->sql_fetchrow($result)) {
$content .= '<li>' . $title;
$result1 = $db->sql_query('SELECT `pid`, `title` FROM `' . $prefix . '_pages` WHERE `active` = \'1\' AND `cid` = \'' . $cid . '\' ORDER BY `pid` DESC LIMIT 10');
if ($db->sql_numrows($result1) > 0) {
$content .= '<ul>';
while (list($pid, $ptitle) = $db->sql_fetchrow($result1)) {
$content .= '<li><a href="contentid-' .$pid . '.html">' . $ptitle .'</a></li>';
}
$content .= '</ul>';
}
$content .= '</li>';
}
$content .= '</ul></div>';
if ($scron == 1) {
$content .= '</marquee>';
}
}
?>
This is what you have asked for thus far plus a little bit more (with the marquee options). I added a special DIV wrapper to it so that you can use CSS to style the individual <ul> tags to your liking.
Hopefully you found this helpful and wouldn't mind donating to Raven's site here a little bit to help out with covering his expenses.
I made a donation.
Congratulations on your skill and sophistication.
I have some problems of style.
The margins are too far.
On the categories there are not the links and the bold in the text, even the text color is not correct.
Please go to
Only registered users can see links on this board! Get registered or login to the forums!
and compare the last block (YOURS) with the penultimate (MINE).
The blocks are in the left side, the name is "Notizie da ..."
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Wed Dec 09, 2009 6:44 am
Eduardo, I have given you enough, I believe, to where you can now look up the other CSS that you need to do this quite easily. Yes, I could do this for you, but then you wouldn't learn anything from it. The following is an excellent site for learning CSS:
Only registered users can see links on this board! Get registered or login to the forums!
I can learn the CSS discipline, but surely it will not suffice.
I am sorry that you live in Arizona.
You'd certainly an excellent teacher for me.
Unfortunately I live in the most extreme points of Europe.
During this life I can only design systems. To make next life.
Thanks for your help but for me it is not enough.
Unfortunately I am not able to complete the good work done by Montego.
Please, try you to complete the block.
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Thu Dec 10, 2009 6:37 am
Eduardo, the original block code that you provided appeared to me to use ShortLinks or other form of GoogleTap, therefore, that is the style link that I provided and it works perfectly in my environment. In addition, there are NO code changes needed, only CSS, in order to get the category titles bolded and the links underlined.
Tell you what. I do not have time today to do this for you, but I will be off work tomorrow and will make these tweaks for you. HOWEVER, please let me know what type of nuke system you are running, plus version, and whether you are using ShortLinks, or GT-NExtGEn or any other type of link shortening system.
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Fri Dec 11, 2009 10:02 am
Ok, here is the completed block. Take a look at some of the configuration options that you have available:
Code:
<?php
/**
* Content Plus: Last NN Content Pages Block
*
* This script may be used in either RavenNuke(tm) or PHP-Nuke along with
* either the regular Content module or Content Plus module and is quite
* configurable, including scrolling (not XHTML compliant).
*
* PHP versions 4 and 5
*
* LICENSE: GNU/GPL 2
*
* @package RavenNuke(tm)
* @subpackage Content Plus
* @category Blocks
* @author Rob Herder (aka: montego) <montego@montegoscripts.com>
* @copyright 2009 by RavenPHPScripts and Montego Scripts
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GNU/GPL 2
* @version 1.0
* @link http://www.ravenphpscripts.com and http://montegoscripts.com
* @since 2.50.00
* @uses The configuration options below should be self-explanatory.
*/
if (!defined('BLOCK_FILE')) {
Header('Location: ../index.php');
die();
}
/**
* Configuration Options
*/
$pages = 10; // Number of pages (max) per category to show
$blkh = 10; // Number of lines high
$blkw = 45; // Number of characters wide 0 = unused
$scron = 0; // Turn scrolling on by setting to 1
$scrdr = 'up'; // Scroll direction (up, down, left, or right)
$scrhg = 200; // Scroller height in pixels
$scrwd = 145; // Scroller width in pixels
$speed = 2; // Speed of scroll
$scrolldelay = 75; // Scroll delay - small the number the smoother the scroll
$showcatlink = true; // true = provide category link, false = no category link (default)
global $prefix, $db;
$content = '';
$result = $db->sql_query('SELECT `cid`, `title` FROM `' . $prefix . '_pages_categories` ORDER BY `title`');
if ($db->sql_numrows($result) > 0) {
if ($scron == 1) {
$content .= '<marquee behavior="scroll" direction="' . $scrdr . '" height="' . $scrhg . '" width="' . $scrwd . '" scrollamount="' . $speed . '" scrolldelay="' . $scrolldelay . '" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
$content .= '<div id="ContentLast"><ul>'; // special 'id' is provided so can style the <ul> tags according to personal liking via "#ContentLast ul" and "#ContentLast ul ul"
// Cycle through each category
while (list($cid, $title) = $db->sql_fetchrow($result)) {
$content .= '<li>';
if ($showcatlink) {
$content .= '<a href="modules.php?name=Content&pa=list_pages_categories&cid=' . $cid . '">' . $title . '</a>';
} else {
$content .= $title;
}
$result1 = $db->sql_query('SELECT `pid`, `title` FROM `' . $prefix . '_pages` WHERE `active` = 1 AND `cid` = ' . (int)$cid . ' ORDER BY `pid` DESC LIMIT ' . $pages);
if ($db->sql_numrows($result1) > 0) {
$content .= '<ul>';
// Cycle through each page within the given category
while (list($pid, $ptitle) = $db->sql_fetchrow($result1)) {
$content .= '<li><a href="modules.php?name=Content&pa=showpage&pid=' . $pid . '">' . $ptitle . '</a></li>';
}
$content .= '</ul>';
}
$content .= '</li>';
}
$content .= '</ul></div>';
if ($scron == 1) {
$content .= '</marquee>';
}
}
?>
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum