Combine Thank you mod Hide Mod

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Combine Thank you mod Hide Mod
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
Hey im trying to make the thank you mod found [ Register or login to view links on this board.]
and the hide mod found [ Register or login to view links on this board.] work together.
The hide mod makes it to where you can hide links in a post and a guest or member has to reply to the post to see the link, i want them to be able to click the thank you button and see the content aswell as reply to the post.

The help i need is with combining these sql queries the first is the original query from the hide mod the second is the query i edited to make it work with the thank you button i want the member to see the hidden link whether they hit the thank you button or they reply so i need both these queries.

the hide query
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}


the hide code with thank you query
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.user_id, p.topic_id
FROM nuke_bbthanks p
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}



Back to top Reply with quote
#2   re: Combine Thank you mod Hide Mod
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
No takers on this



Back to top Reply with quote
#3   
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
   
Sorry i dont understand what your trying to do. You just need this query joined?




_________________
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
#4   re: Combine Thank you mod Hide Mod
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
Yes i need both queries joined



Back to top Reply with quote
#5   
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
   
Try this one:


   $valid = FALSE;
   if( $userdata['session_logged_in'] ) {
      $sql = "SELECT p.poster_id, p.topic_id, t.user_id, t.topic_id FROM " . POSTS_TABLE . " AS p LEFT JOIN nuke_bbthanks AS t ON p.poster_id = t.user_id WHERE p.topic_id = $topic_id AND p.poster_id = " . $userdata['user_id'];
      $resultat = $db->sql_query($sql);
      $valid = $db->sql_numrows($resultat) ? TRUE : FALSE;
   }




_________________
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
#6   
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
Telli that didn't work is it possible to run both queries?



Back to top Reply with quote
#7   
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
The hide mod works by someone replying to a post and viewing the hidden content
So the query for this is


$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}


Now i believe with the above query it looks to see if somebody replied to post to view the hidden content

Now the thank you mod allows a person to click a thank post button and adds the thank you to the database

I want the hide mod to look in the database for either a thank you or a reply and show the content if either is found

Code for hide mod to look for a thank you


$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.user_id, p.topic_id
FROM nuke_bbthanks p
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
if (!($valid)) $valid = $is_auth['auth_mod'] ? TRUE : FALSE;


I got the mod to do 1 or the other but i want it to check both thats why i wanted to combine the queries.


Back to top Reply with quote
#8   re: Combine Thank you mod Hide Mod
rmxs
CZ Newbie
rmxs has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Mar 10, 2005
0.00 posts per day
Posts: 1
Points: 122
   
open
modules/Forums/viewtopic.php

Find:
$thanked = TRUE;

After add:
$valid = TRUE;


USE THIS IM SURE 99% work i use this on my site and work both of them



Back to top Reply with quote
#9   
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
Thanks that worked out perfect.



Back to top Reply with quote
#10   re: Combine Thank you mod Hide Mod
s60Addict
CZ Newbie
s60Addict has been a member for over 18 year's 18 Year Member
Gender: Male
Website:
Status: Offline
Joined: Jun 20, 2006
0.00 posts per day
Posts: 5
Points: 375
   
Sorry to open back this old topic but it sounded interesting !

Well, it wud be really nice of u if u cud somehow give a little new shape to this mod.

Basically, the hide mod hides the post until the user posts a reply to that topic.
And Thanks Mod (didnt work on my phpnuke 7.9) adds a button to thank a user for his/her post.

I wud be highly thankful if u cud somehow make a change that in order to see the hidden content, the user must ONLY PRESS THE THANKS BUTTON and the reply part is not necessary!

PS: im using BBcode Mod Box as the one on this site.

Please try to c if u can do a little change !

Thanks !



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