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

News:

SMF 2.0.19 has been released! Please update. Read more.


Custom Action Mod

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

Previous topic - Next topic

guppy

Quote from: kat on February 11, 2007, 10:32:13 AM
I made the "Type" php.

I made the page title "ThemeChanger". I'm high on originality, as you can tell.

In the "Code" box, I added:

http://www.tlakoc.org.uk/index.php?action=ThemeChanger




echo 'http://www.tlakoc.org.uk/index.php?action=ThemeChanger';



suggest u use bbc instead of php


[url]http://www.tlakoc.org.uk/index.php?action=ThemeChanger[/url]



guppy

April 04, 2007, 12:34:09 PM #201 Last Edit: April 04, 2007, 12:40:33 PM by iwyen
Great mod  ;)

I'm using it with the SSI Single Message mod cos' it's easier to work on an editor :) With little changes to how the grabbed message is to be displayed, custom mod helps me to show whatever content I have on one of my forum post. The 2 worked really great for me.

One question, or rather, a suggestion.. To add treelink so that the custom page can look uniform. Forum Name > Custom Page Title.

Cheers!

htmlmaster

Great mod, but I'm stuck on one part. Could someone help me attach an RSS feed to the custom action page so it displays content? I've tried doing stuff like this before without the custom action page (I normally use a PHP include), but when I put the code on a custom action page, I get this error:
Quote
Parse error: syntax error, unexpected '<' in /home/nerdcoun/public_html/forum/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1

If it helps, I'm using this feed: http://nerdcouncil.com/blog/?feed=rss2

Thanks!

Darkorical

is it possible to use a frame on a custom action page to access an outside php script so it would run the entire script inside a frame on the 1 custom page? something like


<frameset rows="*,*"" frameborder="NO" border="1" framespacing="0">
  <frame src="http://mysite.com/index.php" name="mainFrame">
</frameset>

MiCCAS

Maybe use the PHP option then use PHP include

Darkorical

well it kinda worked ... it showed the page .. but the php generated links took me back to the main page of the site


any other ideas?

guppy

Quote from: htmlmaster on April 10, 2007, 04:46:10 PM
Great mod, but I'm stuck on one part. Could someone help me attach an RSS feed to the custom action page so it displays content? I've tried doing stuff like this before without the custom action page (I normally use a PHP include), but when I put the code on a custom action page, I get this error:
Quote

Parse error: syntax error, unexpected '<' in /home/nerdcoun/public_html/forum/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1

If it helps, I'm using this feed: http://nerdcouncil.com/blog/?feed=rss2

Thanks!

maybe you could post your code here so that we can take a look..

guppy

Quote from: Darkorical on April 11, 2007, 03:08:38 AM
well it kinda worked ... it showed the page .. but the php generated links took me back to the main page of the site


any other ideas?

I've tried with an iframe and have no problem. Same thing, what code did u use?

Darkorical

Memo to self Don't Code at 2 am.

Where <frameset> and <frame src> failed Iframe worked beautifully. Thank you

htmlmaster

Here's all I have:

<?php include("http://www.nerdcouncil.com/testrss.php"); ?>
[/quote]
And I put that right on the custom action page code area, it's on PHP too.

guppy

htmlmaster,

You don't have to put the php tags, just use

include("http://www.nerdcouncil.com/testrss.php");

or put the (testrss.php) php code into the custom page code box directly (without <?php & ?>).

htmlmaster

Yay! it worked! Thank you so much!

spottedhog

I have been thinking about how to use the Custom Action Mod to create a simple blog using SSI.  My thought is to create something that has 2 parts; a blog list and actually showing the blog.  My concept is to make a Blog Board, and make it so Regular Members can post topics, but only reply to their own topic.

OK....  The 1st part, making the blog list, is pretty straight forward by modifying the ssi_boardNews.  I am thinking I could call the modified ssi as:  ssi_blogList.  Then the 1st Custom Action would be:

<div>ssi_blogList();</div>

This could be the link to a Blog button on the template menu.

I am thinking the 2nd Custom Action could be a slightly modified version of ssi_topics or ssi_topicNews.

2nd Custom Action:

<div>ssi_singleBlog($ID_TOPIC);   <---- $ID_TOPIC from the previous Custom Action created link

Question #1.  For the URL from the Blog List created by the 1st Custom Action, how can I get it to go to the specific ID_TOPIC for the ssi_topics/ssi_topicNews so it shows up in the 2nd Custom Action?

In other words, I know I can put:  ?action=singleBlog (if that is the name of the 2nd Custom Action), but how do I code it to do that?   maybe:  ?action=singleBlog;sa=555   where 555 = the topic ID from the link created in the Blog List?

Question #2.  Will the contents displayed by the Custom Action follow the style.css?

In other words, if I placed additional items in the stylesheet for example in a "div":

#blog {border: 10px ridge navy; margin:10px; padding:10px 100px 10px 100px}

Will the contents accept and display this?

<div id="blog">  allll blog content   </div>

thanks in advance....

spottedhog

I think I answered Question #2.  It should work just fine using the theme's style.css.

soooo, back to Question #1.....

Can I take something like this from the New Comment of the Topics-Replies mod:

'new_comment' => '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . '">' . $txt['smf_news_3'] . '</a>',


and replace:

?action=post;topic=

with something like this?:

?action=singleBlog;topic=

Would the Topic ID variable be transferred to the ssi_singleBlog(); in the 2nd Custom Action or Sub Action?

thanks....

spottedhog

....just did some rough testing and what I proposed above works!!!  woohoo!

one interesting thing was I had to require SSI.php to use the ssi_boardNews, for example.

At least it is able to use style.css

Nice work on the Mod!

SRaven

Hi, can someone tell me how to get frames to work in this?

I added this to the field:

Quote<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>

And created the title.html, menu.html and content.html files and put them in the correct place, But after I save the action and view the page, it didn't output anything..

Any ideas?


spottedhog

did you try it without the html, head, and body tags?


Tick

<center><iframe
src ="http://link to the  page you want to display"
width="90%" height="500" scrolling="no">
</iframe></center>


YOu can do it this way.  Just edit the above code to your liking

Advertisement: