Previous Thread
Next Thread
Print Thread
Hop To
#266116 07/18/2024 12:51 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
If all other pages in my website are .htm/html what is the best way to use External Islands in one of them?

ECNet #266119 07/20/2024 12:24 PM
Joined: Dec 2003
Posts: 6,617
Likes: 84
Joined: Dec 2003
Posts: 6,617
Likes: 84
Bill, the built in tool is gone now that helped you get started . I do not know why it was removed.
But anyway the island in question needs to have the always build option checked.

Here are two methods to insert php into a html page.
https://www.geeksforgeeks.org/how-t...cument-using-include-or-require-keyword/


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #266120 07/21/2024 12:54 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Thanks Ruben,

I was looking at the different ways to get the script to execute from within an HTML page. I see I can add a line to my .htaccess to get all html pages to get processed as php, but didn't know if there were any downsides to that. Specifically, with my index.html page I didn't want to redirect to an index.php (or change the name) and have unentended Google consequences.

After some deliberation my plan is to leave index.html in place and make a new index.php which my server seems to treat as default.

What was the Tool you were referring to? Something to create the External Island codes? I'd really be interested in that. I've been searching here for direction on how to create one for a Random Gallery Image, but so far no luck.

ECNet #266121 07/21/2024 1:40 PM
Joined: Dec 2003
Posts: 6,617
Likes: 84
Joined: Dec 2003
Posts: 6,617
Likes: 84
as i recall when you selected always build then a link would take you to a page with the coding just for external islands as well as some brief notes on how to but you still had to work on the css tags because the style sheet was not declared.
now you need to grab the file in cache builders and kinda marry that with the template file.
the file for the option is still there and works

Okay stupid me because I have not used it in years.
In cp goto column layout where you set the order of display for islands at the far right column it is there now.
But do not forget to check the always build on the subject island,


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #266122 07/21/2024 3:01 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Originally Posted by Ruben
Okay stupid me because I have not used it in years.
In cp goto column layout where you set the order of display for islands at the far right column it is there now.
But do not forget to check the always build on the subject island,
I was about to post that.

I'm able to get the Islands to work externally, just working on formatting issues now.

Seems I do have a code for a Random Gallery Island (that I must've gotten here somewhere?) but the thumbnail is only 120px wide.

ECNet #266123 07/21/2024 3:50 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
I found the thread where I got the Random Code from:

https://www.ubbcentral.com/forums/ubbthreads.php/topics/260118/random-image-island

I updated mine to the last code modification there (Thanks isaac !!) and it works with a larger pic.

Can a code like that be modified to pick and Display a Random Thread within a specific Forum?

ECNet #266162 08/19/2024 7:18 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Is there any downside to adding a line to .htaccess so that htm/html pages will be processed as php so that I can include External Islands on them?

ECNet #266163 08/20/2024 12:17 PM
Joined: Dec 2003
Posts: 6,617
Likes: 84
Joined: Dec 2003
Posts: 6,617
Likes: 84
You can imbed php in html
Just use the start and end tags


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
ECNet #266165 08/24/2024 4:11 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Ruben,

It doesn't seem to work with just the tags. Do I have to add a line to my .htaccess file?

Like this? Or similar?

Code
AddType application/x-httpd-php .html .htm

ECNet #266169 08/24/2024 8:13 PM
Joined: Jun 2006
Posts: 16,347
Likes: 122
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,347
Likes: 122
That is entirely unsupported code, you may discover issues with scripts in the future.

PHP tags are supported in Custom Islands, syntax would be similar to (this is the Random Gallery image code):
Code
/* YOUR PHP CODE GOES IN THIS TOP SECTION */
$query = "
	SELECT POST_ID, FILE_DIR, FILE_NAME
	FROM {$config['TABLE_PREFIX']}FILES
	WHERE (FILE_DIR <> '' AND FILE_DIR IS NOT NULL)
	  AND (FILE_TYPE = 'jpg'
	   OR FILE_TYPE = 'gif'
	   OR FILE_TYPE = 'jpg'
	   OR FILE_TYPE = 'jpeg'
	   OR FILE_TYPE = 'png')
	ORDER BY rand()
	LIMIT 1
";
$sth = $dbh->do_query($query, __LINE__, __FILE__);
list($postId, $fDir, $fName) = $dbh->fetch_array($sth);

/* YOUR HTML GOES BETWEEN THE EOF HEREDOC BELOW */
$body = <<<EOF
<div class="acvt">
<div style="height:{$config['MAX_THUMB_W_H']}px;overflow:hidden;position:relative;width:100%;display:inline-block;">
<a href="{$config['BASE_URL']}/ubbthreads.php?ubb=showgallery&Number=$postId"><img src="{$config['BASE_URL']}/gallery/$fDir/medium/$fName" alt="" title="" class="p2 cp oi" style="position:absolute;left:-100%;right:-100%;top:-100%;bottom:-100%;margin:auto;max-width:280px;min-height:100%;"></a>
</div>
</div>
EOF;


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
ECNet #266174 08/25/2024 1:01 AM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
You lost me somewhere... smile

If I put the following into a .php page it works. If I put it into a htm page it doesn't

Code
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo "<table width=\"100%\">";
include("/home/electrm4/public_html/forums/languages/english/portal_islands.php");
include("/home/electrm4/public_html/forums/languages/english/generic.php");
include("/home/electrm4/public_html/forums/cache/portal_box_8.php");
echo "</table>";
?>

.htm page
.php page

How can I make the External Islands work on existing .htm/html pages without renaming them?

ECNet #266175 08/25/2024 1:07 AM
Joined: Jun 2006
Posts: 16,347
Likes: 122
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,347
Likes: 122
That code is for a Custom Island in the Control Panel; if you look at the Column Layout page it has links to syntax for External Use for PHP applications, but your mileage may vary.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
ECNet #266176 08/25/2024 9:03 AM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
I got the code from the External link on the Column Layout page. confused

It says
Quote
This page will show you what you'll need to put into a page outside of UBB.threads to use this Content Island inside of it. The page will need to be PHP enabled.

What does "PHP enabled" mean? Does it have to be a .php page? Or, can it be used in a htm/html page with some "enabling"?

Last edited by ECNet; 08/25/2024 9:20 AM.
ECNet #266186 08/25/2024 3:12 PM
Joined: Dec 2003
Posts: 6,617
Likes: 84
Joined: Dec 2003
Posts: 6,617
Likes: 84
Most hosts today allow pho tags in html pages .

As I said before just insert the php tags in your html file
Meaning insert the php start and end tags in the html file
With the pho code in between
No need to have just a pho file to run the script
The server will run both php and html code in the same file at the same time if notated correctly


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #266187 08/25/2024 3:19 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Ruben,

Did you look at my examples above? Did I do something wrong in the .htm example or should I look to the host setup?

ECNet #266188 08/25/2024 3:40 PM
Joined: Dec 2003
Posts: 6,617
Likes: 84
Joined: Dec 2003
Posts: 6,617
Likes: 84
No it looks correct
Look at this note from inmotion

https://www.inmotionhosting.com/support/website/php-code-in-html

Read the complete article including the notes


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Ruben #266189 08/25/2024 4:13 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Thanks,

I did see that. I'm trying to see what works.

ECNet #266190 08/25/2024 6:51 PM
Joined: Mar 2007
Posts: 307
Likes: 3
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 307
Likes: 3
Got it. I was getting server error because I had some duplicate lines.

Thx for checking me.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Test instance works fine
by Baldeagle - 09/09/2024 7:15 PM
How do I edit this line of text?
by ThreadsUser - 09/09/2024 9:07 AM
UBB 8.0.0 Bugs Found
by whk - 09/06/2024 10:53 AM
Avatar letters
by Baldeagle - 09/05/2024 5:42 PM
Who's Online Now
4 members (Baldeagle, toner, Mender, 1 invisible), 315 guests, and 116 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0