Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

7 Wonder(ing)s of FancyURL

I'm chasing after some FancyURL problem that // is appended to the parmalink in some plugins. I was confused to see some plugins need to manually append the blog URL when creating link with createItemLink(), but others is not needed.....

Wondering #1
In globalfunctions.php, I saw this code:

...
...
$CONF['ItemURL'] = $CONF['Self'];
...
...
...
function createItemLink($itemid, $extra = '') {
  global $CONF;
  if ($CONF['URLMode'] == 'pathinfo')
    $link = $CONF['ItemURL'] . '/item/' . $itemid;
  else
    $link = $CONF['ItemURL'] . '?itemid=' . $itemid;
  return addLinkParams($link, $extra);
}
...
...
It seem that some plugins need to manually append IndexURL after calling createItemLink(), due to some problem that $CONF['Self'] is empty.

Wondering #2
In createItemLink(), it has the line:
$link = $CONF['ItemURL'] . '/item/' . $itemid;
This suggest ItemURL (which I believed is from $CONF['Self'] in fancyurls.config.php... with $CONF['Self'] in index.php set to "." Why?) should be without a trailing "/". Since the FancyURL link alreasy adding a / in front of item/itemid... True? I think the URL in normal need to to trail with /, even through browser can calm with it.

Wondering #3
In NP_Trackback, I saw this:
...
...
// a little hack to get a working permanent URL for the item
if (!$CONF['ItemURL'])
  $CONF['ItemURL'] = $blog->getURL();
$url = createItemLink($itemid);
...
...
This seem to fix the problem for plugin that need to add IndexURL in front of $url..... to make wonder #1 working properly.

Wondering #4
All the plugins that is working properly without have to append IndexURL or use the ItemURL hack in Wonder #3 seem to be those with only doSkinVar.... is that CONF['Self'] only function in doSkinVar?

Wondering #5
Given Wonder #1 and #3, should we put the #blog->getURL fix in globalfunctions.php so it's fixed once and for all?

Wondering #6
Is that only me find that there are many places with the Blog's URL too confusing?
  • $CONF['Self'] in index.php
  • $CONF['Self'] in fancyurls.config.php
  • Site URL in global setting
  • (Blog) URL in blog setting
  • Some plugin cans even access $CONF['IndexURL']
Can we simpify this?

Wondering #7
karma, where are you? (seem to be on vacation or something.... offline)

00:46:11 on 07/13/04 by Admun - Category: My Work - tags: none - print

Comments

hcgtv wrote:

Maybe karma is following the tour de france?

07/13/04 10:08:21

Admun wrote:

karma's answer can be found here: http://karma.nucleuscms.org...

07/27/04 12:06:53

Add Comments

 


<=   July 2014   =>
SunMonTueWedThuFriSat
  12345
6789101112
13141516171819
20212223242526
2728293031  

My Quick Links

Documentation

How-To & Tips

Source Code

Developers utc

Latest Comments

  • Admun says You need to install the plugin via plugin management menu in the admin panel (@left...
  • iacopo says after plugin upload in the right folder, I dont see in "manage plugin" to...
  • Nero megaupload says Yeah i had the same problem and i think NP_FancierURL2 was the problem.
  • Matthew says Yeah! Got it. Your htaccess regex for index.php helped me out. My htaccess is...
  • Matthew Rowles says Hi Admun I have a problem with NP_TechnoratiTags wherein if I click on a tag, it...
  • Admun says I don't think there was table schema change.... what error you got?
  • Matthew says The database tables created with v2.0 are incompatible with v2.1.2. Is there a way...
  • Admun says If you checked the wiki, you should see: 4,7,14,21,28,35,42,49,56 * * * * root...

Most Downloads