|
Joined: Oct 2003
Posts: 35
User
|
User
Joined: Oct 2003
Posts: 35 |
Is it possible to get any of the content in my UBB.threads database to display outside of my UBB.threads installation? For example, I really like the newspal in IIP, and I wish I could use that elsewhere on my Web site. It would be nice to have the same news posted on my start page of my main web site. Include files commands don't work, of course, and I'm not sure what else to try. Anyone have any ideas?
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Why not use the ubbtnews.php file in your ubbthreads/addons directory.
Edit the php file and then place this link somewhere on the page you want it making sure you edit the path to where the file is located
<? include "path/to/ubbtnews.php"; ?>
|
|
|
|
Joined: Oct 2003
Posts: 35
User
|
User
Joined: Oct 2003
Posts: 35 |
Thanks, Chuck! I tried it but it didn't work, so I must have misunderstood. Here's what I did:
1. Created a blank file with a .php extension 2. Put this text in the file: <? include "D:/users/passport/inetpub/wwwroot/ubb/pals/newspal.php"; ?> 3. Saved it and uploaded it.
But that doesn't work. What am I doing wrong?
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Okay for one that is because you are trying to call the newspal. Now I have been able to call the newspal but that is with a mock up almost identifical to variables found in the index.php file What I posted above was the addon found under your ubbthreads addon directory called ubbtnews.php. It was designed to pull content from the database and display on another page. Here is an example I drew up. http://www.reeftalk.com/news.phpIf you go back to my first post you will see I stated to set the variables in the ubbtnews.php file and then you can use the include statement in whatever page you want. Now the posts are not formatted in nice little boxes but that can be done with a little html work If you need help and get stuck just PM me.
|
|
|
|
Joined: Oct 2003
Posts: 35
User
|
User
Joined: Oct 2003
Posts: 35 |
I figured it out, thanks! I just wasn't familiar with the ubbtnews.php add-on -- I hadn't even looked in the addons folder! Silly me.
Anyway, I got it working. Am I correct in assuming that include code will only work on a file with a .php extension? And if so, do you know how to put a redirect script into a php file? I want to put this news list on the default page for my main web site, and it is an .ASP page with a redirect in it that forces people who type in "http://www.passporterboards.com" directly to my threads installation. It looks like this:
<% Dim HTTPHost HTTPHost= Lcase(Request.ServerVariables("HTTP_HOST")) If HTTPHost = "www.passporterboards.com" then Response.Redirect("http://www.passporterboards.com/ubb/index.php") End If %>
Thanks!
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
well you can use an include statement in a html document with the
<? include ?>
brackets around it.
|
|
|
|
Joined: Oct 2003
Posts: 35
User
|
User
Joined: Oct 2003
Posts: 35 |
I tried it in an HTML document without luck. Here's the link to the file with the <? include ?> statement: http://www.passporterboards.com/ubb/newstest3.htmIt's HTML is: <html> <head> <title>News Test</title> </head> <body> News: <? include "D:/users/passport/InetPub/wwwroot/ubb/addons/ubbtnews.php"; ?> </body> </html>
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Yes some peoples servers are not set up to parse php in an html file
Now on to redirects
<?php // Require the library require ("main.inc.php"); header("Location: {$config['phpurl']}/ubbthreads.php"); ?>
This simple redirect will redirect all people who visit your main page to the forum page
|
|
|
|
Joined: Oct 2003
Posts: 35
User
|
User
Joined: Oct 2003
Posts: 35 |
Ok, so I guess my server doesn't parse PHP in an HTML file then. Is there some way to turn on this ability? The redirect works, thanks, but it redirects everyone. What I need is a way to redirect ONLY people who typed a particular URL (i.e., http://www.passporterboards.com), and not redirect all others.
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
okay what exactly are you trying to do what url to what url
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|