Onmouseover Current URL Snapshot On This PHP Script

Programming
Tutor: None Selected Time limit: 3 Days

Hi folks, ok I have this script below which allows users of Twitch.tv channels to show up as offline or online.

It works flawlessly, on the webpage is here, its in a module on he right hand side called twitch.tv channels.

www.aoe2hdozclan.com

Ok so I am wanting there to be a popout image of the twitch channel relating to the users link, so people can hover over the links to the different channels etc and they can see the current image, the online users would really be the most important ones.

Ok, this site has an example of this: www.aoczone.net (top right hand corner)

Ok guys, can this be done, is there something simple I can adde for the current code to pickup the image, you will see a line where the users are added to the code below, as in their username on twitch:

CODE BELOW:
_________________________________________________________

<html>

<head>

<style>

font-family:Verdana, Arial, Helvetica;

font-size: 70%;

color: #825a15;

font-weight:bold;

</style>

<title>Streamlist</title>

</head>

<body>

<style type="text/css">

a:link {

color:#136aad;

}

a:visited {

color:#136aad;

}

a:hover {

color:#83132b;

}

</style>

<FONT color=#825a15 face="tahoma" size="2pt">

<?php

/**

* @version   0.1

* @copyright (C) 2012/2013 Cees Middel (Avon) www.maegis.net

* @Inspired by Syi http://mushroom-mayhem.com

* @license   GNU/GPL v3 http://www.gnu.org/licenses/gpl.html

*/

/**

* array with all stream names i.e. www.twitch.tv/"iksf".

* To add more users just add their channel names with comma seperation

* This is all there is, no futher editing required

*/

$members = array("aoe2hdozclan","manbeast_aoe","brannin","pain1800","usk_apocalipce","resonance22","williamskovhansen","ninzie90","snezzey","tyrant_theviper");

// This variable becomes one long url with the channel names stringed up behind it

// This url then fetches a json file from twitch with all the selected channels information

$userGrab = "http://api.justin.tv/api/stream/list.json?channel=";

//I use this array to compare with the members array. All users in this arrat are substracted from the members array and hence are //"offline"

$checkedOnline = array (); 

foreach($members as $i =>$value){

$userGrab .= ",";

$userGrab .= $value;

}

unset($value);

//grabs the channel data from twitch.tv streams

$json_file = file_get_contents($userGrab, 0, null, null);

$json_array = json_decode($json_file, true);

//get's member names from stream url's and checks for online members

foreach($members as $i =>$value){

$title = $json_array[$i]['channel']['channel_url'];

$array = explode('/', $title);

$member = end($array);

$viewer = $json_array[$i] ['stream_count'];

onlinecheck($member, $viewer);

$checkedOnline[] = signin($member);

}

unset($value);

unset($i);

//checks if player streams are online

function onlinecheck($online, $viewers)

    {  

//If the variable online is not equal to null, there is a good change this person is currently streaming

if ($online != null)

            {

                    echo '<a href="http://www.twitch.tv/'.$online.'" target="_blank" title="'.$value.' IS STREAMING LIVE & HAS '.$viewers.' WATCHING RIGHT NOW">> <strong>'.$online.'</strong></a>';

echo '&nbsp <img src="/images/online.png"><strong></strong> Online</br>'; 

                    echo '<img src="/images/viewers.png"><strong> Viewers:</strong> '.$viewers.'</br>';

}

}

//This funcion add's online channel names to the checked online array

function signin($person){

if($person != null){

return $person;

}

else{

return null;

}

}

?>

</font>

<hr>

<FONT color=#825a15 face="tahoma" size="1.8pt">

<?php

//This part list all the people currently offline. Here the array with online users is compared with the total users.

//online users are then removed from the total users array.

foreach ($members as $i => $value1) {

foreach($checkedOnline as $ii => $value2){

if($value1 == $value2){

unset($members[$i]);

}

}

}

//print a nice list with people that can't currently be bothered with streaming their games

foreach ($members as $i => $value) {

echo '<a href="http://www.twitch.tv/'.$value.'" target="_blank" title="'.$value.' IS OFFLINE RIGHT NOW"> <strong>'.$value.'</strong></a>';

echo '&nbsp<img src="/images/offline.png"> <strong></strong> Offline</br>';

}

?>

</font>

</body>

</html>


Nov 30th, -0001
OK. so you want to get a picture from user's current link? Well. I would suggest the following way(Maybe not the best):
1. Create a database with the following columns:
-user_id
-current

2. Every time the user go to a spefic action, say they open the css.php page. You want to show a css picture in this case.
Get the image(from any html tag if you want or just hard code one to get) and save it to the database.

3. Ajax call/JSON from database and get the picture to show in the pop-over box
Jun 20th, 2013

Again mate, its no good because it not current, the one on the page I have shown you is like a current image, is this possible, well...yes it has to be as those guys have done it but I cannot find any further info on the back end source code

Jun 20th, 2013

It can be current.  Because once the user navigate away, you will have new image saved in the db.

Jun 20th, 2013

Hello Henry, ok, what would it cost to create this code and add it to my existing code ready to go, I want the popups to be around 300px x 250px?

Jun 21st, 2013

Hello Henry, ok, what would it cost to create this code and add it to my existing code ready to go, I want the popups to be around 300px x 250px?

Do you guys provide this service at all?

If not would you know who does?

Jun 22nd, 2013

Hey sorry for the late reply. What do you mean cost? You want me create it for you?

Jun 24th, 2013

You can post a task at likeplum. I'm kinda busy these days. But if no one else take the task. I will do it for you.

https://www.likeplum.com/task

You will have to choose premium because it obviously will cost more than $10..

You will receive bids then.

Jun 24th, 2013

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Nov 30th, -0001
...
Nov 30th, -0001
Dec 4th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer