Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 11-02-2001, 07:12 PM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$remote_site = join('', file("http://remote.domain.com/index.php") );

should become

$remote_site = join('', file("http://ultima.lightning.net/uo/index.html") );
Reply With Quote
  #22  
Old 11-02-2001, 11:42 PM
Saint's Avatar
Saint Saint is offline
 
Join Date: Oct 2001
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup.

That's how I did it.

Only got those 2 lines
Reply With Quote
  #23  
Old 11-03-2001, 04:06 AM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have some time right now.. let me try playing with it.
Reply With Quote
  #24  
Old 11-03-2001, 04:25 AM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK.. this works for me. You can edit it to say whatever you need..
PHP Code:
<?
// echo "Yes, I'm running<BR>\n";

$remote_site = join('', file("http://ultima.lightning.net/uo/index.html") );

preg_match_all(
    "|<td>(.*)<a name=\"(.*)\">(.*):</a>(.*)</td>(.*)<td>(.*)<img src=\"(.*)\"(.*)</td>|Usi",
    $remote_site, $matches);

// echo "begining loop<BR>\n";

for ($i=0; $i<count($matches[0]); $i++) {
    $name = $matches[3][$i];
    $image = $matches[7][$i];

//    echo "|" . $name . "|" . $image . "|";

    if (strstr($image,'grnball.gif')) {
//        echo "the image is a green ball" . "|";
        echo "$name is <font color='#00CC00'>online</font><BR>\n";
    }
    else {
//        echo "the image is a red ball" . "|";
        echo "$name is <font color='#FF0000'>offline</font><BR>\n";
    }
} //END for
?>
Reply With Quote
  #25  
Old 11-03-2001, 04:45 AM
Saint's Avatar
Saint Saint is offline
 
Join Date: Oct 2001
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That works!

Thanks alot for your time Mark!
Reply With Quote
  #26  
Old 11-03-2001, 05:46 AM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With table, and images...
PHP Code:
<?
$remote_site = join('', file("http://ultima.lightning.net/uo/index.html") );

preg_match_all(
    "|<td>(.*)<a name=\"(.*)\">(.*):</a>(.*)</td>(.*)<td>(.*)<img src=\"(.*)\"(.*)</td>|Usi",
    $remote_site, $matches);

echo "<table border=1 cellpadding=1 cellspacing=0>\n";

for ($i=0; $i<count($matches[0]); $i++) {
    $name = $matches[3][$i];
    $image = $matches[7][$i];
    
    echo " <tr>\n";
    echo "  <td>\n";
    echo "\t<font face='verdana, arial' size=1>";
    echo $name;
    echo "</font>\n";
    echo "  </td>\n";
    echo "  <td>\n";
    
    if (strstr($image, 'grnball.gif')) { 
        echo "\t<img src='http://nettiq.com/images/image1.gif'>\n"; 
    } 
    else { 
        echo "\t<img src='http://nettiq.com/images/image2.gif'>\n"; 
    }
    
    echo "  </td>\n";
    echo " </tr>\n";
    
} //END for

echo "</table>\n";
?>
Reply With Quote
  #27  
Old 11-05-2001, 02:48 PM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

new patterm:
Code:
<tr bgcolor="#ffc858">
<td><font size="+1"><a name=Catskills>Catskills:</a></font></td>
<td width="230" nowrap><img height=17 src="http://ultima.lightning.net/uo/img/grnball.gif" width=17 
align=top> UP! for 6h 00m 05s</td>
<td width="170"><font size="-1"><a class=tbl href="http://ultima.lightning.net/uo/en/history/Catskills.html">details &gt;&gt;</a></font></td>
</tr>
revised version:
PHP Code:
<?
$remote_site = join('', file("http://ultima.lightning.net/uo/index.html") );

preg_match_all(
    "|<tr.*<a name=.*>(.*):</a>.*src=\"(.*)\".*</tr>|Usi",
    $remote_site, $matches);

echo "<html>\n";
echo "<body>\n";

echo "<table border=0 cellpadding=0 cellspacing=0 align=center>\n";

for ($i=0; $i<count($matches[0]); $i++) {
    $name = $matches[1][$i];
    $image = $matches[2][$i];
    
    echo " <tr>\n";
    echo "  <td>";
    
    if (strstr($image, 'grnball.gif')) { 
        echo "<img src='http://nettiq.com/images/image1.gif'>"; 
    } 
    else { 
        echo "<img src='http://nettiq.com/images/image2.gif'>"; 
    }
    
    echo "</td>\n";
    echo "  <td>\n";
    echo "\t<font face='verdana,arial,helvetica' size='1'>&nbsp;";
    echo $name;
    echo "</font><BR>\n";
    echo "  </td>\n";
    echo " </tr>\n";
    
} //END for

echo "</table>\n";
echo "<br>\n";

echo "<center>\n";
echo "<font face='verdana,arial,helvetica' size='1'>\n";
echo "<a href='$PHP_SELF'>Refresh</a>\n";
echo "</font>\n";
echo "</center>\n";

echo "</body>\n";
echo "</html>\n";
?>
It's always a pain when the remote site changes their pattern. 8[
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04498 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete