Results 1 to 8 of 8

WOL locations for sub-pages

This is a discussion on WOL locations for sub-pages within the Off-Topic & Chit Chat forums, part of the Focus on Members category; Hii.. some vb programming help needed please. Please tell me how to make the URL variables available for $userinfo['where'] in ...

  1. #1
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times

    WOL locations for sub-pages

    Hii.. some vb programming help needed please.

    Please tell me how to make the URL variables available for $userinfo['where'] in a custom WOL plugin.

    My code:-

    Hook: online_location_process

    Code:
    if ($filename == 'myfile.php')
    {
            $userinfo['activity'] = 'myprocess';
    }
    Hook: online_location_unknown

    Code:
    if ($userinfo['activity'] == 'myprocess')
    {
        switch($userinfo['values']['do']) 
        {
            case 'view':
                $userinfo['action'] = 'Viewing Item';
                $userinfo['where'] = 'I NEED HELP WITH THIS';
                break;
            default:
                $userinfo['action'] = 'Vewing Custom Page';
                break;
        }
            $handled = true;
    }
    The switch case is working good. BUT how to build the URL in userinfo[where]. How to make the $item_id and similar variables available for location url.

    Thanks

  2. #2
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    4 times
    The Forum Hosting - Forum Hosting from the Forum Experts

  3. #3
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times
    That article is already in my favorites since long. What I want is not in any article.

    I don't think it would be tough, I reached to switch-case concept for inner pages by looking at the ibproarcade's WOL code. But i am not able to figure out how the URL variables are done for userinfo[where]

    Thanks

  4. #4
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    4 times
    You would just replace your red code with:

    PHP Code:
    '<a href="./test.php?' $vbulletin->session->vars['sessionurl'] . '">This is My Test Page</a>'
    test.php being your title of the script you are on, then it adds the session url. Then you can change the this is my test page text to what you want. If you want to add &thisvariable add it righter after the vars vars['sessionurl'] . ' so it looks something like:

    PHP Code:
    '<a href="./test.php?' $vbulletin->session->vars['sessionurl'] . '&thisvariable=2">This is My Test Page</a>'
    The Forum Hosting - Forum Hosting from the Forum Experts

  5. #5
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times
    Michael sir, you again did not read my first post

    The thing you explained is already in the article.

    See, what I want is how to do this:-

    Code:
    $userinfo['where'] = '<a href="myfile.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;itemid=$item_id\">$item_title</a>";
    The variables in RED are database vars or whatever we call them so the URL would look like

    Code:
    myfile.php?do=view&itemid=1
    myfile.php?do=view&itemid=2
    myfile.php?do=view&itemid=3
    .
    .
    I need to get the itemid column value from database in the URL.

    Here's the link to my original thread if needed more explaination. It shouldn't tough please.

    Thanks

  6. #6
    Senior Member Shadab's Avatar
    Real Name
    Shadab
    Join Date
    Oct 2007
    Location
    Bhopal
    Posts
    821
    Liked
    0 times
    Blog Entries
    12
    Maybe you need to create another plugin that would extract those values from the DB,
    so that you can use them in your Custom WOL location plugin.

    Just like ibProArcade does, via these two plugins :

    PHP Code:
    <plugin active="1">
    <
    title>ibProArcadeGet Game List for WOL</title>
    <
    hookname>online_ids_titles</hookname><phpcode><![CDATA[

    global 
    $gameids$wol_games;
    if (
    $gameids)
    {
        
    $gameidquery $vbulletin->db->query_read("
            SELECT gid, gtitle
            FROM " 
    TABLE_PREFIX "games_list
            WHERE gid IN (0
    $gameids)
        "
    );
        while (
    $gameidqueryr $vbulletin->db->fetch_array($gameidquery))
        {
            
    $wol_games["$gameidqueryr[gid]"] = $gameidqueryr['gtitle'];
        }
    }

    ]]></
    phpcode></plugin
    PHP Code:
    <plugin active="1">
    <
    title>ibProArcadeWOL Display Prepare</title>
    <
    hookname>online_location_process</hookname><phpcode><![CDATA[

    if ((
    $filename == 'arcade.php') || ($filename == 'holdsession.php'))
    {
        
    $userinfo['activity'] = 'arcade';
        if (!empty(
    $values['gameid']))
        {
            
    $userinfo['gameid'] = intval($values['gameid']);
            global 
    $gameids;
            
    $gameids .= ',' $userinfo['gameid'];
        } 
    }

    ]]></
    phpcode></plugin

  7. #7
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times
    yeah I didn't notice the plugin on online_ids_titles hook. Thanks for pointing that out for me. The required query runs there.

    I have tried a lot using these 3 plugins but can't get it to work. Any idea what does this mean?

    Code:
    WHERE gid IN (0$gameids)
    Thanks

  8. #8
    Senior Member webwizzy's Avatar
    Real Name
    Vinayak
    Join Date
    Aug 2008
    Location
    India
    Posts
    257
    Liked
    0 times
    There was already a wonderful article at vb.org that helped me achieve this in few minutes
    Whos Online Titles - vBulletin.org Forum

    Thanks

Similar Threads

  1. 00,000 Yahoo pages and 50,000 Google pages indexed
    By len backus in forum Analysis: Traffic & SERPS
    Replies: 6
    Last Post: 02-03-2010, 02:20 AM
  2. Your highest CTR locations + styles?
    By Hendricius in forum Ad Networks
    Replies: 4
    Last Post: 02-10-2008, 12:27 PM
  3. Changing forum locations
    By trana in forum General Discussion
    Replies: 4
    Last Post: 09-29-2007, 12:15 PM
  4. Unknown locations of users in online.php
    By MRBarto in forum Troubleshooting
    Replies: 2
    Last Post: 04-23-2007, 05:23 PM
  5. Problem with gz file locations
    By trana in forum General Discussion
    Replies: 14
    Last Post: 11-14-2006, 08:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •