Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0

    Capture User ID on Outgoing Link - Out.php

    Hello everyone

    We are trying to capture the logged in User id, when they click on the Link,

    We are using the out.php, and need some help in understanding how we can do the following

    The shared link is for example : http://www.thiswebsite.php/getdetails.php&subid=0&u1={$user-id}

    We will manually place the required {user-id} portion in the Link, but this test must be replaced with the actual logged in users id, or user name when the link in clicked

    We have tried it with and with the out.php on and as well as multiple expressions of {$user} {$user_logged_in}...etc.

    what would be the best case senario is using the out.php to pull and place the user id in the outgoing link.

    We tried to modify the out.php but we are way past our limits, here is a portion of the out.php, the red portions are our attempts to have the out.php pull the user id and place it in the link

    Code:
    include('config.php');
    include(mnminclude.'html1.php');
    include(mnminclude.'link.php');
    
    $requestID = sanitize($_REQUEST['id'], 3);
    $requestUser = sanitize($_REQUEST['user_id'], 3);
    $requestTitle = sanitize($_REQUEST['title'], 3);
    $requestURL = sanitize($_REQUEST['url'], 3);
    $requestTitle = sanitize($requestTitle,4);
    $requestURL = sanitize($requestURL,4);
    $requestURL = preg_replace('/(https?:\/)([^\/])/','$1/$2',$requestURL);
    if($requestTitle != ''){
    	$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '" . $db->escape($requestTitle) . "';");
    }
    
    if($requestURL != ''){
    	$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_url` = '" . $db->escape($requestURL) . "';");
    }
    if($requestUser != ''){
    	$requestuser = $db->get_var("SELECT link_id FROM " . table_users . " WHERE `user_id` = '" . $db->escape($requestuser) . "';");
    }
    
    
    if(is_numeric($requestID)) {
    	$id = $requestID;
    	$link = new Link;
    	$link->id=$requestID;
    	$link->read();
    	$user_id = $requestUser;


    Please point us in the Right Direction

  2. #2
    New Pligger Pricerank's Avatar
    Joined
    Jun 2010
    Posts
    10
    Thanks
    Received:0
    Given: 0

    I need this as well for our user rewards program

    Quote Originally Posted by parati View Post
    Hello everyone

    We are trying to capture the logged in User id, when they click on the Link,

    We are using the out.php, and need some help in understanding how we can do the following

    The shared link is for example : http://www.thiswebsite.php/getdetails.php&subid=0&u1={$user-id}

    We will manually place the required {user-id} portion in the Link, but this test must be replaced with the actual logged in users id, or user name when the link in clicked

    We have tried it with and with the out.php on and as well as multiple expressions of {$user} {$user_logged_in}...etc.

    what would be the best case senario is using the out.php to pull and place the user id in the outgoing link.

    We tried to modify the out.php but we are way past our limits, here is a portion of the out.php, the red portions are our attempts to have the out.php pull the user id and place it in the link

    Code:
    include('config.php');
    include(mnminclude.'html1.php');
    include(mnminclude.'link.php');
    
    $requestID = sanitize($_REQUEST['id'], 3);
    $requestUser = sanitize($_REQUEST['user_id'], 3);
    $requestTitle = sanitize($_REQUEST['title'], 3);
    $requestURL = sanitize($_REQUEST['url'], 3);
    $requestTitle = sanitize($requestTitle,4);
    $requestURL = sanitize($requestURL,4);
    $requestURL = preg_replace('/(https?:\/)([^\/])/','$1/$2',$requestURL);
    if($requestTitle != ''){
    	$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_title_url` = '" . $db->escape($requestTitle) . "';");
    }
    
    if($requestURL != ''){
    	$requestID = $db->get_var("SELECT link_id FROM " . table_links . " WHERE `link_url` = '" . $db->escape($requestURL) . "';");
    }
    if($requestUser != ''){
    	$requestuser = $db->get_var("SELECT link_id FROM " . table_users . " WHERE `user_id` = '" . $db->escape($requestuser) . "';");
    }
    
    
    if(is_numeric($requestID)) {
    	$id = $requestID;
    	$link = new Link;
    	$link->id=$requestID;
    	$link->read();
    	$user_id = $requestUser;


    Please point us in the Right Direction
    We need the feature for our rewards program we are implementing. if I could help with the code I would but i have tried the same and i cannot get it to work!!!..

    Maybe the experts here can help, i know that this ability will open the way for new modules

  3. #3
    Pligg Developer/Coder/Designer ChuckRoast's Avatar
    Joined
    Dec 2005
    Location
    Pliggville USA
    Posts
    9,118
    Thanks
    Received:396
    Given: 73
    Version
    SVN Build
    Site
    http://Pligg.com/chuckroast
    Do you mean link this?
    Check out the status bar in the screenshot.
    Attached Images Attached Images
    Help Keep ChuckRoast Home
    Today's Pligg Blog Post


  4. #4
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0
    I see where the user id is attached to the out.php.

    What we have to make sure to reach what we are looking for is that the User id is passed to the actual out going link.

    So as you have show

    http://www.pligg.com/out.php?id=8?userid=testuser

    Would translate to the acutal outgoing link as example

    http://www.sitelink.com/fs-bin/stat?...=3&subid=0&u1=testuser

    The link would have been entered in the system as example
    http://www.sitelink.com/fs-bin/stat?...=3&subid=0&u1={$user_id}

    obviously you would want to be able to move the user id {$user_id}request to anywhere in the link itself, and have it replaced by the userid on the out click

    I hope this explains what we are trying to accomplish. I am her now if you want to ask another question for clarification/

    PS I also see that your url was not search engine friendly, we would prefer to keep the code search engine friendly if possible

  5. #5
    New Pligger Pricerank's Avatar
    Joined
    Jun 2010
    Posts
    10
    Thanks
    Received:0
    Given: 0

    Added the Code

    Quote Originally Posted by chuckroast View Post
    Do you mean link this?
    Check out the status bar in the screenshot.
    I see where we can add the Code to the out.php file which ads the user it to the out php link,

    But i do not know how this if possible translates to the actual destination url

    It doesn't need to be caputured by our software, this is to be used by the destination urls to report user usage to us

    We use this to identify sub affilaites throught there user id on our site

  6. #6
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0
    I slept on it all night, and I still cannot figure out how to get the user is to the outgoing link.

    Our entire site is waiting for this last piece of functionality, before we can launch...

    Please help...I am lost

  7. #7
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0

    @chuckroast

    Quote Originally Posted by chuckroast View Post
    Do you mean link this?
    Check out the status bar in the screenshot.
    @chuckroast

    How did you get the user id in the out.php link? I looked in the link.php file where I assume it would be changed from but I cannot find what changes to make.

    Also as i asked before would this then translate to the actual outgoing link, That is where the importance is.

    We must be able to insert the user id in the actual outgoing link, we could as stated prompt this by putting {$user_id} in the actual link, which we have done so but when you click on the actual outgoing link this is what you would see

    User TEST

    http://www.XXXXXX.com/index.php&ul={$user_id}

    when is the user logged in is test the link should be


    http://www.XXXXXX.com/index.php&ul=test

    Obviously it is not pulling the user id with the {$user_id} request in the actual link

  8. #8
    Pligg Developer/Coder/Designer ChuckRoast's Avatar
    Joined
    Dec 2005
    Location
    Pliggville USA
    Posts
    9,118
    Thanks
    Received:396
    Given: 73
    Version
    SVN Build
    Site
    http://Pligg.com/chuckroast
    Quote Originally Posted by parati View Post
    @chuckroast

    How did you get the user id in the out.php link? I looked in the link.php file where I assume it would be changed from but I cannot find what changes to make.

    Also as i asked before would this then translate to the actual outgoing link, That is where the importance is.

    We must be able to insert the user id in the actual outgoing link, we could as stated prompt this by putting {$user_id} in the actual link, which we have done so but when you click on the actual outgoing link this is what you would see

    User TEST

    http://www.XXXXXX.com/index.php&ul={$user_id}

    when is the user logged in is test the link should be


    xxxxxx.com

    Obviously it is not pulling the user id with the {$user_id} request in the actual link
    The way I did it was to edit link_summary.tpl

    Find
    Code:
                    {if $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else}
                        <a href="{$story_url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
                    {/if}
                 {else}
                    {if $pagename eq "story" && $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else} 
                      <a href="{$story_url}">{$title_short}</a>
                    {/if}
    Change To

    Code:
                                 {if $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}{if $user_logged_in}&ul={$user_logged_in}{/if}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else}
                        <a href="{$story_url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
                    {/if}
                 {else}
                    {if $pagename eq "story" && $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}{if $user_logged_in}&ul={$user_logged_in}{/if}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else} 
                      <a href="{$story_url}">{$title_short}</a>
                    {/if}
    This will append the outgoing link to include &ul=USERNAME

    Hope that helps.
    Help Keep ChuckRoast Home
    Today's Pligg Blog Post


  9. #9
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0
    Quote Originally Posted by chuckroast View Post
    The way I did it was to edit link_summary.tpl

    Find
    Code:
                    {if $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else}
                        <a href="{$story_url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
                    {/if}
                 {else}
                    {if $pagename eq "story" && $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else} 
                      <a href="{$story_url}">{$title_short}</a>
                    {/if}
    Change To

    Code:
                                 {if $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}{if $user_logged_in}&ul={$user_logged_in}{/if}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else}
                        <a href="{$story_url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
                    {/if}
                 {else}
                    {if $pagename eq "story" && $url_short neq "http://" && $url_short neq "://"}
                        <a href="{$url}{if $user_logged_in}&ul={$user_logged_in}{/if}" {if $open_in_new_window eq true} target="_blank"{/if} {if $story_status neq "published"}rel="nofollow"{/if}>{$title_short}</a>
                    {else} 
                      <a href="{$story_url}">{$title_short}</a>
                    {/if}
    This will append the outgoing link to include &ul=USERNAME

    Hope that helps.
    Ok i made those changes and the result is what you describe, however our issue is the reference for the user_id is in different spots depending on the link, and it is not always at the end of the link,

    Example: http://[CLICK DOMAIN]/click-596513-10338?SID=ShopperID_Value

    The SID is where the User-id would be placed

    the entered link would be
    http://[CLICK DOMAIN]/click-596513-10338?SID=($user_id}

    Another type would be
    http://click.linksynergy.com/fs-bin/stat?id=/FYI6fQ9PWs&offerid=7097.10000015&type=3&subid=0&u1 =($user_id}

    Would we then have to duplicate this for each type of link?
    also does this then translate to the actual outgoing link

  10. #10
    Casual Pligger parati's Avatar
    Joined
    Jan 2010
    Posts
    49
    Thanks
    Received:0
    Given: 0
    @chuckroast

    Here is another example:
    http://click.linksynergy.com/fs-bin/...10&tmpid=2405&u1={$user_id}&RD_PARM1=http%3A%2F%2Fwww.tigerdirect.com%2Fappli cations%2Fsearchtools%2Fitem-Details.asp%3FEdpNo%3D6052517

    You see in this example the user id call is not at the end

    the best case senario is fo rus to be able to put a call sign in the Link i.e {user_id} and that be replaced with the user id of the logged in user

Page 1 of 2 12 LastLast

Similar Threads

  1. Outgoing link
    By deeplygreen in forum Questions & Comments
    Replies: 8
    Last Post: 04-08-2008, 07:28 AM
  2. How can I have an outgoing link as the real link for specific users?
    By getbackerzoo in forum Questions & Comments
    Replies: 6
    Last Post: 03-20-2008, 07:38 AM
  3. Nofollow for every outgoing link ?
    By mikepyne in forum Questions & Comments
    Replies: 3
    Last Post: 03-12-2008, 04:01 AM
  4. outgoing link not working
    By jackson323 in forum Questions & Comments
    Replies: 3
    Last Post: 03-04-2007, 12:43 AM
  5. outgoing link problem
    By sneacker in forum Questions & Comments
    Replies: 5
    Last Post: 02-25-2007, 03:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg