1
kristarose
Short URL DIFFICULT HACK - HELP!
  • 2008/6/5 19:39

  • kristarose

  • Just popping in

  • Posts: 28

  • Since: 2008/3/22


This is a love - hate relationship. I NEED to make my client happy by supplying him with a short URL for his start page, which is the Content Module. The current URL is:http://www.earthboundexpeditions.com/cms/htdocs/modules/content/index.php?id=1

I've spent hours and hours and hours searching the forums for a simple way to do this but just come up with dead links for Short URLs hack, Simple URLs hacks. I've looked at the Emma Watson Online guide but can't seem to figure that one out (it may not even work).

I'm using XOOPS 2.0.18.

Does ANYONE have a clue on how to do this? This is driving me to drink and drugs!

2
trabis
Re: Starting to hate Xoops
  • 2008/6/5 20:14

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


It will depend of the module code but you can try this.

Make a file with the name you want at the root of your domain (in the same tree as mainfile.php)

Add this lines:
<?php
        
include ('mainfile.php');
        
$this_name 'content';
        
$newUrl '/cms/htdocs/modules/content/index.php';
        
$newuri '?id=1';

        
$_GET['id'] = 1;
        
$_SERVER['REQUEST_URI'] =  $newUrl.$newuri;
        
$_ENV['PHP_SELF'] = $newUrl;
        
$_SERVER['SCRIPT_NAME'] = $newUrl;
        
$_SERVER['PHP_SELF'] = $newUrl;

        
$module_handler =& xoops_gethandler('module');
        
$xoopsModule =& $module_handler->getByDirname($this_name);

        if (!
$xoopsModule || !$xoopsModule->getVar('isactive')) {
            include_once 
XOOPS_ROOT_PATH."/header.php";
            echo 
"<h4>"._MODULENOEXIST."</h4>";
            include_once 
XOOPS_ROOT_PATH."/footer.php";
            exit();
        }
        
$moduleperm_handler =& xoops_gethandler('groupperm');
        if (
$xoopsUser) {
            if (!
$moduleperm_handler->checkRight('module_read'$xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
                
redirect_header(XOOPS_URL."/user.php",1,_NOPERMfalse);
                exit();
            }
            
$xoopsUserIsAdmin $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
        } else {
            if (!
$moduleperm_handler->checkRight('module_read'$xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
                
redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
                exit();
            }
        }
        if ( 
file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php") ) {
            include_once 
XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php";
        } else {
            if ( 
file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php") ) {
                include_once 
XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php";
            }
        }
        if (
$xoopsModule->getVar('hasconfig') == || $xoopsModule->getVar('hascomments') == || $xoopsModule->getVar'hasnotification' ) == 1) {
            
$xoopsModuleConfig =& $config_handler->getConfigsByCat(0$xoopsModule->getVar('mid'));
        }

        include(
XOOPS_ROOT_PATH.$newUrl);

?>


This depends a lot of the content module,I did not look into it.
This is an extract of the seo module I was doing and may have bugs.

Please give me feedback.

3
kristarose
Re: Starting to hate Xoops
  • 2008/6/5 20:37

  • kristarose

  • Just popping in

  • Posts: 28

  • Since: 2008/3/22


Thanks for the reply Trabis. Let me see if I understand. I've taken your code and put it into a file called "home.php" I've placed that file in the same directory where mainfile.php exists. Please excuse my lack of understanding here, but from this point what should I do..?

The goal is to changehttp://www.earthboundexpeditions.com/cms/htdocs/modules/content/index.php?id=1
to the following urlhttp://www.earthboundexpeditions.com (or as close as possible).

Thanks very much for you support and help with this.

4
trabis
Re: Starting to hate Xoops
  • 2008/6/5 20:43

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


http://www.earthboundexpeditions.com/cms/htdocs/home.php should do it

please try it, if it works, then you can move it to another level and change the line that points to mainfile.php

5
trabis
Re: Starting to hate Xoops
  • 2008/6/5 20:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Maybe you could use htacess. for that.
I´m sure there is some body here taht could help you

6
avtx30
Re: Short URL DIFFICULT HACK - HELP!
  • 2008/6/5 21:24

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


Hi kristarose,

You keep asking the same question over topics and comments? Don't see any effort of you to solve problems
Xoops Demos:
http://www.nhatban.net/info/a0021.html

7
avtx30
Re: Short URL DIFFICULT HACK - HELP!
  • 2008/6/5 22:13

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


If you follow my instruction, you can change (for example)
http://www.earthboundexpeditions.com/modules/content/index.php?id=1


to
http://www.earthboundexpeditions.com/about.html


Demo:

Before:http://x20.nhatban.net/modules/content/index.php?id=1

After:http://x20.nhatban.net/about.html
Xoops Demos:
http://www.nhatban.net/info/a0021.html

8
kristarose
Re: Short URL DIFFICULT HACK - HELP!

You'll have to excuse me avtx30 as I've spent a lot of time ending up at dead links trying to solve this. I've kept a log of those dead links...about 30 of them.

While I'm not new at XOOPS and have been designing sites for the last 6 years, I do run into issues beyond my skill set level.

My case in point is your direction to follow your instruction. Do I use GIJOE's method? Your method instructs the following:

First, add to your .htaccess file under XOOPS_ROOT_PATH so that it will look like this

http://www.nhatban.net/tmp/htaccess.txt

Finally, add to your mainfile.php under XOOPS_ROOT_PATH so that it will look like this

http://www.nhatban.net/tmp/mainfile.txt


Not too clear about the above.

Also, am I having an issue due to the fact of where my XOOPS application resides -

/public_html/cms/htdocs

If the file location is a problem than I would need to move the whole site...not something I'm looking forward to.

The fact that there are dozens and dozens and dozens of postings on this issue tell me that it's not an easy one to resolve....for many XOOPS users.

Thanks for you reply and help...

Login

Who's Online

230 user(s) are online (161 user(s) are browsing Support Forums)


Members: 0


Guests: 230


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits