PDA

View Full Version : Static_Content


EdgeWise
08-03-2005, 06:22 PM
Create the dir static-content in your subdreamer root dir and simply name the files the same name as the Category that the plugin is used, if lowercase is set to no in the plugin options then file must be in the same capitalization as the category name.

http://www.winkingstarfish.com/p109_static_content.zip

I didn't know about the plugin id, so i just picked one randomly, let me know what you think.

imager
08-03-2005, 06:41 PM
More info please i installed it but when i go to it i get "This Plugin does not have any settings that can be modified."


Imager

EdgeWise
08-03-2005, 06:51 PM
I can't seem to reproduce that error.. are you using sd 2.2?

abcohen
08-03-2005, 07:15 PM
http://www.subdreamer.org/forum/index.php?showtopic=24

you post your plugin ID there to reserve it... please modify your plugin so we stay somewhat in order...

Also I moved this thread to plugin development since you need to have feed back for it to be a final release...

your plugin is also MISSING install.php settings


<?php

if(!defined('TABLE_PREFIX'))
*define('TABLE_PREFIX', '');

if(!defined('IN_SUBDREAMER'))
*die('Hacking attempt!');


// ############################### PLUGIN DETAILS ##############################

$uniqueid * * * = 403;
$pluginname * * = 'Form Builder';
$version * * * *= '1.0';
$pluginpath * * = 'p403_formbuilder/formbuilder.php';
$settingspath * = 'p403_formbuilder/p403_settings.php';
$authorname * * = 'spib';
$authorlink * * = 3020;
$pluginsettings = '17'; /*view/admin*/

//################################ VERSION CHECK ###############################

if($installtype == 'install' || $installtype == 'upgrade')
{
*/* requiredVersion appeared in SD2 but this might be an RC so check for IN_ADMIN as well */
*if(defined('IN_ADMIN'))
*{
* *if(function_exists('requiredVersion') && !requiredVersion(2,0))
* *{
* * *die('Sorry, you need to upgrade to Subdreamer Version 2.0 to use this plugin.');
* *}
*}
*else
*{
* *die('Sorry, you need to upgrade to Subdreamer Version 2.0 to use this plugin.');
*}
}

// ############################### INSTALL PLUGIN ##############################
if($installtype == 'install')
{
}
// ############################### UPGRADE PLUGIN ##############################

if($installtype == 'upgrade')
{
*// upgrade to 1.1
*if($currentversion == '1.0')
*{
* UpdatePluginVersion($uniqueid, '1.1');
* $currentversion = '1.1';
*}

}

// ############################## UNINSTALL PLUGIN #############################

if($installtype == 'uninstall')
{
}

?>

EdgeWise
08-03-2005, 07:23 PM
changed plugin id to 109.

abcohen
08-03-2005, 07:28 PM
Added to my post EdgeWise -- please take a look you need the $pluginsettings and the whole version check area...

EdgeWise
08-03-2005, 07:47 PM
Thanks abcohen, that wasn't in the plugin manual on sd.com, but I guess that's a bit outdated. :)

Uninstall the plugin if you already got it, and reinstall it.. should all just work now.

chrish
08-03-2005, 08:21 PM
Originally posted by EdgeWise@Aug 3 2005
Create the dir static-content in your subdreamer root dir and simply name the files the same name as the Category that the plugin is used
Thanks EdgeWise,

I got as far as creating a folder called "static-content" in the root directory of SubDreamer, but I'm too thick-headed to advance beyond that point.

Chris H.

EdgeWise
08-03-2005, 08:32 PM
Quick example of how the plugin works...

create category named Test in subdreamer, now select the static_content plugin in the setup of that category, then simply drop test.html (assuming lowercase is set to yes and the extension is html) in the static-content dir and that's it.. the html of test.html will appear on the page.

chrish
08-03-2005, 08:42 PM
Okay, hey I got it to work -- and it works great!

But now I have to ask, what if I have multiple pages in a given category?

For example, as you suggested, I have the category "test" and it points to "test.html" -- that part works great. But what about a variety of pages, does each one need its own category?

For instance, here's a sample listing of various articles...

widget-review.html
widget-tutorial1.html
widget-tutorial2.html
widget-modifications.html

expensivething4-review.html
expensivething5-review.html
expensivething5-hacks.html
expensivething6-editorial.html

Do I have to create a separate SD category for each article?

No complaints here, just want to make sure that I understand the process. Thanks again,

Chris H.

EdgeWise
08-03-2005, 08:45 PM
Right now all need to be in their own category.

EdgeWise
08-03-2005, 09:04 PM
I'm actually already brainstorming on how I want to further this plugin, and what i'm thinking of doing is having multiple html files per category in a configurable database (

file1, file2, file3.. in a paged manner (<< < 1 2 3 4 > >>)

), and where you can optionally upload the html directly from the plugin... let me know if that&#39;s something anyone would like to see...

abcohen
08-03-2005, 09:11 PM
Originally posted by EdgeWise@Aug 3 2005, 05:04 PM
I&#39;m actually already brainstorming on how I want to further this plugin, and what i&#39;m thinking of doing is having multiple html files per category in a configurable database (

file1, file2, file3.. in a paged manner (<< < 1 2 3 4 > >>)

), and where you can optionally upload the html directly from the plugin... let me know if that&#39;s something anyone would like to see...
291


sounds good to me.. but I&#39;d like the idea of the plugin
where you create a hidden page [in this case perm] (not on the menu bar) with that one plugin

and you can link to it from http://yoursite/perm/action/filename.html

and it&#39;ll wrap the static file into the site using an include

on the admin side you&#39;ll be able to upload the static content -- copy and paste the future urls once you know what the blank page will be named...

yah-- thats my idea.

EdgeWise
08-03-2005, 09:17 PM
Hmm, that&#39;s easily doable w/ the forumskin.php, though if done right when you uploaded the file it&#39;d append the header and footer info to the html directly so it&#39;d be truely static, hmm&#33; I went the route I did because I still wanted to be able to use other plugins in the categories (breadcrumb, ads, etc)...

chrish
08-03-2005, 09:33 PM
You guys are definitely on the right track here&#33;

Originally posted by EdgeWise@Aug 3 2005, 04:04 PM
... multiple html files per category in a configurable database... and where you can optionally upload the html directly from the plugin...

That&#39;s much more in line with what I&#39;m looking for, and the ability to upload the html directly from within the plug-in is a big deal, so that my writers can do this on their own through the SD user permissions, instead of giving them direct FTP access.

Among my own "static content" currently I&#39;ve got about 200+ articles in a variety of different subjects (or categories). Reviews of widgets from Brand A, Reviews of widgets from Brand B, How-To Articles for Software X, How-To Articles for Software Y, etc. etc.

What would be very cool is to have the page title equal the article&#39;s title, that is, <TITLE>Brand X Widget Model 728-C Product Review</TITLE> instead of <TITLE>widget-review7.html</TITLE>

Seriously I think you&#39;re filling in a key component of SD that&#39;s been missing until now. Great job so far&#33;

Chris H.

imager
08-04-2005, 04:20 PM
I would love to see a print or email option added.... :D







Originally posted by EdgeWise@Aug 3 2005, 09:04 PM
I&#39;m actually already brainstorming on how I want to further this plugin, and what i&#39;m thinking of doing is having multiple html files per category in a configurable database (

file1, file2, file3.. in a paged manner (<< < 1 2 3 4 > >>)

), and where you can optionally upload the html directly from the plugin... let me know if that&#39;s something anyone would like to see...
291

:D :D :D

thomas
08-04-2005, 11:16 PM
Have you thought about usergroup settings etc? im still just trying to work out in my mind about those settings how it would apply for this plugin.

but well done anyway.

ive got a big project im about to work on and i was thinking of using the article system but this would be a much better alternative.

Jam
08-06-2005, 03:51 AM
Assuming you are going to store numerous articles in a folder, rather than the DB; how about a hack of the "Link Directory" to be an "Article Manager". Change a few headings to read "Article" rather than "Link" and perhaps the "submit link" form could become a "submit article" form where you had a choice of using the "html editor" or an "upload file" button.

This might not be a good way to go, but I do like the idea of an Article management system. Hope you folks come up with something cool&#33;

Regards

EdgeWise
08-06-2005, 06:19 PM
Originally posted by Jam@Aug 6 2005, 03:51 AM
Assuming you are going to store numerous articles in a folder, rather than the DB; how about a hack of the "Link Directory" to be an "Article Manager".* Change a few headings to read "Article" rather than "Link" and perhaps the "submit link" form could become a "submit article" form where you had a choice of using the "html editor" or an "upload file" button.*

This might not be a good way to go, but I do like the idea of an Article management system.* Hope you folks come up with something cool&#33;

Regards
363


I like this idea, but i&#39;m going to leave it for another plugin to keep things simple...

Development is already underway for static content v2 (i&#39;m going to rename to static content manager), to keep things simple i&#39;m going to leave all adding/editing/deleting categories and items to the "allow administer" permissions.

How it&#39;ll work is:

Initial page will list all categories, if category has been configured to use SCM then i&#39;ll have an edit link beside it, otherwise it&#39;ll have an add link.

you click the category, within it will be a list of the items (html pages) which you can click to edit with the html editor, sort by number and an add item link, which will bring up an html editor and upload box, so you can either create the html there, or upload an existing html page.

then for the actual plugin, simply add it to the category and it&#39;ll display the html in the sort order, broken up in pages (numbered).

ETA for this is 2-3 weeks.

chrish
08-06-2005, 11:34 PM
Hooray EdgeWise&#33; Sounds great. Good luck&#33; Can&#39;t wait to try it out&#33;

rvdc2005
08-16-2005, 08:41 PM
I agree that this is a plugin that is highly needed&#33;

Is there a way to prevent the plugin title ("Static Content") from being displayed at the top of each page?

Thanks, and keep up the good work&#33;
I&#39;m anxious to try out version 2&#33;

Ron

abcohen
08-16-2005, 09:40 PM
Originally posted by rvdc2005@Aug 16 2005, 04:41 PM
I agree that this is a plugin that is highly needed&#33;

Is there a way to prevent the plugin title ("Static Content") from being displayed at the top of each page?

Thanks, and keep up the good work&#33;
I&#39;m anxious to try out version 2&#33;

Ron
709


in the plugin page you can remove the display plugin title and it&#39;ll not display with a header title

rvdc2005
08-18-2005, 02:10 PM
So what exactly do you change in the p109_static_content.php file then? Should I delete the lines marked with **?

function p109_Static_Content()
{
global &#036;DB;
global &#036;categoryid;

&#036;getsettings = &#036;DB->query("SELECT title, value FROM " . TABLE_PREFIX . "pluginsettings WHERE pluginid = 109");
for(&#036;i = 0; &#036;setting = &#036;DB->fetch_array(&#036;getsettings); &#036;i++)
{
&#036;settings[&#036;setting[&#39;title&#39;]] = &#036;setting[&#39;value&#39;];
}

&#036;cat = &#036;DB->query_first("SELECT parentid, name FROM " . TABLE_PREFIX . "categories WHERE categoryid=&#39;&#036;categoryid&#39;");

**if(&#036;settings[&#39;Content Lowercase&#39;] == "1") {
**&#036;cat[&#39;name&#39;] = strtolower(&#036;cat[&#39;name&#39;]);
**}

if (file_exists("static-content/".&#036;cat[&#39;name&#39;].".".&#036;settings[&#39;Content Extension&#39;])) {
include("static-content/".&#036;cat[&#39;name&#39;].".".&#036;settings[&#39;Content Extension&#39;]);
}

}

Thanks
Ron

rvdc2005
08-18-2005, 02:34 PM
Duh, that was easy&#33;
You don&#39;t need to change anything in the PHP file. You only need to delete the plugin&#39;s Website Display Name in Subdreamer&#39;s admin panel.

Ron

abcohen
08-18-2005, 03:22 PM
Originally posted by rvdc2005@Aug 18 2005, 10:34 AM
Duh, that was easy&#33;
You don&#39;t need to change anything in the PHP file. You only need to delete the plugin&#39;s Website Display Name in Subdreamer&#39;s admin panel.

Ron
737


I swear thats what I said up here...
http://www.subdreamer.org/forum/index.php?...topic=49&st=20# (http://www.subdreamer.org/forum/index.php?showtopic=49&st=20#)
:P

chrish
10-06-2005, 01:37 PM
Just curious if any further development is planned for this plugin -- not having a static content solution is the only thing holding me up from using SD.

code_renegade
10-06-2005, 02:23 PM
On the thread about static content on Subdreamer.com, Subduck said that he&#39;ll be looking into it, but it won&#39;t be so soon.

Kind of slows down the progress of my website as a result, actually. I am pretty much holding back launching my website because of this.

chrish
10-25-2005, 02:47 AM
I don&#39;t think we&#39;re going to hear back from EdgeWise, but I have a budget and wopuld be more than happy to throw money at somebody who&#39;s willing to write this plugin.

Ifrit
02-03-2006, 08:48 PM
One Question I have :)

I namen my Category at example "Final Fantasy I" .

but if I put the file Final Fantasy I.html or Final_Fantasy_I.html onto the server. He don`t find/don`t show the dokument.

And An Category with "-" &#39;s looks not so good ;)

I hope you understand and bring me an answer.


Also good work&#33;