• Welcome to Simple Machines Community Forum. Please login or sign up.
January 16, 2022, 04:39:39 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


Custom Action Mod

Started by Norv, May 09, 2006, 08:35:29 PM

Previous topic - Next topic

SRaven

Thanks, but that doesn't work for what I need to do.
I need a 3 part layout, like the frame code in my other post indicated.

Not just one page displayed. 3 files make up this page.  the code I used works,(as you can see from the pic) I just can't get it to work for custom action mod.   :-\

Pic of how it should look is attatched.

guppy

Save your code as your_file_name.html

<html>
<head>   
</head>
<frameset rows="10%,*" border="0">
    <frame name="title" src="title.html">
        <frameset cols="40%,*" border="0">
        <frame name="menu" src="menu.html">
        <frame name="content" src="content.html">
    </frameset>
</frameset>
<body>
</body>
</html>


create a html custom page and point tick's code to your_file_name.html

<center><iframe
src ="you_file_name.html"
width="90%" height="500" scrolling="no">
</iframe></center>


place all the html files to the base directory where smf resides or point to the full url of the files.

spottedhog

April 24, 2007, 12:11:52 PM #222 Last Edit: April 24, 2007, 12:15:59 PM by spottedhog
I have been looking/testing and I think I see some of your problem here...... SMF does not like the html tags of frameset and frame. I think it is because of XHTML Strict DTD does not allow them.

Here is a work around and could give you something nearly as good using the "iframe" tag.

If your desired end result is to have the SMF header and footer display with your code in the middle, then this is a way to do it. One advantage of this method is that you can get around that darn small textarea input box in Custom Actions Mod. :)

Overview: We will create a new template file and place it in the Themes/default directory. Name it whatever..... for example: yourcodename.template.php Then we will create a Custom Action which calls to load that specific template.....; <----- very little coding there. :)

OK... Let's do it! (using your html filenames...)

Create the template file:

<?php

echo 
'Hey! This is Your Template! <br /><br />';
echo '<div>';
include ('title.html');
echo '</div><div>';
echo '<iframe width="100%" height="500px" src="content.html"></iframe></div>';

?>


Save that file as: yourfilenamehere.template.php

Upload that file to the Theme/default directory.

In Custom Acitons put:
loadTemplate('yourfilenamehere');

Make sure you save the Custom Action as a PHP file.

****NOTE: only put the template name here. leave off the .template.php

One thing you would have to do different is to place the menu.html file at the top of your content.html file if you are wanting other pages to load within the iframe.

Using the Custom Actions Mod this way, by creating template files to display the desired Contents seems to be a nice way of enhancing a site.

SRaven

Quote from: iwyen on April 24, 2007, 10:12:30 AM
Save your code as your_file_name.html

<html>
<head>   
</head>
<frameset rows="10%,*" border="0">
    <frame name="title" src="title.html">
        <frameset cols="40%,*" border="0">
        <frame name="menu" src="menu.html">
        <frame name="content" src="content.html">
    </frameset>
</frameset>
<body>
</body>
</html>


create a html custom page and point tick's code to your_file_name.html

<center><iframe
src ="you_file_name.html"
width="90%" height="500" scrolling="no">
</iframe></center>


place all the html files to the base directory where smf resides or point to the full url of the files.

That worked like a charm, thanks!


@Spottedhog- Thanks for the suggestion, I like that idea and might just do that for some other pages that I'll be making, thanks!

breezie

what directory does this mod need installed into, I installed it and get an error page when I try to link to it.

TrueSatan

Quote from: breezie on April 27, 2007, 06:05:45 AM
what directory does this mod need installed into, I installed it and get an error page when I try to link to it.

Please read http://docs.simplemachines.org/index.php?board=49.0;sort=subject

tribalost

can anyone help me... im looking for a code to check if your a guest?
then returns echo '<font size=36 color=#ffffff>YOU NEED TO LOGIN BEFOR YOU SEE THE PAGE!!!</font>;

guppy

Sounds like a feature for the mod :)

if ($context['user']['is_guest'])
echo 'bla bla';
else
echo 'bla bla bla';


derjensen

I get also an error - installed via PackageManager. "Cannot install mod..." SMF, Ver. 1.1.2. Can anyone give a hint!?

SMdot™

Okay for some reason I'm getting text that says Custom Action when I go to my Features and Options... but I don't even have that mod installed =( how can I get rid of this link?

Sharr76

Hi,

could someone help mw with this problem?

[url][http://www.simplemachines.org/community/index.php?topic=161925.0/url]

Thanks  :)

guppy



Niteblade

June 29, 2007, 07:52:34 PM #233 Last Edit: June 29, 2007, 08:00:24 PM by nite0859
I know this installed on 1.1.3, but I didn't see any place to input my values..

1.1.3 ...  ;D
affiliate blog

PoLlama

Maybe you should rename this mod to 'Custom Pages'. Its really not given credit for how useful it is. Just my opinion.

digit

I agree...   this is a GREAT mod.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

PoLlama

Should really be integrated with SMF... why not? This mod applies to everyone, it doesn't use extra resources.

John S

hey, i installed the mod it was all successful but nothing shows up in 'features and options'...

Monniemoo

I've really been wanting to make more actions, and this mod really helped ^_^

One problem: I have links to all the sub-actions in the main actions, and when I click them, it says in the top URL of the web page that it went to the sub-action, but the page didn't change like it's supposed to. Anyone know how to fix this?

((click here [nofollow] and click one of the things under Navigation if you have no idea what I'm talking about))

John S

Quote from: John S on August 09, 2007, 01:55:35 AM
hey, i installed the mod it was all successful but nothing shows up in 'features and options'...

perhaps i should uninstall and reinstall it?

i get this error:

   Type     Action     Description
1.    Delete File    ./Sources/CustomAction.php    
2.    Delete File    ./Themes/default/CustomAction.template.php    
3.    Execute Modification    ./Sources/ModSettings.php    Test failed
4.    Execute Modification    ./index.php    Test failed

why does the test fail?

i tried to do a package parser on this mod and it doesnt work.. hmm.. how do i know if everything that's supposed to be in the 'features and options' area installed?

Advertisement: