Link to off site page in modules:

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Link to off site page in modules:
Cujo
CZ Newbie
Cujo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Mar 30, 2005
0.00 posts per day
Posts: 9
Points: 267
   
Can anyone tell me how to put a link in my modules list to show an off site page that "dont" show within my site?



Back to top Reply with quote
#2   re: Link to off site page in modules:
veef
CZ Super Newbie
veef has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Dec 30, 2004
0.01 posts per day
Posts: 59
Points: 1,422
   
Ok the html is getting messed up in the code even though it is disabled??? so have a look at the attachment for the correct code.

In the block "block-Modules.php" locate
    /* Now we make the Modules block with the correspondent links */

    $content .= "<strong><big>·;</big></strong> ;;<a href=\"http://www.somesite.net\" target=\"_blank\">Somesite</a><br>\n";
    $content .= "<strong><big>·;</big></strong> ;;<a href=\"index.html\">"._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>·;</big></strong> <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 */

this is where the links are generated, but the thing is that it puts the home link first then generates an alphabetical list of modules so you can only put your link before or after the home link or at the bottom of the list. To do this just insert this code in the location you want your link.
$content .= "<strong><big>·;</big></strong> <a href=\"http://www.somesite.net\" target=\"_blank\">Somesite</a><br>\n";

So for example we would have this for above home
    /* Now we make the Modules block with the correspondent links */

    $content .= "<strong><big>·;</big></strong> <a href=\"http://www.somesite.net\" target=\"_blank\">Somesite</a><br>\n";
    $content .= "<strong><big>·;</big></strong> <a href=\"index.html\">"._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>·;</big></strong> <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 */

And this for the bottom of the list
    /* Now we make the Modules block with the correspondent links */


    $content .= "<strong><big>·;</big></strong> <a href=\"index.html\">"._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>·;</big></strong> <a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n";
       }
   }
    }

    $content .= "<strong><big>·;</big></strong> <a href=\"http://www.somesite.net\" target=\"_blank\">Somesite</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 */

Or you could just make another block with your links.


Attached Files
block-Modules.zip (1.78 KB, Downloaded: 5235 Time(s))


Back to top Reply with quote
#3   re: Link to off site page in modules:
kingofbling
CZ Super Newbie
kingofbling has been a member for over 20 year's 20 Year Member
canada.gif
Website:
Status: Offline
Joined: Jun 17, 2004
0.01 posts per day
Posts: 39
Points: 1,659
   
can i run a javascript popup window in the same kind of way? Where would I put the script code?



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum