PDA

View Full Version : Have PF on your website!


Greg Bernhardt
Apr3-04, 06:40 PM
If you have your own website you can have an updated steam of current PF posts right on your site.

Just copy this code into your page and thats it!


<script src="http://www.physicsforums.com/external.php?type=js&forumids=111,61,62,63,64,71" type="text/javascript"></script>
<script type="text/javascript">
document.writeln("<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\">");
for(var i=0; i<10; i++)
{
if(i < 9)
document.writeln("<tr><td style=\"border-bottom: 1px solid #B4C1CD\">");
else
document.writeln("<tr><td>");
document.writeln("<small><a href=\"http://www.physicsforums.com/showthread.php?t="+threads[i].threadid+"\">"+threads[i].title+"</a></small></td></tr>");
}
document.writeln("</table>");
</script>


For people who are more advanced with the net and websites you can parse our RSS and XML feed:

http://www.physicsforums.com/external.php?type=xml
http://www.physicsforums.com/external.php?type=rss

Greg Bernhardt
Apr4-04, 11:44 AM
I should note that this feed only takes from the "physics forums", you can add more or exclude some by editing "forumids=111,61,62,63,64,71". You can find forum ids but looking at each forum url which will include the id.

dduardo
Apr4-04, 12:01 PM
Whats the limit for checking the rss feed? My ip got temporarily banned on slashdot because I wrote my program to check every 5 minutes. Slashdot only permits checking once every 30 minutes.

Greg Bernhardt
Apr4-04, 12:02 PM
Whats the limit for checking the rss feed? My ip got temporarily banned on slashdot because I wrote my program to check every 5 minutes. Slashdot only permits checking once every 30 minutes.

We don't have a limit, but please be kind to our bandwidth and don't check every five minutes :smile:

Greg Bernhardt
Apr6-04, 02:34 PM
Anyone using this? If so I'd like to sneek a peek at the site :smile:

Monique
Apr7-04, 03:17 PM
Well.. i did.. not that my site is really developed or anything.. besides the nice colors and all (I did the designing myself) ;)

it's under 'sites' (http://home.student.uva.nl/monique.vandervoet/)

Greg Bernhardt
Apr7-04, 03:29 PM
Well.. i did.. not that my site is really developed or anything.. besides the nice colors and all (I did the designing myself) ;)

it's under 'sites' (http://home.student.uva.nl/monique.vandervoet/)


Looks good Monique!! :smile:

Greg Bernhardt
Jun2-04, 01:19 PM
anyone else? :smile:

Werdatothewise
Jun3-04, 03:06 AM
If you have your own website you can have an updated steam of current PF posts right on your site.

Just copy this code into your page and thats it!


<script src="http://www.physicsforums.com/external.php?type=js&forumids=111,61,62,63,64,71" type="text/javascript"></script>
<script type="text/javascript">
document.writeln("<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\">");
for(var i=0; i<10; i++)
{
if(i < 9)
document.writeln("<tr><td style=\"border-bottom: 1px solid #B4C1CD\">");
else
document.writeln("<tr><td>");
document.writeln("<small><a href=\"http://www.physicsforums.com/showthread.php?t="+threads[i].threadid+"\">"+threads[i].title+"</a></small></td></tr>");
}
document.writeln("</table>");
</script>


For people who are more advanced with the net and websites you can parse our RSS and XML feed:

http://www.physicsforums.com/external.php?type=xml
http://www.physicsforums.com/external.php?type=rss

Greg, I would be more than happy to have your website posted to mine. I finally have ours done for the state of Texas home educators. Problem is, I am now out of my "rhelm" for further programming and/or additions to the site. I need to find a person who would be willing to finish up a couple of additions...... hint, hint...... :smile:

elas
Sep10-04, 12:56 AM
Can someone tell me the correct way to enter this code in MSFRONTPAGE

musky_ox
Sep10-04, 08:17 PM
Highlight, Cntl-C, click into the code section for frontpage, Cntl-V

elas
Sep11-04, 01:19 AM
musky ox-Thanks-elas

exequor
Nov1-04, 04:41 PM
hey this is a cool addon to any website. i will add it to my website soon since i'm a big fan of physicsforums.

yxgao
Dec15-04, 02:06 AM
Can someone tell me the correct way to enter this code in MSFRONTPAGE


I was able to do this in Ms Frontpage. It's simple. You can either copy and paste the HTML into the page under "Code" view, or paste it into "Design" view and choose "Paste as HTML" from the suitcase icon.

futb0l
Dec17-04, 07:57 PM
Pretty cool :)

Thomas2
Mar31-05, 08:29 AM
The script doesn't work in my IE5.5 browser. I get Javascript errors because apparently the threads don't download. It is OK with Mozilla and Opera though.
Also, I noticed that your server actually sends out 15 threads, whereas the script above prints out only 10.

Greg Bernhardt
Aug31-05, 06:33 PM
The script doesn't work in my IE5.5 browser. I get Javascript errors because apparently the threads don't download. It is OK with Mozilla and Opera though.
Also, I noticed that your server actually sends out 15 threads, whereas the script above prints out only 10.

Right, you can change it back to 15, I thought 10 was a little neater though.

-Job-
Nov5-05, 11:47 PM
Here, i added to my site which is my homepage (for my use mostly, i don't get many visitors). :smile:
http://www.bloo.us

moose
Nov29-05, 05:10 PM
When I finally get around to creating my website, I'll make sure to put this on there!

-Job-
Dec30-05, 05:08 PM
Greg, could you have a version of the script that doesn't set a cookie? Having a script set a cookie from another domain resembles tracking cookies and all, so i'm getting a privacy report in IE for my website.

Greg Bernhardt
Dec30-05, 05:46 PM
Greg, could you have a version of the script that doesn't set a cookie? Having a script set a cookie from another domain resembles tracking cookies and all, so i'm getting a privacy report in IE for my website.

I'm not going to alter anything for one persons personal security setting, sorry :smile: Can't you just ignore it or set it to allow cookies?

-Job-
Dec30-05, 10:23 PM
That's not the problem, i do allow the cookies it's just that in most IE browsers there will be a little privacy icon at the bottom of the page and a popup message because a cookie was set that was from another domain.
The only problem is that visitors to my site might think i'm tracking them with cookies because of this.
For example at school in all the computers at the computer lab this happened. It's not my settings in particular.

-Job-
Jan24-06, 06:00 PM
Actually, IE even blocks the cookie by default, so it's not even being used. It's not just my settings either, it's the default setting. Don't take it personally but i think you ought to rethink the cookie.

Greg Bernhardt
Apr25-06, 11:56 PM
Is this still working for everyone?

Mattara
May15-06, 11:55 AM
Here is the RSS feed from my website:

http://www.moridin.moved.in/physics/index.php?option=com_newsfeeds&task=view&feedid=11&Itemid=7

It works very well. I just love it. now I can stay PF on other sites aswell. Thank you very much for setting this up :)

-Job-
Aug6-06, 02:39 PM
An alternative is to set the cookie from the Javascript code rather than the PHP script. The problem is that visitors come to the site and a cookie is set from a different domain (physicsforums.com). Browsers don't like this. I mean, i like having links to PF on my site, but i don't like having browsers report a tracking cookie. It just doesn't look good, visitors need to trust the site.

So please Greg, if possible, can you remove the cookie? Or, if i write a version where the javascript sets the cookie (rather than the PHP) would you make that available?

Greg Bernhardt
Sep13-06, 09:27 AM
Job I see what you mean. An update I am soon to do maybe handle this for you.

Anyone else using this code or linking to PF. If so, share your website :)

Greg Bernhardt
Nov1-06, 01:19 PM
Please add a link to PF on your websites or myspace pages, it helps! :)

makc
Apr27-07, 03:26 AM
For those who might use it, here's a php example of parsing their XML feed:<?php

function getPF () {
$threads = array ();
$lines = @file ("http://www.physicsforums.com/external.php?type=xml");

$t = array ();
// this code relies on line breaks they have
for ($i = 0; $i < count($lines); $i++) {
if (preg_match ('/<thread id="(\d+)"/', $lines[$i], $m))
$t ["id"] = $m [1]; else
if (preg_match ('/<title>([^<]+)<\/title/', $lines[$i], $m))
$t ["title"] = $m [1]; else
if (preg_match ('/<author>([^<]+)<\/author/', $lines[$i], $m))
$t ["author"] = $m [1]; else
if (preg_match ('/<data>([^<]+)<\/data/', $lines[$i], $m))
$t ["date"] = $m [1]; else
if (preg_match ('/<time>([^<]+)<\/time/', $lines[$i], $m))
$t ["time"] = $m [1]; else
if (preg_match ('/<time>([^<]+)<\/time/', $lines[$i], $m))
$t ["time"] = $m [1]; else
if (preg_match ('/<\/thread>/', $lines[$i])) {
// add to array
array_push ($threads, $t); $t = array ();
}
}

return $threads;
}

?>



<PRE><?php /* test output */ print_r (getPF ()); ?></PRE>The result of this code looks like:Array
(
[0] => Array
(
[id] => 167743
[title] => How to include an image?
[author] => lpfr
[date] => 04-27-2007
[time] => 02:27 AM
)

[1] => Array
(
[id] => 167741
[title] => simple partial fractions help (warning complex analysis :P )
[author] => trickae
[date] => 04-27-2007
[time] => 01:58 AM
)
...You can use this array then to create content the way you want. I do not know that way, so it is not in this example :) Enjoy.

makc
Apr29-07, 01:53 AM
Btw, I think people would more likely use feeds filtered by username(s) on their personal sites. Can you please add this feature, in the same way as you filter by forums right now?

Thanks for your consideration.

Greg Bernhardt
Sep3-07, 05:50 PM
makc thanks for the code and suggestion, I will look into it!

Loren Booda
Sep3-07, 07:49 PM
My website PF promotion has been updated in one swell foop!

Greg Bernhardt
Sep13-07, 08:27 PM
My website PF promotion has been updated in one swell foop!

Lookin good Loren!

hypatia
Oct20-07, 06:27 PM
:cry:The link just shows up as script on myspace. I can't seem to make it work.

Greg Bernhardt
Dec14-07, 06:28 PM
:cry:The link just shows up as script on myspace. I can't seem to make it work.

I bet myspace doesn't allow the execution of javascript. :(
You could just add PF as a normal link. :)

Greg Bernhardt
Mar6-08, 10:17 AM
Bumping for a another reminder to get a link to PF on your website! :)

Mk
Apr14-08, 02:01 AM
Greg, perhaps you could code up a little html widget that is consistent with the boxes you have on the homepage that describe recent SciAm articles, NASA image of the day, and Physics Post? If you did that, I would love to have it on my site. Right now it looks kind of plain.

Greg Bernhardt
Apr14-08, 11:24 AM
Greg, perhaps you could code up a little html widget that is consistent with the boxes you have on the homepage that describe recent SciAm articles, NASA image of the day, and Physics Post? If you did that, I would love to have it on my site. Right now it looks kind of plain.

With a little HTML knowledge you could easily format/customize it yourself to match you website style :)

Greg Bernhardt
May13-08, 12:27 PM
Bumping for a another reminder to get a link to PF on your website! :)

Greg Bernhardt
May31-08, 11:25 PM
Anyone want to show off their PF link on their website?

Greg Bernhardt
Sep1-08, 04:33 PM
Bump for the school season. Get PF on your school website :)

Greg Bernhardt
Sep25-08, 12:01 PM
Feel free to post your websites here if you have a link to PF on it.

Loren Booda
Sep26-08, 12:14 AM
http://www.quantumdream.net
Follow your insight...
Phase Reality!
{^,^}

Greg Bernhardt
Jan16-09, 02:23 PM
FYI, get those PF links on your website, because within a few days I'll be running another random draw contest. $25 to the winner!

Greg Bernhardt
Jun11-09, 02:11 AM
Friendly bump :smile:

btw, you can now also use your blog RSS to display recent blogs on your websites

Greg Bernhardt
Sep1-09, 09:04 PM
Bump for all those returning to school, get a PF link on your website :)

OmCheeto
Dec13-09, 06:23 PM
Bump for all those returning to school, get a PF link on your website :)

Does this count (http://home.europa.com/~garry/index.htm)?

I'm pretty sure I'd get a C- from the teacher for the disjointedness of my life.

...........

Also, did you remove your Costa Rica pictures? My friends are flying off to Viejo in 3 days and I couldn't find your bats climbing up the tree pics.

Greg Bernhardt
Dec15-09, 02:18 PM
Does this count (http://home.europa.com/~garry/index.htm)?

I'm pretty sure I'd get a C- from the teacher for the disjointedness of my life.

...........

Also, did you remove your Costa Rica pictures? My friends are flying off to Viejo in 3 days and I couldn't find your bats climbing up the tree pics.

Looks good! My photos should still be around somewhere :)

Greg Bernhardt
Feb25-10, 08:16 AM
Reminder to get that link to PF on your websites! :smile:

Norman
Jan4-11, 08:30 AM
Not that my blog is terribly well read (well I doubt anyone has actually read it yet since I just started it a few days ago):

http://berserkfather.blogspot.com/

I added the bit'o'Java that was posted on this first page to my 'Favorites' page along with a link to PF. I will eventually re-do the favorites page to be a lot nicer. But for now it will do.

Greg Bernhardt
Jan4-11, 10:01 AM
I added the bit'o'Java that was posted on this first page to my 'Favorites' page along with a link to PF. I will eventually re-do the favorites page to be a lot nicer. But for now it will do.

Looks great Norman, thanks!!

Femme_physics
Mar4-11, 01:38 PM
Use this as the new ad banner :wink:

Greg Bernhardt
Mar4-11, 01:39 PM
Use this as the new ad banner :wink:

meh, I'm more a fan of Physics on Chemistry action :biggrin: :!!)

Femme_physics
Mar4-11, 01:43 PM
Yea, but you're not allowed to touch chemistry until you got your math squared *grins* :wink:

Greg Bernhardt
Mar4-11, 02:05 PM
I like how it's on graph paper too :D

Femme_physics
Mar4-11, 02:11 PM
:biggrin: That's the least, I actually think I should've added some triangles and vectors..heh...

dlgoff
Mar4-11, 05:44 PM
I like how it's on graph paper too :D

She can put her web link in her signature if she wants as a Gold member. Right?

Greg Bernhardt
May5-11, 09:54 AM
She can put her web link in her signature if she wants as a Gold member. Right?

Yes absolutely!

Femme_physics
May5-11, 11:43 AM
Yes absolutely!

LOL. R u serious? :P

And good thing you remembered to reply after only 2 months!

I'll be happy to spam the damn thing everywhere whether it gets me gold or not. :D tbh I am always disappointed I didn't do something more nerdy to add to the naughty expression...like biting on a pencil and holding a pendulum (which I have)... hehe

Greg Bernhardt
May5-11, 11:45 AM
I am always disappointed I didn't do something more nerdy to add to the naughty expression...like biting on a pencil and holding a pendulum (which I have)... hehe

Lifetime Gold! :D

Femme_physics
May5-11, 11:54 AM
LMAO. I'll see if I can fashion something soon ^^ :) and I'll see if I can come up with a better pun!

Femme_physics
May9-11, 11:55 AM
Clearly I need some help coming up with slogans lol

Seriously, I'm all set-up to take a good pic, but lacking something good to write^^

Any ideas?

Borek
May9-11, 11:59 AM
I like the lower left most. Simple, clear message, not overloaded with hard to digest meanings.

Femme_physics
May9-11, 12:36 PM
LOL could've probably been more classic but **** it! :P

http://img148.imageshack.us/img148/1232/thisisitl.jpg (http://imageshack.us/photo/my-images/148/thisisitl.jpg/)

Greg Bernhardt
May9-11, 12:57 PM
LOL could've probably been more classic but **** it! :P

http://img148.imageshack.us/img148/1232/thisisitl.jpg (http://imageshack.us/photo/my-images/148/thisisitl.jpg/)

"Femme_physics, now in Gold" :D Love your community spirit!

What can I say!? I think you outdid yourself this time. Looks great! :approve: :redface:

Femme_physics
May9-11, 01:07 PM
Thank you darling :D :D I'm really glad you like it! XoX

I'm -very- honored to be gold here! *deep bow* What a huge moral boost!

I still say this forum is the best thing that happened to the internet!^^ Screw youtube!

Thank you!

I like Serena
May9-11, 01:08 PM
LOL could've probably been more classic but **** it! :P

http://img148.imageshack.us/img148/1232/thisisitl.jpg (http://imageshack.us/photo/my-images/148/thisisitl.jpg/)

You definitely attract me to this forum!!!
Looks awesome!

And congratulations with the gold! :smile:

Femme_physics
May9-11, 01:16 PM
Thanks ILS^^
I said it in a PM and I will say it here, you're the best mentor I could've hoped to find! :)

jhae2.718
May9-11, 01:25 PM
You attract us with \mathbf{F} = -\frac{GMm}{r^2}\hat{r}. :tongue2:

Femme_physics
May9-11, 01:27 PM
you attract us with \mathbf{f} = -\frac{gmm}{r^2}\hat{r}. :tongue2:

lmao!

JaredJames
May9-11, 01:38 PM
Well, this has certainly confirmed that flashing a bit of cleavage is the way to go about getting things done... :wink:

jhae2.718
May9-11, 01:39 PM
LOL could've probably been more classic but **** it! :P

http://img148.imageshack.us/img148/1232/thisisitl.jpg (http://imageshack.us/photo/my-images/148/thisisitl.jpg/)

The lim as what goes to zero? :uhh:

Femme_physics
May9-11, 01:49 PM
Well, this has certainly confirmed that flashing a bit of cleavage is the way to go about getting things done... :wink:

A bit? I say sir my cleavage is more than "a bit!"

And are you saying I should not study for the test just flash my professor?

I'll consider it.

The lim as what goes to zero?

I can tell you, but then I'll be forced to ....well, make me do my homework! ;)

JaredJames
May9-11, 01:51 PM
A bit? I say sir my cleavage is more than "a bit!"

I was referring to the amount on show, as opposed to the overall quantity. You'll get no complaints either way from here!
And are you saying I should not study for the test just flash my professor?

I'll consider it.

I might be...

Femme_physics
May9-11, 01:57 PM
I was referring to the amount on show, as opposed to the overall quantity. You'll get no complaints either way from here!

;D figured.

I like Serena
May9-11, 01:57 PM
The lim as what goes to zero? :uhh:

The longer one looks, the less brain is left.

:smile: → :redface: → :bugeye: → :tongue2:

JaredJames
May9-11, 01:59 PM
;D figured.

You know, I may have a good suggestion for your avatar... :biggrin:

jhae2.718
May9-11, 02:02 PM
You know, I may have a good suggestion for your avatar... :biggrin:

Heh, FP will have no difficulty getting assistance in HH if she does that...

Femme_physics
May9-11, 02:07 PM
*grins*

This is a great day to be cyberly active ;)

jhae2.718
May9-11, 02:14 PM
If this wasn't on the Internet, I would have run away in terror already...

I like Serena
May9-11, 02:17 PM
*grins*

This is a great day to be cyberly active ;)

Good choice!!!
I liked that one a lot already! :smile: