mazsalleh
Senior Member   Posts: 149 Registered: 1/31/2004 Status: Offline
|
posted on 6/15/2007 at 11:10 AM |
Hi Shawn!
I need another code snipet of you to get the backend.php to show the
autourlV4.
Here is the code from the backend.php:
// get the short urls extensions
$urlsok = pnModGetVar('Xanthia', 'shorturlsok');
$urlextension = pnModGetVar('Xanthia', 'shorturlsextension');
$baseurl = pnGetBaseURL(); ____________________ Carl
MazDev.com
Fishing & Boat trips at the isle Langkawi - Malaysia
|
| |
| |
Shawn
Administrator   Posts: 4575 Registered: 10/7/2002 Status: Online
|
posted on 6/15/2007 at 11:20 AM |
I need the part that actually runs the shorturls. AutoURLs extra already
figures out the extensions and stuff for you.
-Shawn |
| |
mazsalleh
Senior Member   Posts: 149 Registered: 1/31/2004 Status: Offline
|
posted on 6/15/2007 at 01:09 PM |
I guess this is the part you need.
quote: // form the url
if($urlsok == 1) {
$link =
pnVarPrepForDisplay("{$baseurl}Article$sid.$urlextension");
} else {
$link =
pnVarPrepForDisplay("{$baseurl}index.php?name=News&file=article&sid
=$sid");
}
$content = pnVarPrepForDisplay(strip_tags($hometext));
I know that the AutoURLs extension figures out the extensions. The problem
here is only that PN points everything towards Xanthia. ____________________ Carl
MazDev.com
Fishing & Boat trips at the isle Langkawi - Malaysia
|
| |
Shawn
Administrator   Posts: 4575 Registered: 10/7/2002 Status: Online
|
posted on 6/15/2007 at 01:42 PM |
OK, I see. So for this and your last post you need to see if AutoURLs are
enabled and also the extension to build a link. Sorry wasn't paying
attention.
$autoextra = atAutoGetVar('autoextra');
if ($autoextra['autourlsV4'] == 1) {
$autourls = atAutoGetVar('autourlsV4');
$urlextension = $autourls['extension'];
$link = pnVarPrepForDisplay("{$baseurl}Article$sid.$urlextension");
} else {
$link =
pnVarPrepForDisplay("{$baseurl}index.php?name=News&file=article&sid
=$sid");
}
-Shawn
[Edited on 6/15/2007 by Shawn] |
| |
mazsalleh
Senior Member   Posts: 149 Registered: 1/31/2004 Status: Offline
|
posted on 6/15/2007 at 02:19 PM |
Worked perfect.
Only for the others to keep it easy:
by backend.php =
// get the short urls extensions about line 58
$urlsok = pnModGetVar('Xanthia', 'shorturlsok');
$urlextension = pnModGetVar('Xanthia', 'shorturlsextension');
$baseurl = pnGetBaseURL();
change this to:
// get the short urls extensions
$autoextra = atAutoGetVar('autoextra');
$autourls = atAutoGetVar('autourlsV4');
$urlextension = $autourls['extension'];
$baseurl = pnGetBaseURL();
and about line 126
// form the url
if($urlsok == 1) {
$link = pnVarPrepForDisplay("{$baseurl}Article$sid.$urlextension");
} else {
$link =
pnVarPrepForDisplay("{$baseurl}index.php?name=News&file=article&sid
=$sid");
}
change it to:
if ($autoextra['autourlsV4'] == 1) {
$link =
pnVarPrepForDisplay("{$baseurl}Article$sid.$urlextension");
} else {
$link =
pnVarPrepForDisplay("{$baseurl}index.php?name=News&file=article&sid
=$sid");
} ____________________ Carl
MazDev.com
Fishing & Boat trips at the isle Langkawi - Malaysia
|
| |