Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro
Author Message
mrbilly
Worker
Worker



Joined: Jun 07, 2006
Posts: 114

PostPosted: Tue Jul 25, 2006 6:52 am Reply with quote

I am using Raven's RavenNuke76 v2.02.02 Distro and have downloaded the Quick Links Menu and it apears to work OK. I am not sure which version I have downloaded, but the code within it follows at the end of this posting.

The problem I have is that if the number of characters in a module title exceeeds 16 characters, the width of the Quick Links Block increases and makes the rest of my blocks in the middle of my website and to the right of the website go out of alignment and petrude/extend to the right.

I note that this is not a problem with the Quick Links Menu used here on www.ravenphpscripts.com, so I would appreciate it if someone would advise me how to stop this prolem happening on my website.

The code for the block I am using is as folows...

<?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 */
/************************************************************************/
/* Customised by Raven for use on his site */
/* 2005 Raven */
/* http://www.ravenphpscripts.com -- http://www.ravenwebhosting.com */
/************************************************************************/

//if (eregi("block-Modules.php", $_SERVER['SCRIPT_NAME'])) {
if ( !defined('BLOCK_FILE') ) {
Header("Location: index.php");
die();
}

global $prefix, $db, $admin, $nukeurl;

$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
include("themes/$ThemeSel/module.php");
if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
$def_module = $default_module;
} else {
$def_module = "";
}
}

$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];

/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
$title = stripslashes($row2['title']);
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
$db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
}
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
$mid = intval($row4['mid']);
$mod_uname = ereg_replace("_", " ", $modlist[$i]);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
}
}
}
$content .= "<center><select class=\"mymodulesselectbox\" size=\"1\" name=\"name\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">";
$content .= "<option>Select</option>";
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = ereg_replace("_", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$selected = '';
$content .= "<option value=\"modules.php?name=$m_title\">&middot;&nbsp;$m_title2</option>";
}
}
}
$content .= "</select><br/>";
?>
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Jul 26, 2006 8:42 am Reply with quote

Since this is using a SELECT object in HTML the only thing you can do programmatically is truncate the string. However, I don't think that is what you would want? I propose shortening your custom titles to something that is shorter yet still meaningful.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
mrbilly







PostPosted: Wed Jul 26, 2006 9:02 am Reply with quote

Hey Montego thank you for replying to this problem.

I am not sure what you mean by 'Since this is using a SELECT object in HTML...'.

I do realise that one solution is to make the module names much shorter, however this does not explain how the Quick Links Menu on this website, (Ravenphpscripts.com), does not have the same problem as I do.

Can anyone else help further please?
 
montego







PostPosted: Wed Jul 26, 2006 10:14 am Reply with quote

Ah, I see what you mean. I dissected Raven's code (by viewing source) and he is using CSS to control that! Find where the class "mymodulesselectbox" is defined and mess with the "width" parameter for it. Raven is using 140px here on this site.

Sorry, but I am not where I can easily dig into this further. Hopefully this is enough to get you going in the right direction.
 
mrbilly







PostPosted: Wed Jul 26, 2006 10:32 am Reply with quote

Thanks for that last message.

Should I assume that when you explain ...'Raven is using 140px here on this site...', you are refering to the width of the blocks and the Quick Links Block this topic is about?

I do not think the 140px fact is too much of an issue because it still does not exaplin why some of the exceptionally long module names are still contained within the set width of the block and do not mess up the alighnment.

I wonder if 'the master himself' would be able to give a definitive answer (and possibly point me in the correct direction, possibly with information as to where I can find a block like this.)?

Raven o Raven where for art tho?!... Rolling Eyes
 
montego







PostPosted: Wed Jul 26, 2006 2:53 pm Reply with quote

Quote:

Should I assume that when you explain ...'Raven is using 140px here on this site...', you are refering to the width of the blocks and the Quick Links Block this topic is about?


mrbilly, I have given you the information that you need to correct this. All you need to know is a little HTML and CSS. The drop-down pick list (an HTML SELECT object) sizes itself based on the options listed in it. However, I did "View Source" on Raven's site here and I see that he is using the referenced CSS class to control the width of this pick list!

You do not need a different block, you just need to find that class definition that I mentioned and I am pretty sure that giving it the parameter I described will work.

Have I tested this? NO. I am at work and do not have the ability to do so.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©