Knowledgebase
View categorized listing of all common frequently asked questions.
Video Tutorials (jReviews 2.0)
Learn how to create a Movie & TV Show review website.
Learn how to start customizing the jReviews theme.
Forum
Community forum
Submit a Ticket
Use your client area email to access the ticket system.
Downloads
Guides, modules and more...
CSV Import for Joomla and jReviews
 
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 19, 2008, 07:09:26 PM
21260 Posts in 4851 Topics by 2789 Members
Latest Member: trustme
News: Use your client area email when you sign up to the forum so we can identify you as a trial or licensed user. Otherwise we may not answer your questions.
 
jReviews Support Forum  |  jReviews 1.x  |  Tips & tricks  |  Members only teaser/link « previous next »
Pages: [1]
Author Topic: Members only teaser/link  (Read 758 times)
papageek
Newbie
*
Offline Offline

Posts: 2


« on: August 21, 2008, 07:04:23 PM »

If you want to show a members only teaser and link to the sign up/registration page in place of hidden custom fields in the content listings, here's how it's done.  In jreviews.comon.php around line 3294 give or take, right below this code:

Code:
}
$lastGroup = $prevGroup;
$lastGroup_showtitle = $prevGroup_showtitle;
$fieldValue = ''; // Clear value to prevent repeating in empty fields
}

Add the following:

Code:
             else {
             // No permission to view fields
                 array_push( $groupFields, array (
"name"=>$field->name,
                "title"=>$field->title,
                 "showtitle"=>$field->showtitle,
                  "value"=>"<a href='your link here'>your text here</a>"  )
                );
                // PARENT TEMPLATE
if (!in_array($field->type,array("select","selectmultiple","checkboxes","radiobuttons"))) {

if ($tmpl_parent->exists($varPrefix.$field->name)) {
$tmpl_parent->addVar($varPrefix.$field->name, $varPrefix.$field->name, $fieldValue);
}
if ($view == 'content') {
$tmpl_parent->addVar( $tmpl_name, $field->name, $fieldValue);
$tmpl_parent->addGlobalVar ($varPrefix.$field->name, $fieldValue);
}
                            else {
$tmpl_parent->addVar( $tmpl_name, $varPrefix.$field->name, $fieldValue);
}
}
                         }

This basically say's if the user does not have group permissions to view or edit the custom field, then show the field title normally and a link to membership page- see screen shot attached. I've tested this on 1.2.10 and it works great, this should also work anywhere the custom fields are shown-but I have not tested it any further yet.
Logged
Pages: [1]
« previous next »
    Jump to: