Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

check if user has reviews

(Page 2 of 2)
> >
Quote Reply
Re: [Andy] check if user has reviews In reply to
Hi,

LOL - sorted it. It needed Review_Owner, *not* Review_LinkOwner Wink

Code:
sub {
if (!$_[0]) { return; }
return { review_count_num => $DB->table("Reviews")->count( { Review_Owner => $_[0] } ) };
}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Hi Andy,
works perfect Smile
This global should be in Ultra globals package.
I wonder why I was the first asking for it.

Thanks a lot.
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Hi Andy,
I'm having some trouble to get this code working.
Can you have a look at it?
All parts work fine, only the red part has no effect...

Code:
<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($LinkOwner)%>
<%if isHome eq 1 and Jump_Clicks > 500 and user_links_number < 7 and review_count_num < 5%>

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Matthias70 wrote:
Hi Andy,
I'm having some trouble to get this code working.
Can you have a look at it?
All parts work fine, only the red part has no effect...

Code:
<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($LinkOwner)%>
<%if isHome eq 1 and Jump_Clicks > 500 and user_links_number < 7 and review_count_num < 5%>

Upps, I just saw in the global descripition, that it will work only in detailed.html and link.html.
Is there a way to run it in the sidebar?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
What do you see with <%review_count_num%>

?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Andy wrote:
What do you see with <%review_count_num%>

?

Cheers

<%review_count_num%> shows Unknown Tag: 'review_count_num' in the rightsidebar.html ;-)

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Mmm, what template is this in? The only reason I can see it would do that, is with:

Code:
if (!$_[0]) { return; }

...i.e if $LinkOwner isn't being passed in properly...

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Andy wrote:
Mmm, what template is this in?

The template is called include_rightsidebar.html
Can you tell me where to put this part
Code:
if (!$_[0]) { return; }

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
You don't need to put that code anywhere. I was just explaining why it may be empty.

So whats the value of <%LinkOwner%> ?

..and how *exactly* are you calling the function?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Andy wrote:
You don't need to put that code anywhere. I was just explaining why it may be empty.

So whats the value of <%LinkOwner%> ?

..and how *exactly* are you calling the function?

Cheers


<%LinkOwner%> is an unknow tag in include_rightsidebar.html, too

I'm calling it this way:
Code:
<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($LinkOwner)%>
<%if review_count_num > 5 and Jump_Clicks > 500 and user_links_number > 7%>
TEXT
<%endif%>




By the way, I have another idea for a Plugin. Don't know if there is a way but what do you think about this community activity plugin ;-)

Is there a way to check the time, when a user added a link or added a review.
Should be used like this:
<%if last_link older 1year and last review older than 1year%>
It's been a long time, what about supporting the community. Write a review or add a new link...
<%endif%>

Thanks

Matthias
gpaed.de

Last edited by:

Matthias70: Jun 15, 2010, 5:27 AM
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Ok, well thats your problem them ;) $LinkOwner is required (as it should exist in both link.html, detailed.html etc) ...

Quote:
Is there a way to check the time, when a user added a link or added a review.
Should be used like this:
<%if last_link older 1year and last review older than 1year%>
It's been a long time, what about supporting the community. Write a review or add a new link...
<%endif%>

Sure, could be done - but afraid I don't have time to do anything like that at the moment =) Would just need to grab the latest LinkID and ReviewID, and then do a GT::Date::date_diff() to see how many days ago that was :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Andy wrote:
Ok, well thats your problem them ;) $LinkOwner is required (as it should exist in both link.html, detailed.html etc) ...
Quote:

O:K. then I will try to integrate this code into detail.html ;-)

Is there a way to check the time, when a user added a link or added a review.
Should be used like this:
<%if last_link older 1year and last review older than 1year%>
It's been a long time, what about supporting the community. Write a review or add a new link...
<%endif%>


Sure, could be done - but afraid I don't have time to do anything like that at the moment =) Would just need to grab the latest LinkID and ReviewID, and then do a GT::Date::date_diff() to see how many days ago that was :)
Cheers

No Problem :-) Can I remember you on this at a day without world cup games Wink

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Quote:
Can I remember you on this at a day without world cup games

Huh? :P

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Sometimes the easy way is the best ;-)
Now I'm using this global:

review_count
Code:
sub { return $DB->table('Reviews')->count( { Review_Owner => $USER->{Username} } ); }

With the above global this code is working everywhere...
Code:
<%if review_count > 5 and Jump_Clicks > 500 and user_links_number > 7%>
TEXT
<%endif%>

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] check if user has reviews In reply to
Erm, well if you were trying to do that, why didn't you just do:

<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($user.Username)%>

;)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] check if user has reviews In reply to
Andy wrote:
Erm, well if you were trying to do that, why didn't you just do:

<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($user.Username)%>

;)

Cheers

Hey Andy, you are the coder, not me Wink
Thanks

Matthias
gpaed.de
> >