SOLUTION:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
In the who's online page, it says Viewing the article 27 like so:
Viewing the article 27 (http://www.kaitech.hk/content/view/179/).
1. The above URL is missing the ItemID of the Joomla menu (correct link: http://www.kaitech.hk/content/view/179/27/)
2. Is it supposed to show "Viewing the article article_title" instead? (or have I misconfigured something?)
Did you change something in smf_integration_arrays.php?
This is the code in smf.php that generates that:
$mos_find_article = mysql_query ("SELECT title
FROM {$mosConfig_dbprefix}content
WHERE id = $actions[id]
LIMIT 1");
list ($article_name) = mysql_fetch_row($mos_find_article);
mysql_select_db($db_name);
return sprintf($txt['who_article'], $actions['id'], $actions['Itemid'], $article_name);
So, it definitely gets the article title from the database....
Hmm, is the smf_integration_arrays.php you speak of in <joomla root>/components/com_smf?
If so, I don't have the above code inside that file !! ??? (a search for $mos_find_article turned up nothing)
edit - found the code in smf.php... mine looks like this (I didn't edit it).
$mos_find_article = mysql_query ("SELECT title
FROM {$mosConfig_dbprefix}content
WHERE id = $actions[id]
LIMIT 1");
list ($article_name) = mysql_fetch_row($mos_find_article);
mysql_select_db($db_name);
return sprintf($txt['who_article'], $actions['id'], $actions['Itemid'], $article_name);
In smf_integration_arrays.php, this is the string that it returns:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&id=%d&Itemid=%d' : sefReltoAbs ('index.php?option=com_content&task=view&id=%d&Itemid=%d')) . '">%s</a>.';
As you can see from this code:
return sprintf($txt['who_article'], $actions['id'], $actions['Itemid'], $article_name);
The first two items replaced in $txt['who_article'] are $actions['id'] and $actions['Itemid'], and the last is $article_name.
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&id=%d&Itemid=%d' : sefReltoAbs ('index.php?option=com_content&task=view&id=%d&Itemid=%d')) . '">%s</a>.';
:S
So what could be wrong? Are my menus setup wrong?
Can you check your Joomla content table, and make sure that the field named 'title' of that entry has a value?
And, can you try changing this line in smf.php:
return sprintf($txt['who_article'], $actions['id'], $actions['Itemid'], $article_name);
to this:
return sprintf($txt['who_article'], $actions['id'], intval($actions['Itemid']), $article_name);
The articles definitely have a value in the 'title' field. No 'title_alias', but that shouldn't affect anything.
Tried adding the intval... but no improvement...
It seems to be thinking that Itemid is a string rather than an integer. If making it an intval doesn't help, then how about we change the definition in smf_integration_arrays.php?
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&id=%d&Itemid=%s' : sefReltoAbs ('index.php?option=com_content&task=view&id=%d&Itemid=%s')) . '">%s</a>.';
No luck. :(
Something must be wrong with my setup? but what could be wrong?
I noticed that categories are not viewed correctly as well.
QuoteViewing the article 56.
Viewing the category 37.
What version of PHP is this?
PHP: 4.3.10
Joomla!: 1.0.11 Stable
ps. to recap, viewing articles -- link generated = /content/view/176/, missing the 28 at the end.
who's online shows Viewing the article 28.
viewing category -- link generated = /content/category/0/, missing the 37 at the end.
who's online shows Viewing the category 37.
OK, how about like this?
In smf_integration_arrays.php:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%d&id=%d' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%d&id=%d')) . '">%s</a>.';
And in smf.php:
return sprintf($txt['who_article'], $actions['Itemid'], $actions['id'], $article_name);
No difference it appears...
If you look in your smf_log_online table, can you copy the session data from the row with that URL and paste it here so I can see it?
Sure, is this what you are looking for?
a:5:{s:6:"option";s:11:"com_content";s:4:"task";s:4:"view";s:2:"id";s:2:"13";s:6:"Itemid";s:2:"47";s:10:"USER_AGENT";s:74:"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)";}
Yup. This:
s:6:"Itemid";s:2:"47";
Would indicate that $actions['Itemid'] should be a string -- "47". They all look like strings in your session, actually, so let's try this in smf_integration_arrays.php:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%s&id=%s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%s&id=%s')) . '">%s</a>.';
Still no dice. Do I have to clear cache or anything like that?
This is strange cuz no one else seems to have this problem. Must be something with my setup??
I don't know. You don't have an altered SEF component, do you?
How about we force some specifics in the string:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%1$&id=%2$s')) . '">%3$s</a>.';
No, just the default Joomla SEF.
Anything to do with .htaccess? But there should be nothing in there either relating to the Joomla content URLS.
OK with your code above this post, the String is now correct, but the URL is still not appending the last ItemID/Category ID (Or whatever it is...)
Quote from: who's onlineViewing the article HP iPAQ rx4000 & rx5915
Linked URL: /content/view/177/
Should be: /content/view/177/28/
::) ::) ::)
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s')) . '">%3$s</a>.';
Sorry, there was a typo in that last post. :-[
Nope, still no ItemID at the end... ???
Linked URL: /content/view/179/
Should be: /content/view/179/27/
OK, let's see if it's SEF. Try this?
$txt['who_article'] = 'Viewing the article <a href="' . $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s' . '">%3$s</a>.';
OK, that works!
Right, but the URL is not SEF.
Check your Joomla SEF files (like includes/sef.php,joomla.php, and the mossef mambot). What you'll be looking for is a "Date Modified" that is more recent than the other files.
Quote from: Orstio on September 10, 2006, 11:54:48 PM
Right, but the URL is not SEF.
Check your Joomla SEF files (like includes/sef.php,joomla.php, and the mossef mambot). What you'll be looking for is a "Date Modified" that is more recent than the other files.
Don't notice anything out of the ordinary. mossef.php (mambot) has not been modified since June 28.
I definitely have not touched includes/sef.php.
I did modify includes/joomla.php, but that was only to change the ordering of the <title> output. I'll try uploading a fresh copy of joomla.php and see if that helps.
No go. I uploaded fresh copies of joomla.php, and smf.php and smf_integration_arrays.php. :o
PS. When I'm viewing one of the URLs without the ItemID appended, Who's Online shows me as "Viewing the board index..."
QuotePS. When I'm viewing one of the URLs without the ItemID appended, Who's Online shows me as "Viewing the board index..."
Yeah, if it can't figure out where you are, it assumes you are on the board index.
Would it help if you got admin access to poke around my site?
Not to make this a 'me too' post, but the same issue is happening on this end as well... I thought it was normal... never really dove into the code till I noticed this thread.
Quote from: AirRideTalk on September 12, 2006, 02:46:58 AM
Not to make this a 'me too' post, but the same issue is happening on this end as well... I thought it was normal... never really dove into the code till I noticed this thread.
Hey welcome to the club. :)
At least it's not just me... I had thought with the lack of replies I was the _only_ one having this problem...
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%1$s&id=%2$s') . '/%1$s' ) . '">%3$s</a>.';
Results with code immediately above:
Who's Online shows "Viewing the article Motorola E680i Review." (looks correct)
Link generated is "www.site.com/content/view/56//54" (extra "/" and the numbers were actually reversed, ie it should be 54/56.)
OK, that's easy enough then:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s') . '%2$s' ) . '">%3$s</a>.';
Great progress! :)
I would just add a "/" to the end of the URL to make it look like Joomla's, but other than that it looks to be okay. ('%2$s/' instead of '%2$s')
Working code:
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
I wonder how to change the viewing category/ blogcategory links? Sorry I don't understand what are all these %1$s %xxxx ... are these Regex terms?
QuoteSorry I don't understand what are all these %1$s %xxxx ... are these Regex terms?
No, they just set the ordering of how the information has been passed from the sprintf. The first string element passed from the sprintf will be %1$s, the second will be %2$s, the third %3$s, etc.
I'm trying to only hardcode the non-SEF blogcategory like so
$txt['who_blogcategory'] = 'Viewing the category <a href="' . ($mosConfig_live_site . '/index.php?option=com_content&task=blogcategory&id=%1$s&Itemid=%2$s') . '">%3$s</a>.';
But it appears there is no 3rd string element passed in when the id=0. (I have no idea why some of my blog-categories have CID of 0 on my main menu).
I would end up with a link in Who's Online without link text, such as
Viewing the category <a href="http://localhost/index.php?option=com_content&task=blogcategory&id=0&Itemid=56"></a>.
AirRideTalk: are you having the same problems with category viewing? ???
Quote(I have no idea why some of my blog-categories have CID of 0 on my main menu).
Did you create them as blog categories in the Joomla admin panel, or are they just being viewed as blog categories? (Sounds strange, but it is likely).
I created them as blog categories. Here is what it says under the menu item:
Public 54 Blog - Content Category 0
Quote from: kai920 on September 14, 2006, 10:31:07 PM
AirRideTalk: are you having the same problems with category viewing? ???
I was, along with sections, but I simply edited the php similar to what was done for articles.
Here is what my function looks like now, fwiw...
//Additions to the $txt array for the whos online
function add_to_txt(){
global $txt, $mosConfig_live_site, $mosConfig_sitename, $mosConfig_sef;
$txt['who_home'] = 'Viewing the home page of <a href="' . $mosConfig_live_site . '">' . $mosConfig_sitename . '</a>.';
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
$txt['who_section'] = 'Viewing the section <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=section&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=section&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
$txt['who_blogsection'] = 'Viewing the section <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=blogsection&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=blogsection&Itemid=%2$s&id=%1$s')) . '">%3$s</a>.';
$txt['who_category'] = 'Viewing the category <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s') . '%2$s/') . '">%3$s</a>.';
$txt['who_blogcategory'] = 'Viewing the category <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s')) . '">%3$s</a>.';
$txt['who_newsfeeds'] = 'Viewing the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_newsfeeds&task=view&Itemid=%d' : sefReltoAbs ('index.php?option=com_newsfeeds&task=view&Itemid=%d')) . '">News Feeds</a>.';
$txt['who_virtuemart'] = 'Shopping in the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_virtuemart&Itemid=%d' : sefReltoAbs ('index.php?option=com_virtuemart&Itemid=%d')) . '">store</a>.';
$txt['who_sitesearch'] = 'Using the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_search&Itemid=%d' : sefReltoAbs ('index.php?option=com_search&Itemid=%d')) . '">Site Search</a>.';
$txt['who_wiki'] = 'Viewing the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_wikidoc&Itemid=%d' : sefReltoAbs ('index.php?option=com_wikidoc&Itemid=%d')) . '">Wiki</a>.';
}
Thanks for that... I found your 'who_blogcategory' was missing the appending . '%2$s/' near the end.
So now I have to figure out why I get these content/blogcategory/0/37/ (why there are 0's in my Itemid/URL)...
OK on this particular Blog-Category, I had selected two different categories from two different sections. After limiting it to just one section (one category) the link changed to blogcategory/14/37, which is good. So for this menu link, Who's Online is functioning correctly now. :)
On another Blog-Category, I have selected the content from 4 different categories -- but they are all in the same section. I am not sure how this can be fixed but I'll play around with the settings.
Quote from: AirRideTalk on September 15, 2006, 04:34:04 AM
//Additions to the $txt array for the whos online
function add_to_txt(){
global $txt, $mosConfig_live_site, $mosConfig_sitename, $mosConfig_sef;
$txt['who_home'] = 'Viewing the home page of <a href="' . $mosConfig_live_site . '">' . $mosConfig_sitename . '</a>.';
$txt['who_article'] = 'Viewing the article <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=view&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
$txt['who_section'] = 'Viewing the section <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=section&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=section&Itemid=%2$s&id=%1$s') . '%2$s/' ) . '">%3$s</a>.';
$txt['who_blogsection'] = 'Viewing the section <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=blogsection&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=blogsection&Itemid=%2$s&id=%1$s')) . '">%3$s</a>.';
$txt['who_category'] = 'Viewing the category <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s') . '%2$s/') . '">%3$s</a>.';
$txt['who_blogcategory'] = 'Viewing the category <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s' : sefReltoAbs ('index.php?option=com_content&task=category&Itemid=%2$s&id=%1$s')) . '">%3$s</a>.';
$txt['who_newsfeeds'] = 'Viewing the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_newsfeeds&task=view&Itemid=%d' : sefReltoAbs ('index.php?option=com_newsfeeds&task=view&Itemid=%d')) . '">News Feeds</a>.';
$txt['who_virtuemart'] = 'Shopping in the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_virtuemart&Itemid=%d' : sefReltoAbs ('index.php?option=com_virtuemart&Itemid=%d')) . '">store</a>.';
$txt['who_sitesearch'] = 'Using the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_search&Itemid=%d' : sefReltoAbs ('index.php?option=com_search&Itemid=%d')) . '">Site Search</a>.';
$txt['who_wiki'] = 'Viewing the <a href="' . ($mosConfig_sef !='1' ? $mosConfig_live_site . '/index.php?option=com_wikidoc&Itemid=%d' : sefReltoAbs ('index.php?option=com_wikidoc&Itemid=%d')) . '">Wiki</a>.';
}
Just want to say that this helped me again (for bridge 1.1.7)