Page 1 of 1

[Help] ?mode=blah&id=blah

Posted: Thu Mar 31, 2011 10:08 pm
by ThunderCrew
Hello all, I am trying to sort out to show a liked status for the social network mod here http://www.phpbb.com/community/viewtopi ... &t=2008845 got it narrowed down to where I can like it and it posts to facebook and if the user clicks the link it leads them to the mainpage.php with the id I liked EXAMPLE
http://tnc-all.net/forum/mainpage.php?liked=30 for if they clicked my liked status with the id of 30 however it displays the normal mainpage as in it shows ALL statuses.

Here is what I tried....
in the php side

Code: Select all

case 'liked':
// grab ID for the case liked
$liked = request_var('liked', 0);

if( $liked )
{
   // as long as id is none zero this will be executed
   $sql = "SELECT *
        FROM " . SN_STATUS_TABLE . " 
        WHERE status_id = " . $liked;
      $result = $db->sql_query($sql);
      // the stuff to do once grabbing the id variable from the requested var?      
      while ($row = $db->sql_fetchrow($result))
      {
         $liked = $row['status_id'];
         $template->assign_block_vars('liked', array(
            'STATUS'            => ($row['status_text']),
            'ID'            => ($row['status_id']),
         ));


      } // end while loop
      $db->sql_freeresult($result);


} // end the if

						break;

and in the html side

Code: Select all

start my code of IF liked 

<!-- IF .liked > 0 -->
<!-- BEGIN liked -->
<div id="snMpEntry">
{liked.STATUS}
</div>
<!-- END liked -->

ELSE it for if not on a liked status it shows the normal page

<!-- ELSE -->


<!-- BEGIN mp_entries -->

ALL the normal stuff to display the entire page

<!-- END mp_entries -->
end my if from the beginning of the html
<!-- ENDIF --> 
Here is my results ..... :cry:
Image
see it puts the right link in the web address bar , it displays the page, but it displays them all so it is not picking up the liked id what am I doing wrong ?

Re: [Help] One step to go for this....

Posted: Fri Apr 01, 2011 4:20 am
by _Al
i dont like facebook at all.. but this would be a great mod to help promote phpbb3 forum owners
I like it and good luck. thanks for working on this mr mister

Re: [Help] One step to go for this....

Posted: Fri Apr 01, 2011 7:39 pm
by ThunderCrew
_Al wrote:i dont like facebook at all.. but this would be a great mod to help promote phpbb3 forum owners
I like it and good luck. thanks for working on this mr mister
it's not my mod it is someone else but some of us have started trying to add or sort out stuff to add on to it ...

Any ideas anyone why it is not pulling ? .....
Hmmm might have an answer to my own question.
I think I added the sql bits into a mode are mode .... case liked.... so that would want a mode=liked&id=id here.... will work on it after work again and see what I can find out any tips would be nice thanx

OK I am a tad bit closer :D now all I will have to do is get it to template the normal stuff....

Image

Re: [Help] ?mode=blah&id=blah

Posted: Fri Apr 01, 2011 8:06 pm
by ThunderCrew
retitled the post as I will need help to figure out how to do a mode+id ?
I will need the wb address to be mode=liked&id=id here I know how to pull one variable but how do you chain it with a second one ? to do the mode=liked&id=30

basically just how topics etc are like "f=71&t=2125858"

Re: [Help] ?mode=blah&id=blah

Posted: Sat Apr 02, 2011 5:03 am
by ThunderCrew
anyone ? i am sure it has to be fairly simple to do , guess when I have more time I will look through view topic coding to see if I can see how it is done myself, but thought in mod writers discussion it would be easy to get a response on it :mrgreen:

Re: [Help] ?mode=blah&id=blah

Posted: Mon Apr 04, 2011 4:22 am
by ThunderCrew
bump :^)

Re: [Help] ?mode=blah&id=blah

Posted: Mon Apr 04, 2011 9:40 am
by ThunderCrew
I no longer need this as I thought for what I was doing
Image
works with just liked and didnt need the &id= part

BUT would still like to know how :mrgreen: if anyone would be so kind