Support Center

Knowledgebase
View categorized listing of all common frequently asked questions.
Video Tutorials
Create a Movie & TV Show review website.
Customize the jReviews themes.
Review user profiles with the Everywhere addon.
Forum
Community forum
Submit a Ticket
Use your client area email to access the ticket system.
Downloads
Guides, modules and more...
 
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 07, 2009, 04:17:32 PM
22776 Posts in 5217 Topics by 2974 Members
Latest Member: Vijitha
News: Do not post any jReviews files or large amounts of code in the forums please. Only template files and code are allowed.
 
jReviews Support Forum  |  jReviews 1.x  |  Tips & tricks  |  "Show reviews by this user" icon in SMF posts (for users of joomlahacks bridge) « previous next »
Pages: [1]
Author Topic: "Show reviews by this user" icon in SMF posts (for users of joomlahacks bridge)  (Read 2409 times)
gigi
Full Member
***
Offline Offline

Posts: 90


WWW
« on: May 04, 2007, 12:24:10 AM »

 it only involves changing a few lines of code in the smf templates and in the joomlahacks bridge.

if anyone interested at all, just let me know and i'll post it here.
« Last Edit: December 20, 2007, 04:59:57 PM by gigi » Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8997


« Reply #1 on: May 04, 2007, 07:32:24 AM »

It would be great if you post if for anyone looking for it Wink I will move this post to the tips&tricks board afterwards.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
gigi
Full Member
***
Offline Offline

Posts: 90


WWW
« Reply #2 on: May 04, 2007, 02:58:39 PM »

in ..joomla/components/com_smf/smf.class.php:

Find:

if ($jsmfConfig->cb_profile && strpos($tmpurl->query, 'action=profile') !== FALSE && strpos($tmpurl->query, 'sa=') === FALSE) {


Replace it with:

if ($jsmfConfig->cb_profile && strpos($tmpurl->query, 'action=profile') !== FALSE && strpos($tmpurl->query, 'sa=') === FALSE && strpos($tmpurl->query, 'jreviews') === FALSE) {


Then find:

} else {
                    array_push($replace, 'option=com_comprofiler&task=userProfile&user='.$user->id, 'ACTION=PROFILE2', 'option=com_comprofiler', substr($jsmfConfig->url, strpos($jsmfConfig->url, '?')+1).'action=profile2');
                }
            }


Add after it:

if ($jsmfConfig->cb_profile && strpos($tmpurl->query, 'action=profile') !== FALSE && strpos($tmpurl->query, 'sa=') === FALSE && strpos($tmpurl->query, 'jreviews') !== FALSE) {
            array_push($search, 'action=profile;u='.$smf_uid.'jreviews');
            array_push($replace, 'option=com_jreviews&task=myreviews&user='.$user->id);



in ..smf/Themes/default/Display.template.php:
(location may be different, depending on your theme configuration in SMF)

Find:

if ($message['member']['can_view_profile'])
               echo '
                        <a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';


Add after it:

echo '
                     <a href="', $message['member']['href'], 'jreviews">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/jr_smf.gif" alt="Show reviews by this user" title="Show reviews by this user" border="0" />' : 'Show reviews by this user'), '</a>';



in ..smf/Themes/default/PersonalMessage.template.php:
(location may be different, depending on your theme configuration in SMF)

Find:

if ($settings['show_profile_buttons'])
            {
               echo '
                           <a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" />' : $txt[27]), '</a>';


Add after it:

echo '
                     <a href="', $message['member']['href'], 'jreviews">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/jr_smf.gif" alt="Show reviews by this user" title="Show reviews by this user" />' : 'Show reviews by this user'), '</a>';



that's it. don't know if it's the best way to do it but it seems to work.

important notes:
1. 'redirect profile links' must be enabled in JSMF. you can circumvent it if you dig into the conditional statements structure in smf.class.php, but i didn't get into that.
2. after changing smf.class.php, be aware that it sometimes may be cached on your server (there are some cache settings in JSMF config) and it may take it some time until the changes get reflected.
3. you must choose an icon file (GIF) for the ratings icon, name it jr_smf.gif and put it in the SMF icon folder: ..smf/Themes/default/images/icons/  (if you're using the default SMF theme).

let me know if there's any trouble.
all the best,
gigi

« Last Edit: May 04, 2007, 03:11:12 PM by gigi » Logged
gigi
Full Member
***
Offline Offline

Posts: 90


WWW
« Reply #3 on: October 11, 2007, 04:33:22 PM »

SEF UPDATE:

if you're using this patch and using SEF, you may notice you have a problem with users who have written no reviews. the link in smf actually directs to your own reviews, since the username is missing.

to correct this:
in  components/com_jreviews/sef_ext.php  line 110:
change this line:

$query = "SELECT username FROM #__jreviews_comments WHERE userid='".$id."'";

to this line:

$query = "SELECT username FROM #__users WHERE id='".$id."'";

hope this helps
gigi
Logged
Pages: [1]
« previous next »
    Jump to: