Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...
Author Message
mordain
Regular
Regular


Joined: Jul 08, 2006
Posts: 77

PostPosted: Tue Aug 01, 2006 9:58 am Reply with quote

Hey all,

I'm wondering if there is a way to put a link to another side in the modules block. I would, of coarse, need to rename it so that the entire url isn't there. Is there a way to do it?

edit: I just realized I posted in the wrong area. Sorry Sad .
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Tue Aug 01, 2006 10:12 am Reply with quote

You could either modify the modules block to have the link, or create a custom module.

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
mordain
PostPosted: Tue Aug 01, 2006 3:57 pm Reply with quote

Well then here is the question, since I have yet to become the PHP code expert that I someday hope to be Smile , how would I change the code to have the link in it?

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 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.       */
/************************************************************************/

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

global $prefix, $db, $admin;

    $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'");
   }
    }

    /* Now we make the Modules block with the correspondent links */

    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"index.php\">"._HOME."</a><br>\n";
    $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) {
      $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n";
       }
   }
    }

    /* If you're Admin you and only you can see Inactive modules and test it */
    /* If you copied a new module is the /modules/ directory, it will be added to the database */
   
    if (is_admin($admin)) {
   $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', '0')");
      }
       }
   }
   $content .= "<br><center><b>"._INVISIBLEMODULES."</b><br>";
   $content .= "<font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font></center><br>";
   $result5 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC");
   while ($row5 = $db->sql_fetchrow($result5)) {
       $mn_title = stripslashes($row5['title']);
       $custom_title = $row5['custom_title'];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n";
      $dummy = 1;
       } else {
      $a = 1;
       }
   }
   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
   $content .= "<br><center><b>"._NOACTIVEMODULES."</b><br>";
   $content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>";
   $result6 = $db->sql_query("SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC");
   while ($row6 = $db->sql_fetchrow($result6)) {
       $mn_title = stripslashes($row6['title']);
       $custom_title = $row6['custom_title'];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$mn_title\">$mn_title2</a><br>\n";
      $dummy = 1;
       } else {
      $a = 1;
       }
   }
   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
    }

?>
 
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Tue Aug 01, 2006 9:10 pm Reply with quote

Now I would recomend somaire block if this is an option.

Else I'd do this:

Find

}

/* If you're Admin you and only you can see Inactive modules and test it */
/* If you copied a new module is the /modules/ directory, it will be added to the database */


Change to

}
$content .="<strong><big>&middot;</big></strong><a href=\"http://yourlink/\">yourlinktext</a><BR>";
/* If you're Admin you and only you can see Inactive modules and test it */
/* If you copied a new module is the /modules/ directory, it will be added to the database */



That should put it right below the other links.

Edited by me for the bullet.
That will show a bullet before it now And spaces.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!!

Last edited by gregexp on Thu Aug 03, 2006 7:26 pm; edited 3 times in total 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
mordain
PostPosted: Thu Aug 03, 2006 9:31 am Reply with quote

The link worked great, but there are two problems.

1. Everything in the menu has a bullet (a dot) in front of it, but this doesnt.

2. The links on the blocks are double spaced (push enter twice after typing a line of text), but This is not. There is no space between it and the link above it.
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6793
Location: Ha Noi, Viet Nam

PostPosted: Thu Aug 03, 2006 1:16 pm Reply with quote

Just add a BR tag or two to the end of the line.
If you look at other lines you will see the use of 'middot' for the bullet, follow the example and you'll be fine.
 
View user's profile Send private message Send e-mail
mordain
PostPosted: Fri Aug 04, 2006 3:12 pm Reply with quote

Worked great! Thanks a lot guys!
 
Guardian2003
PostPosted: Fri Aug 04, 2006 3:23 pm Reply with quote

Well dont for figuring out my cryptic clue Smile
Nice to know you got it sorted how you wanted it.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Seeking applications ...

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 ©