vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Additional external.php feed format (https://vborg.vbsupport.ru/showthread.php?t=59575)

okrogius 01-02-2004 10:00 PM

Additional external.php feed format
 
Those of you who integrate your feed in a PHP page will appreciate the simplicity of working with this :).

Once installed you can just include your therads on your site's pages (example) via simply reading contents of external.php?type=php (be it via fopen, etc), and then processing the results through an unserialize() call.

gldtn 01-06-2004 02:19 PM

Are you saying we can use php instead of JS, XML, etc..? Very cool if you are :)

Zachery 01-06-2004 02:22 PM

im not sure but couldnt this lead to some security risks? such as grabbing important varibles?

KuraFire 01-06-2004 02:29 PM

Not really important variables, and even the ones they can grab are pretty pointless to them, unless there is a security risk elsewhere in vB3 that is related to variables whose names they can figure out due to this ($threadcache).

Not much of a concern if you ask me.

okrogius 01-06-2004 07:40 PM

Quote:

Originally Posted by Faranth
im not sure but couldnt this lead to some security risks? such as grabbing important varibles?

No external information is passed via this, composed to using rss/xml/etc. Prime benefit is easyness of use; say you have a PHP page which should display latest threads.

Would it be easier to just open a file, unserailize its contents, and use the array (around 3 lines of code); or, open a file, create your own array parsing xml data (30+ lines)? You decide for yourself, personally I find the previous option a lot easier.

Detomah 01-19-2004 01:47 PM

Could you possibly explain this a litte more please. :)

I would really like to be able to do this, but am not sure of the exact processes and what exactly I would have to do to get certain threads showing on my home page with this...

Could you possibly give an example of the code that would be needed to grab and display the thread please.

I'm learning fast, but still need guidance now and then. ;)

okrogius 01-19-2004 06:00 PM

sure, using this getitng yoru threads can be as simple as:

PHP Code:

<?php

$threads 
unserialize(file_get_contents('http://www.example.com/external.php?type=php'));

for (
$i=0; $<count($threads); $i++) {
 echo 
'thread: '.$threads[$i]['title'].'<br />';
}

?>


firenuts 01-20-2004 02:45 AM

Sorry, what does this add-on do exactly? Can I specify a thread ID and allow it to export all content to XML?

Detomah 01-29-2004 09:00 PM

Quote:

Originally Posted by okrogius
sure, using this getitng yoru threads can be as simple as:

PHP Code:

<?php

$threads 
unserialize(file_get_contents('http://www.example.com/external.php?type=php'));

for (
$i=0; $<count($threads); $i++) {
 echo 
'thread: '.$threads[$i]['title'].'<br />';
}

?>


That's what I was hoping to see. :)

I'll give it a go and see how the results turn out. :)

Thanks. :)

gmarik 01-31-2004 06:11 PM

what is the difference between the RSS hack and this?

Myr7h 02-09-2004 04:40 AM

Quote:

Originally Posted by okrogius
sure, using this getitng yoru threads can be as simple as:

PHP Code:

<?php

$threads 
unserialize(file_get_contents('http://www.example.com/external.php?type=php'));

for (
$i=0; $<count($threads); $i++) {
 echo 
'thread: '.$threads[$i]['title'].'<br />';
}

?>


its not as simple as that other wise i wouldn't get this error message:
Parse error: parse error, unexpected '<', expecting T_VARIABLE or '$' in G:\wampp2\htdocs\mnracing\index.php on line 230

Mr. Brian 03-03-2004 10:42 PM

Did you change the URL to your's instead??

Quote:

Originally Posted by Myr7h
its not as simple as that other wise i wouldn't get this error message:
Parse error: parse error, unexpected '<', expecting T_VARIABLE or '$' in G:\wampp2\htdocs\mnracing\index.php on line 230


Geographic2 03-04-2004 10:31 PM

Same error here:

on this line:

for ($i=0; $<count($threads); $i++) {


Are you sure that is right?

ok now I see it needs to be

for ($i=0; $i<count($threads); $i++) {


I see the application of this, very nice. Quick way to flip things across. Damn I love this external.php :)

andor 11-30-2004 08:58 PM

Hey, this is a great simple mod - love it. Thanks!

Mosh 11-30-2004 11:12 PM

To get this Mod to work with KW802's replacement for external.php in this thread "FPS_EXTERNAL.PHP -- New options added & RSS compliant version of external.php" - https://vborg.vbsupport.ru/showthread.php?t=69834, use the following instructions instead of the ones attached here:

Open fps_external.php (or whatever you renamed it to).

Find:
PHP Code:

case 'JS':
     break;
case 
'XML':
     break;
case 
'RSS1':
     break;
case 
'RSS2':
     break; 

Under it add:
PHP Code:

case 'PHP':
     break; 

Find:
PHP Code:

// +=============================================================+
// | Build the RSS feeds                                         |
// +=============================================================+
else if (($_REQUEST['type'] == 'RSS' OR $_REQUEST['type'] == 'RSS1' OR $_REQUEST['type'] == 'RSS2') AND $vboptions['externalrss']) 

Above it add:
PHP Code:

else if ($_REQUEST['type'] == 'PHP')
// PHP output
    
echo serialize($threadcache);


Hope this helps,

jd :)

KW802 12-03-2004 07:55 PM

If there are no objections I'll incorporate that into the next round of changes I'm working on. :)

Natch 12-05-2004 09:46 PM

Good idea Kev ;)

Mosh 03-28-2005 02:33 AM

Quote:

Originally Posted by jdsinclair
To get this Mod to work with KW802's replacement for external.php in this thread "FPS_EXTERNAL.PHP -- New options added & RSS compliant version of external.php" - https://vborg.vbsupport.ru/showthread.php?t=69834, use the following instructions instead of the ones attached here:

Open fps_external.php (or whatever you renamed it to).

Find:
PHP Code:

case 'JS':
     break;
case 
'XML':
     break;
case 
'RSS1':
     break;
case 
'RSS2':
     break; 

Under it add:
PHP Code:

case 'PHP':
     break; 

Find:
PHP Code:

// +=============================================================+
// | Build the RSS feeds                                         |
// +=============================================================+
else if (($_REQUEST['type'] == 'RSS' OR $_REQUEST['type'] == 'RSS1' OR $_REQUEST['type'] == 'RSS2') AND $vboptions['externalrss']) 

Above it add:
PHP Code:

else if ($_REQUEST['type'] == 'PHP')
// PHP output
    
echo serialize($threadcache);


Hope this helps,

jd :)

Quote:

Originally Posted by KW802
If there are no objections I'll incorporate that into the next round of changes I'm working on. :)

Sorry it took so long to respond, I have only just rechecked this thread. I have no probs you using my instructions, it was just to get okrogius's code to work with your version instead of the original external.php.

The only problem I see with okrogius's code is that there is no mechanism to turn off the php feed in the ACP (whereas you can switch off the others), that needs to be factored in when adding the php feed if okrogius gives permission to use his code.

jd :)


All times are GMT. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01137 seconds
  • Memory Usage 1,783KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete