From a4e1b4945a7becca5c0cea66edde286cb4080e41 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 11 Jul 2013 01:37:41 +0100 Subject: Non-translatable string plus feature enabled check --- boot.php | 3 ++- mod/webpages.php | 3 ++- view/tpl/webpagelist.tpl | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 8e6852f7a..94affb786 100755 --- a/boot.php +++ b/boot.php @@ -2058,13 +2058,14 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ 'title' => t('Events and Calendar'), 'id' => 'events-tab', ); + if(feature_enabled(local_user(),'webpages')){ $tabs[] = array( 'label' => t('Wepages'), 'url' => $a->get_baseurl() . '/webpages/' . $nickname, 'sel' => ((argv(0) == 'webpages') ? 'active' : ''), 'title' => t('Manage Webpages'), 'id' => 'webpages-tab', - ); + );} } else { // FIXME diff --git a/mod/webpages.php b/mod/webpages.php index 3a3e30309..1e9efa544 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -65,7 +65,8 @@ $r = q("select * from item_id where uid = %d and service = 'WEBPAGE'", // This isn't pretty, but it works. Until I figure out what to do with the UI, it's Good Enough(TM). return $o . replace_macros(get_markup_template("webpagelist.tpl"), array( - '$pages' => $pages + '$editlink' => t('Edit'), + '$pages' => $pages, )); diff --git a/view/tpl/webpagelist.tpl b/view/tpl/webpagelist.tpl index 8ae9a1da8..c05e2ebee 100644 --- a/view/tpl/webpagelist.tpl +++ b/view/tpl/webpagelist.tpl @@ -3,7 +3,7 @@ {{foreach $pages as $key => $items}}
-- cgit v1.2.3 From e29961f818c6401a0e771c029c18ce27573cb570 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 11 Jul 2013 03:17:36 +0100 Subject: Doco --- doc/Home.md | 1 + doc/Webpages.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 doc/Webpages.md diff --git a/doc/Home.md b/doc/Home.md index bf22bd26e..78795c478 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -10,6 +10,7 @@ Red Documentation and Resources * [Connecting to Channels](help/Connecting-to-Channels) * [Permissions](help/Permissions) * [Tags and Mentions](help/Tags-and-Mentions) +* [Web Pages](help/Webpages) * [Remove Account](help/Remove-Account) **Technical Documentation** diff --git a/doc/Webpages.md b/doc/Webpages.md new file mode 100644 index 000000000..ddde2a401 --- /dev/null +++ b/doc/Webpages.md @@ -0,0 +1,14 @@ +Creating Webpages +================= + +Red enables users to create static webpages. To activate this feature, enable the web pages feature in your Additional Features section. + +Once enabled, a new tab will appear on your channel page labelled "Webpages". Clicking this link will take you to the webpage editor. Here you can create a post using either BBCode or the rich text editor. + +Pages will be accessible at mydomain/page/username/pagelinktitle + +The "page link title" box allows a user to specify the "pagelinktitle" of this URL. If no page link title is set, we will set one for you automatically, using the message ID of the item. + +Beneath the page creation box, a list of existing pages will appear with an "edit" link. Clicking this will take you to an editor, similar to that of the post editor, where you can make changes to your webpages. + +If you are the admin of a site, you can speficy a channel whose webpages we will use at key points around the site. Presently, the only place this is implemented is the home page. If you specify the channel "admin" and then the channel called "admin" creates a webpage called "home", we will display it's content on your websites home page. We expect this functionality to be extended to other areas in future. \ No newline at end of file -- cgit v1.2.3 From 8222cede814e012a0fb2f566d940b078c8fdca02 Mon Sep 17 00:00:00 2001 From: git-marijus Date: Thu, 11 Jul 2013 17:39:45 +0200 Subject: Update boot.php typo --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 94affb786..9facdd005 100755 --- a/boot.php +++ b/boot.php @@ -2060,7 +2060,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ ); if(feature_enabled(local_user(),'webpages')){ $tabs[] = array( - 'label' => t('Wepages'), + 'label' => t('Webpages'), 'url' => $a->get_baseurl() . '/webpages/' . $nickname, 'sel' => ((argv(0) == 'webpages') ? 'active' : ''), 'title' => t('Manage Webpages'), -- cgit v1.2.3 From c28f7e06222ac8ef1adf1e7813d1f2c5d0cd130a Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 12 Jul 2013 01:19:05 +0100 Subject: Make sure we load the channel theme when displaying a page. --- mod/page.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mod/page.php b/mod/page.php index 62f9d9204..e1274fff6 100644 --- a/mod/page.php +++ b/mod/page.php @@ -2,6 +2,23 @@ require_once('include/items.php'); require_once('include/conversation.php'); +function page_init(&$a) { + // We need this to make sure the channel theme is always loaded. + $which = argv(1); + $profile = 0; + $channel = $a->get_channel(); + + if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { + $which = $channel['channel_address']; + $profile = argv(1); + } + + profile_load($a,$which,$profile); + +} + + + function page_content(&$a) { @@ -41,4 +58,4 @@ function page_content(&$a) { $o .= prepare_page($r[0]); return $o; -} \ No newline at end of file +} -- cgit v1.2.3 From f45efcab780cefaaa5a677684ac1fc444632a3de Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 12 Jul 2013 23:01:55 +0100 Subject: Small amount of work on webpages. --- mod/webpages.php | 7 +++++-- view/theme/redbasic/css/dark.css | 14 +++++++++++++- view/theme/redbasic/css/style.css | 14 +++++++++++++- view/tpl/webpagelist.tpl | 21 +++++++++++---------- 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/mod/webpages.php b/mod/webpages.php index 1e9efa544..0567f1b32 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -65,8 +65,11 @@ $r = q("select * from item_id where uid = %d and service = 'WEBPAGE'", // This isn't pretty, but it works. Until I figure out what to do with the UI, it's Good Enough(TM). return $o . replace_macros(get_markup_template("webpagelist.tpl"), array( - '$editlink' => t('Edit'), - '$pages' => $pages, + '$editlink' => t('Edit'), + '$pages' => $pages, + '$channel' => $a->profile['channel_address'], + '$view' => t('View'), + )); diff --git a/view/theme/redbasic/css/dark.css b/view/theme/redbasic/css/dark.css index 74e109f95..43912be69 100644 --- a/view/theme/redbasic/css/dark.css +++ b/view/theme/redbasic/css/dark.css @@ -167,4 +167,16 @@ ul.menu-popup .menu-sep { .my-comment-photo { border-radius: 5px; box-shadow: 4px 4px 3px #000; -} \ No newline at end of file +} + + +div#pagelist-content-wrapper { +width: 80%; +background: #111; +margin-left: auto; +margin-right: auto; +} + +div.page-list-item { +margin: 20px; +} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 762c35a18..9caa9145a 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -3893,4 +3893,16 @@ width: 200px; float: left; margin-right: 25px; } -*/ \ No newline at end of file +*/ + + +div#pagelist-content-wrapper { +width: 80%; +background: #fff; +margin-left: auto; +margin-right: auto; +} + +div.page-list-item { +margin: 20px; +} diff --git a/view/tpl/webpagelist.tpl b/view/tpl/webpagelist.tpl index c05e2ebee..5c00dee6b 100644 --- a/view/tpl/webpagelist.tpl +++ b/view/tpl/webpagelist.tpl @@ -1,12 +1,13 @@ {{if $pages}} -
-{{foreach $pages as $key => $items}} -
    -{{foreach $items as $item}} -
  • {{$editlink}} {{$item.title}}
  • -{{/foreach}} -
-
-
-{{/foreach}} + +
+ {{foreach $pages as $key => $items}} + {{foreach $items as $item}} +
{{$editlink}} | {{$view}} {{$item.title}}
+ {{/foreach}} + {{/foreach}} +
+ +
+ {{/if}} -- cgit v1.2.3 From 380871ccc7cc64be29da89c102e99748b25361f9 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 12 Jul 2013 23:43:14 +0100 Subject: Old theme stuff we don't use anymore. --- view/theme/redbasic/img/bg.png | Bin 119030 -> 0 bytes view/theme/redbasic/img/events.png | Bin 1686 -> 0 bytes view/theme/redbasic/img/head.jpg | Bin 383 -> 0 bytes view/theme/redbasic/img/home.png | Bin 1198 -> 0 bytes view/theme/redbasic/img/introductions.png | Bin 1210 -> 0 bytes view/theme/redbasic/img/lock.cur | Bin 4286 -> 0 bytes view/theme/redbasic/img/message.png | Bin 765 -> 0 bytes view/theme/redbasic/img/network.png | Bin 1632 -> 0 bytes view/theme/redbasic/img/settings.png | Bin 1609 -> 0 bytes 9 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 view/theme/redbasic/img/bg.png delete mode 100644 view/theme/redbasic/img/events.png delete mode 100644 view/theme/redbasic/img/head.jpg delete mode 100644 view/theme/redbasic/img/home.png delete mode 100644 view/theme/redbasic/img/introductions.png delete mode 100644 view/theme/redbasic/img/lock.cur delete mode 100644 view/theme/redbasic/img/message.png delete mode 100644 view/theme/redbasic/img/network.png delete mode 100644 view/theme/redbasic/img/settings.png diff --git a/view/theme/redbasic/img/bg.png b/view/theme/redbasic/img/bg.png deleted file mode 100644 index eae49e037..000000000 Binary files a/view/theme/redbasic/img/bg.png and /dev/null differ diff --git a/view/theme/redbasic/img/events.png b/view/theme/redbasic/img/events.png deleted file mode 100644 index 96dd86899..000000000 Binary files a/view/theme/redbasic/img/events.png and /dev/null differ diff --git a/view/theme/redbasic/img/head.jpg b/view/theme/redbasic/img/head.jpg deleted file mode 100644 index 6210b76be..000000000 Binary files a/view/theme/redbasic/img/head.jpg and /dev/null differ diff --git a/view/theme/redbasic/img/home.png b/view/theme/redbasic/img/home.png deleted file mode 100644 index d1ba7b3f3..000000000 Binary files a/view/theme/redbasic/img/home.png and /dev/null differ diff --git a/view/theme/redbasic/img/introductions.png b/view/theme/redbasic/img/introductions.png deleted file mode 100644 index 9e0498227..000000000 Binary files a/view/theme/redbasic/img/introductions.png and /dev/null differ diff --git a/view/theme/redbasic/img/lock.cur b/view/theme/redbasic/img/lock.cur deleted file mode 100644 index 892c5e851..000000000 Binary files a/view/theme/redbasic/img/lock.cur and /dev/null differ diff --git a/view/theme/redbasic/img/message.png b/view/theme/redbasic/img/message.png deleted file mode 100644 index f3fea75ee..000000000 Binary files a/view/theme/redbasic/img/message.png and /dev/null differ diff --git a/view/theme/redbasic/img/network.png b/view/theme/redbasic/img/network.png deleted file mode 100644 index f3e45c3ec..000000000 Binary files a/view/theme/redbasic/img/network.png and /dev/null differ diff --git a/view/theme/redbasic/img/settings.png b/view/theme/redbasic/img/settings.png deleted file mode 100644 index a935b225e..000000000 Binary files a/view/theme/redbasic/img/settings.png and /dev/null differ -- cgit v1.2.3 From e83df684c02d534e81244e958413ac5c67b24e54 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sat, 13 Jul 2013 18:42:49 +0100 Subject: That should fix uploads... --- mod/webpages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/webpages.php b/mod/webpages.php index 0567f1b32..3cb3ec6bd 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -34,7 +34,7 @@ require_once ('include/conversation.php'); $x = array( 'webpage' => 1, 'is_owner' => true, - 'nickname' => $channel['channel_address'], + 'nickname' => $a->profile['channel_address'], 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => (($group || $cid) ? '!' : ''), 'visitor' => 'block', -- cgit v1.2.3 From ba5803bebc144f46fe1a9d29b08e3b6ac71aaecc Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sun, 14 Jul 2013 02:36:59 +0100 Subject: Give prettyphoto it's own template to make themeing it less annoying. --- view/tpl/photo_album.tpl | 12 +----------- view/tpl/photo_view.tpl | 11 +---------- view/tpl/prettyphoto.tpl | 6 ++++++ 3 files changed, 8 insertions(+), 21 deletions(-) create mode 100644 view/tpl/prettyphoto.tpl diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl index 33ab84df7..d2016e41c 100755 --- a/view/tpl/photo_album.tpl +++ b/view/tpl/photo_album.tpl @@ -1,14 +1,4 @@ -{{* - * AUTOMATICALLY GENERATED TEMPLATE - * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN - * - *}} - - +{{include file="prettyphoto.tpl"}}
{{$imgalt}} diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl index fce6f6fa8..f825dcba6 100755 --- a/view/tpl/photo_view.tpl +++ b/view/tpl/photo_view.tpl @@ -1,13 +1,4 @@ -{{* - * AUTOMATICALLY GENERATED TEMPLATE - * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN - * - *}} - +{{include file="prettyphoto.tpl"}}

{{$album.1}}

diff --git a/view/tpl/prettyphoto.tpl b/view/tpl/prettyphoto.tpl new file mode 100644 index 000000000..6d047e620 --- /dev/null +++ b/view/tpl/prettyphoto.tpl @@ -0,0 +1,6 @@ + + -- cgit v1.2.3