Menu

#82 Use Text::moduleLink instead of hardcoded links

open
nobody
None
5
2005-06-10
2005-06-10
rck
No

(see also my folder hack #2)

I know now, why the short url hack of eloy doesn't work
for my phpwsbb installation: The URLs are broken! the
short url intercepts the moduleLink method of
phpwebsite which is responsible for creating
inter-module links.

example use:

$linka=array();
$linka['PHPWSBB_MAN_OP']='view';
$linka['PHPWS_MAN_ITEMS']=$row['lastpost_thread_id'];

$link=PHPWS_Text::moduleLink($row['post_label'],
'phpwsbb', $linka);

current implementation (excerpt):

$ grep module= *
Forum.php:
$_SESSION['OBJ_fatcat']->saveSelect($this->getLabel(),
'index.php?module=phpwsbb&PHPWSBB_MAN_OP=viewforum&PHPWS_MAN_ITEMS='
. $this->getId(), $this->getId());
Forum.php:
$GLOBALS['CNT_phpwsbb']['content'] .= '<a
href="./index.php?module=phpwsbb&amp;PHPWSBB_MAN_OP=list">'
. $_SESSION['translate']->it('Back to Forums') . '</a>';
Forum.php: , '<a
href="./index.php?module=phpwsbb&amp;PHPWSBB_MAN_OP=view&amp;PHPWS_MAN_ITEMS='
. $this->_lastpost_topic_id . '#' .
$this->_lastpost_post_id . '">' .
$this->_lastpost_topic_label . '</a>'
ImgLibrary.php: , $module=null,
$base_dir='library', $block='CNT_user', $image_type='image'
ImgLibrary.php:
$pager->setlinkback('index.php?module='.$this->_module
ImgLibrary.php: $tags['GALL_EXIT_LNK'] = '[<a
href="index.php?module='.$this->_module
Manager.php: $tags['ADD_FORUM'] = '<a
href="index.php?module=phpwsbb&amp;PHPWSBB_MAN_OP=editforum">'.$addForum.'</a>';
Manager.php: $tags['SETTINGS'] = '<a
href="index.php?module=phpwsbb&amp;PHPWSBB_MAN_OP=getsettings">'.$settings.'</a>';
Manager.php: $tags['REMOVEALLMONITORS'] = '<a
href="./index.php?module=phpwsbb&amp;PHPWSBB_MAN_OP=removeallmonitors">'
. $_SESSION['translate']->it('Remove all monitors') .
'</a>';
M

Discussion

  • Shaun Murray

    Shaun Murray - 2005-06-10

    Logged In: YES
    user_id=722742

    I don't think we'd change this now.

    phpWebSite v1.0 has a fully implemented short URL mod_rewrite solution
    so it'll more than likely get changed then.

     
  • rck

    rck - 2005-06-11

    Logged In: YES
    user_id=1035762

    Will it still use moduleLink?

     
  • Shaun Murray

    Shaun Murray - 2005-06-11

    Logged In: YES
    user_id=722742

    There is a moduleLink in fallout but there's also a rewriteLink and a
    bunch of other stuff so it appears just now that it doesn't work the same
    as Eloi's hack.

    It seems pointless changing it now and generating links which won't be
    compatible with fallout IMHO. That's why I've never used Eloi's hack in
    a production site as I knew the fallout solution may create compatibility
    problems with old content. The URLs it generates don't match those
    generated by fallout's method.

    I guess what would be best would be for us to back port the fallout
    mod_rewrite code into 0.10.x once we know the URL rewriting is stable.
    Or for Eloi to forward port his hack into fallout so that your old rewritten
    links still work.

    We almost certainly should be using moduleLink now but I think it'll just
    cause you grief in conjunction with the hack.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.