MyBB Community Forums

Full Version: using a custom script in the portal...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

I was wondering if you could display a custom script using the portal?  So I can make THIS look like THIS.
The devotional is actually a script that is displayed with a custom window.

It's a fresh install and I'm migrating to mybb, but I was wondering if it were possible.

Thanks.
assuming that required custom script is based on javascript
such scripts can be manually added by editing template for the portal

see MyBB Templates system
I actually setup a global template, but am not sure how to use it or display it.
what exactly you have added in a new global template ?

I prefer using template conditionals plugin to load content
of a global template
at required location of other template
I just added the script that I want to display and was trying to figure out how to display it if I did it right.

<!--Begin SermonAudio Link Button-->
  <SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="http://www.sermonaudio.com/code_spurgeon.asp?titlecolor=123154"></SCRIPT>
<!--End SermonAudio Link Button-->
^ that code can be added into any template between existing <head> and </head> codes

if you wanted it on the portal page then
you can edit portal template & add that required code just above </head>
I actually tried that an it didn't work.

I went to Templates > Default Templates > Portal Templates
and edited Portal and put that code right before the </head> tag and it didn't show anything.

also tried it in the Index as well with no luck.

also tried to enable html in a forum post and I couldn't get the code to work, it would just show the code.
(2019-05-03, 10:34 AM)SamoanOnion Wrote: [ -> ]I actually tried that an it didn't work.

I went to Templates > Default Templates > Portal Templates
and edited Portal and put that code right before the </head> tag and it didn't show anything.

also tried it in the Index as well with no luck.

also tried to enable html in a forum post and I couldn't get the code to work, it would just show the code.

I'm not an expert on this, but if you are attempting to modify the portal.php, then you must use PHP coding.

Go to this WEBPAGE and look at their first example. (this is using PHP 7.2.xx. Don't bother learning PHP 5.xx.xx because it's slowly being deprecated)

Hopefully, that will solve your issue.
I have tested the given code & it has worked for me on the portal page.
[ temporary test link is sent through PM ]
I understand what you mean, but the code that I'm editing is HTML (I believe)

here is the code with my script inserted:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_announcements} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php?portal=1" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_announcements} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?portal=1&type=atom1.0" />
{$headerinclude}

<!--Begin SermonAudio Link Button-->
  <SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="http://www.sermonaudio.com/code_spurgeon.asp?titlecolor=123154"></SCRIPT>
<!--End SermonAudio Link Button--> 
 
</head>
<body>
{$header}
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="200">
{$welcome}
{$pms}
{$search}
{$stats}
{$whosonline}
{$latestthreads}
</td>
<td>&nbsp;</td>
<td valign="top">
{$announcements}
{$multipage}
</td>
</tr>
</table>
{$footer}
</body>
</html>

I also tried it with the PHP tags and it still didn't work.

Thanks, I got the link
not sure what I'm doing wrong then, is the code correct in the above post?

quick side note, I'm trying to use HTML in a post, are the tags:
[html] [/html]
Pages: 1 2