Bookmarks With Sub Folder

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Bookmarks With Sub Folder
Camber
CZ Newbie
 Codezwiz Site Donator
Camber has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: May 01, 2006
0.00 posts per day
Posts: 11
Points: 2,135
   
I tried to implement the bookmark mod but I have run into two problems:

1. My nuke install is in a sub folder of the main site i.e. domain/subfolder/phpnuke so when a book mark is created subfolder/phpnuke is listed in the DB but when the book mark is later accessed it becomes domain/subfolder/subfolder/phpnuke

2. The path to news articles is cut off at the SID. I figure that it is in includes/bookmark.php
$REQUEST_URI = substr($REQUEST_URI, 0, strlen($REQUEST_URI)-strlen(stristr($REQUEST_URI, '&SID')));

Removing the SID allows the full path to be captured notwithstanding the problem in number 1.

It's probably something simple but I can't figure it out can you help?


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Ok fix for #1 open the includes/bookmark.php and replace the function get_bookmark_url() with this one:


function get_bookmark_url() {
   global $nukeurl;
       if (ereg('IIS', $_SERVER['SERVER_SOFTWARE']) && isset($_SERVER['SCRIPT_NAME'])) {
           $REQUEST_URI = $_SERVER['SCRIPT_NAME'];
           if (isset($_SERVER['QUERY_STRING'])) {
               $REQUEST_URI .= '?'.$_SERVER['QUERY_STRING'];
           }
       } else {
           $REQUEST_URI = $_SERVER['REQUEST_URI'];
       }
       return $nukeurl.$REQUEST_URI;
}


The exisitng bookmarks in the database will have to be removed. Or you can write a query to fix them to include the $nukeurl. Let me know how it goes.

Now for #2 your saying the sid= is being removed from the URL? Can you leave a link to the site? Actually you can remove that line it was used for the Forums SID but it shouldnt affect the News.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Bookmarks With Sub Folder
Camber
CZ Newbie
 Codezwiz Site Donator
Camber has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: May 01, 2006
0.00 posts per day
Posts: 11
Points: 2,135
   
Thank you Telli for the quick reply! I tried this replacement code but it produced unexpected results.

Instead of duplicating the sub folder it is producing and entirely wrong URL.

For example on the bookmark of one news article here are the results:

Original Code:
http://domain/subfolder/subfolder/modules.php?name=News&file=article


Removing the SID in line 27 which was to prevent recording of the forum session ID produces:
http://domain/subfolder/subfolder/modules.php?name=News&file=article&sid=487&mode=nested&order=0&thold=0


This replacement code produces:
http://domain/subfolder/modules.php?name=Bookmarks&op=viewmark&bid=16


If $nukeurl is moved to the main global declaration the original results with the duplicated sub folder are produced.

I seems to me fine to bookmark the page with the sub folder but then on recalling the link from the database only append the domain name minus the sub folder to the query result. What do you think?


Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Thats very strange that it returns the nukeurl with the subfolder and then adds the subfolder again.

Humor me and save this as test.php upload it into your root and call it like so: test.php?name=Test&op=test

Let me know what it says.


<?php
require('mainfile.php');
function get_bookmark_url() {
   global $nukeurl;
       if (ereg('IIS', $_SERVER['SERVER_SOFTWARE']) && isset($_SERVER['SCRIPT_NAME'])) {
           $REQUEST_URI = $_SERVER['SCRIPT_NAME'];
           if (isset($_SERVER['QUERY_STRING'])) {
               $REQUEST_URI .= '?'.$_SERVER['QUERY_STRING'];
           }
       } else {
           $REQUEST_URI = $_SERVER['REQUEST_URI'];
       }
       return $nukeurl.'/'.$REQUEST_URI;
}

echo get_bookmark_url();




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: Bookmarks With Sub Folder
Camber
CZ Newbie
 Codezwiz Site Donator
Camber has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: May 01, 2006
0.00 posts per day
Posts: 11
Points: 2,135
   
Thank you for taking the time to work through this!

Mind you I put this in the PHPNuke root not the website root. When I ran it this is what it produced:

http://domain/subfolder///subfolder/test.php?name=Test&op=test


The pertinent part is the subfolder is duplicated and they are separated by ///.


Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Any chance you could allow me FTP access for a few minutes to check it out?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
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