Version 4.0.13.1
This commit is contained in:
1 parent
f9e857d255
commit
c6a86f0d9b
7517 files changed
+597400
-668041
No files matched your search
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Blog Application Class
|
||||
* @author <a href=''>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2014 Invision Power Services, Inc.
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 3 Mar 2014
|
||||
* @version
|
||||
*/
|
||||
|
||||
namespace IPS\blog;
|
||||
|
||||
/**
|
||||
* Blog Application Class
|
||||
*/
|
||||
class _Application extends \IPS\Application
|
||||
{
|
||||
/**
|
||||
* Init
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
/* If the viewing member cannot view the board (ex: guests must login first), then send a 404 Not Found header here, before the Login page shows in the dispatcher */
|
||||
if ( !\IPS\Member::loggedIn()->group['g_view_board'] and ( \IPS\Request::i()->module == 'blogs' and \IPS\Request::i()->controller == 'view' and \IPS\Request::i()->do == 'rss' ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B221/1', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
public function installOther()
|
||||
{
|
||||
/* Allow non guests to create and comment on Blogs */
|
||||
foreach( \IPS\Member\Group::groups( TRUE, FALSE ) as $group )
|
||||
{
|
||||
$group->g_blog_allowlocal = TRUE;
|
||||
$group->g_blog_allowcomment = TRUE;
|
||||
$group->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get Icon for tree
|
||||
*
|
||||
* @note Return the class for the icon (e.g. 'globe')
|
||||
* @return string|null
|
||||
*/
|
||||
protected function get__icon()
|
||||
{
|
||||
return 'file-text-o';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"blogs": {
|
||||
"blogs": {
|
||||
"tab": "community",
|
||||
"controller": "blogs",
|
||||
"do": "",
|
||||
"restriction": "blogs_manage"
|
||||
},
|
||||
"settings": {
|
||||
"tab": "community",
|
||||
"controller": "settings",
|
||||
"do": "",
|
||||
"restriction": "settings_manage"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"blogs": {
|
||||
"settings": {
|
||||
"settings_manage": "settings_manage"
|
||||
},
|
||||
"blogs": {
|
||||
"blogs_manage": "blogs_manage"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"app=blog&module=blogs&controller=settings&searchResult=form_blog_enable_rating":{"lang_key":"blog_enable_rating","restriction":"settings_manage","keywords":["blog ratings"]},"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rssimport":{"lang_key":"blog_allow_rssimport","restriction":"settings_manage","keywords":["blog rss import"]},"app=blog&module=blogs&controller=settings&searchResult=form_blog_allow_rss":{"lang_key":"blog_allow_rss","restriction":"settings_manage","keywords":["blog rss export"]},"app=blog&module=blogs&controller=settings":{"lang_key":"menu__blog_blogs_settings","restriction":"settings_manage","keywords":["blog settings"]},"app=blog&module=blogs&controller=blogs":{"lang_key":"menu__blog_blogs_blogs","restriction":"blogs_manage","keywords":["blogs","manage blogs","group blogs"]}}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"application_title": "Blogs",
|
||||
"app_author": "",
|
||||
"app_directory": "blog",
|
||||
"app_protected": 0,
|
||||
"app_website": null,
|
||||
"app_update_check": null
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<emails><template><template_app>blog</template_app><template_name>digests__item</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td width='40' align='center' valign='top' class=' '>
|
||||
<img src='{$entry->author()->photo}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
</td>
|
||||
<td align='left'>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; font-weight: bold'>
|
||||
{$email->language->addToStack("x_created_entry_in", FALSE, array( 'sprintf' => array( $entry->author()->name, $entry->container()->_title ) ) )}
|
||||
</p>
|
||||
<h2 style="font-family: 'Helvetica Neue', helvetica, sans-serif; font-size: 18px; font-weight: 500 !important; margin: 0">
|
||||
<a href='{$entry->url()}' style='text-decoration: none;'>{$entry->title}</a>
|
||||
{{if $entry->mapped('featured')}} <span style='color: #68a72f; font-weight: bold; font-size: 12px; text-transform: uppercase;'>{$email->language->addToStack("featured", FALSE)}</span>{{endif}}
|
||||
</h2>
|
||||
<div style='font-family: "Helvetica Neue", helvetica, sans-serif; line-height: 22px; margin-top: 10px; margin-bottom: 10px'>
|
||||
{$email->parseTextForEmail( $entry->content() )|raw}
|
||||
</div>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; margin-bottom: 15px'>
|
||||
|
||||
{{if \IPS\Settings::i()->blog_enable_rating}}
|
||||
{{foreach range( 1, 5 ) as $i}}{{if $i <= $entry->averageRating()}}<img src='{resource="email/rating_on.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{else}}<img src='{resource="email/rating_off.png" location="interface" app="core"}' width='14' height='13' style='vertical-align: middle; margin-right: 2px'>{{endif}}{{endforeach}}
|
||||
|
||||
{{endif}}
|
||||
<strong style='font-family: "Helvetica Neue", helvetica, sans-serif; font-size: 13px;'>
|
||||
<img src='{resource="email/comment.png" location="interface" app="core"}' width='13' height='12' style='vertical-align: middle'> {$email->language->addToStack("num_comments", FALSE, array( 'pluralize' => array( $entry->num_comments ) ) )}
|
||||
</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$entry, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_created_entry_in", FALSE, array( 'sprintf' => array( $entry->author()->name, $entry->container()->_title ) ) )}: {$entry->title} ({$entry->url()})
|
||||
]]></template_content_plaintext></template><template><template_app>blog</template_app><template_name>digests__comment</template_name><template_content_html><![CDATA[<tr style='border-bottom: 1px solid #eeeeee'>
|
||||
<td width='40' align='center' valign='top' class=' '>
|
||||
<img src='{$comment->author()->photo}' width='32' height='32' style='border: 1px solid #000; vertical-align: middle;'>
|
||||
</td>
|
||||
<td align='left'>
|
||||
<p style='font-family: "Helvetica Neue", helvetica, sans-serif; margin: 0; font-size: 13px; font-weight: bold'>
|
||||
{$email->language->addToStack("x_commented_entry", FALSE, array( 'sprintf' => array( $comment->author()->name ) ) )}
|
||||
</p>
|
||||
<h2 style="font-family: 'Helvetica Neue', helvetica, sans-serif; font-size: 15px; font-weight: 500 !important; margin: 0;">
|
||||
<a href='{$comment->item()->url()}' style='text-decoration: none;'>{$comment->item()->name}</a>
|
||||
</h2>
|
||||
<div style='font-family: "Helvetica Neue", helvetica, sans-serif; line-height: 22px; margin-top: 5px; margin-bottom: 5px; border-left: 3px solid #8c8c8c; padding-left: 15px; font-size: 14px; margin-left: 15px'>
|
||||
{$email->parseTextForEmail( $comment->content() )|raw}
|
||||
</div>
|
||||
</td>
|
||||
</tr>]]></template_content_html><template_data>$comment, $email</template_data><template_content_plaintext><![CDATA[{$email->language->addToStack("x_commented_entry", FALSE, array( 'sprintf' => array( $comment->author()->name ) ) )}: {$comment->item()->name} ({$comment->url()})
|
||||
]]></template_content_plaintext></template></emails>
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Friendly URL Structure
|
||||
*
|
||||
* For each value in the $furl array:
|
||||
* The key should be the "SEO Template" - an identifier which you'll use when displaying a URL.
|
||||
* The value should be an associative array with two or three elements: 'friendly' and 'real', and optionally 'verify':
|
||||
* 'friendly'
|
||||
* The friendly URL to use - encase variables in {curly braces} containing a symbol, followed by the name of the parameter that matches in the "real" URL
|
||||
* The symbol should be # for numbers or @ for strings
|
||||
* For example, if the "real" URL contains id=XXX, where XXX is a number, you should include {#id} somewhere in the friendly URL.
|
||||
* You can also use the tag {?} for the "SEO Title" (that is, any variables that shouldn't be part of the real URL, such as the name of the topipc being viewed).
|
||||
* If you want to support more than one SEO Title, you can give them zero-indexed keys like so: {?0} {?1} {?2}
|
||||
* 'real'
|
||||
* This should be the base of the real URL. You should not include parameters which will be parsed out from the friendly URL.
|
||||
* 'verify'
|
||||
* This should be the name of a class that contains a loadFromUrl() and an url() method. The dynamic URL (i.e. app=core&...) will be passed to loadFromUrl(), and the url()
|
||||
* method will subsequently be called to retrieve the correct URL, ideal with ActiveRecord pattern classes.
|
||||
*
|
||||
* IMPORTANT: Ensure values are listed with the most specific ones first. This is to ensure that non-FURL redirects are done correctly. For example, if you have these FURLs:
|
||||
* /index.php?app=myapp&module=mymodule&controller=mycontroller&do=myaction -> /myfolder/myaction
|
||||
* /index.php?app=myapp&module=mymodule&controller=mycontroller -> /myfolder
|
||||
* They must be provided in that order, otherwise the former will redirec to /myfolder/?do=myaction rather than /myfolder/myaction
|
||||
*/
|
||||
{
|
||||
"topLevel": "blogs",
|
||||
"pages": {
|
||||
"blogs_rss": {
|
||||
"friendly": "blog/rss/{#id}-{?}",
|
||||
"real": "app=blog&module=blogs&controller=view&do=rss",
|
||||
"alias": "blog/entry-{#id}-{?}"
|
||||
},
|
||||
"blogs_blog": {
|
||||
"friendly": "blog/{#id}-{?}",
|
||||
"real": "app=blog&module=blogs&controller=view",
|
||||
"verify": "\\IPS\\blog\\Blog"
|
||||
},
|
||||
"blog_entry": {
|
||||
"friendly": "entry/{#id}-{?}",
|
||||
"real": "app=blog&module=blogs&controller=entry",
|
||||
"verify": "\\IPS\\blog\\Entry",
|
||||
"alias": "blog/{#blogid}/entry-{#id}-{?}"
|
||||
},
|
||||
"blog_submit": {
|
||||
"friendly": "submit",
|
||||
"real": "app=blog&module=blogs&controller=submit"
|
||||
},
|
||||
"blog_create": {
|
||||
"friendly": "create",
|
||||
"real": "app=blog&module=blogs&controller=create"
|
||||
},
|
||||
"blogs": {
|
||||
"friendly": "",
|
||||
"real": "app=blog&module=blogs&controller=browse",
|
||||
"alias": "blog"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
Whitespace-only changes.
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="blog">
|
||||
<file javascript_app="blog" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="100045" javascript_position="1000050">/**
|
||||
* IPS Social Suite 4
|
||||
* (c) 2013 Invision Power Services - http://www.invisionpower.com
|
||||
*
|
||||
* ips.browse.list.js - Blog browse list controller
|
||||
*
|
||||
* Author: Rikki Tissier
|
||||
*/
|
||||
;( function($, _, undefined){
|
||||
"use strict";
|
||||
|
||||
ips.controller.register('blog.front.browse.list', {
|
||||
|
||||
initialize: function () {
|
||||
this.on( 'change', '[data-role="moderation"]', this.selectEntry );
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggles classes when the moderation checkbox is checked
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
selectEntry: function (e) {
|
||||
var row = $( e.currentTarget ).closest('.cBlogView_entry');
|
||||
row.toggleClass( 'cBlogView_entrySelected', $( e.currentTarget ).is(':checked') );
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<order app="global" path="/dev/js//framework/">templates
|
||||
common/ui
|
||||
common/utils
|
||||
common
|
||||
controllers</order>
|
||||
<order app="global" path="/dev/js//library/">underscore
|
||||
jquery
|
||||
mustache
|
||||
jstz
|
||||
Debug.js
|
||||
app.js</order>
|
||||
<order app="global" path="/dev/js//library//jquery">jquery.js
|
||||
jquery.history.js
|
||||
jquery.transform.js</order>
|
||||
<order app="global" path="/dev/js//library//xregexp">xregexp-all.js
|
||||
xregexp-lookbehind.js</order>
|
||||
</javascript>
|
||||
@@ -0,0 +1,215 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="blog" version="100045">
|
||||
<word key="__app_blog" js="0">Blogs</word>
|
||||
<word key="frontnavigation_blogs" js="0">Blogs</word>
|
||||
<word key="__indefart_blog_entry_comment" js="0">a comment on a blog entry</word>
|
||||
<word key="__indefart_blog_entry" js="0">a blog entry</word>
|
||||
<word key="module__blog_blogs" js="0">Blogs</word>
|
||||
<word key="menu__blog_blogs" js="0">Blogs</word>
|
||||
<word key="menu__blog_blogs_settings" js="0">Settings</word>
|
||||
<word key="menu__blog_blogs_blogs" js="0">Blogs</word>
|
||||
<word key="acp_search_title_blog_Blogs" js="0">Blogs</word>
|
||||
<word key="acplog__entries_published" js="0">Automatically published blog entries (%s published)</word>
|
||||
<word key="filestorage__blog_Entries" js="0">IP.Blog Entries</word>
|
||||
<word key="add_blog" js="0">Add Blog</word>
|
||||
<word key="block_blog_Overview" js="0">Blog Overview</word>
|
||||
<word key="editor__blog_Blogs" js="0">Blogs</word>
|
||||
<word key="editor__blog_Entries" js="0">Blog Entries</word>
|
||||
<word key="task__blogrssimport" js="0">Checks RSS/Atom feeds for new articles and imports into Blog.</word>
|
||||
<word key="filestorage__blog_Blogs" js="0">Blog Cover Photos</word>
|
||||
<word key="entry_blog_id" js="0">Blog</word>
|
||||
<word key="r__blogs" js="0">Blogs</word>
|
||||
<word key="r__blog_settings_manage" js="0">Can edit blog settings?</word>
|
||||
<word key="r__blogs_manage" js="0">Can manage blogs?</word>
|
||||
<word key="acplogs__blog_settings" js="0">Updated blog settings</word>
|
||||
<word key="blog_enable_rating" js="0">Enable blog ratings?</word>
|
||||
<word key="blog_settings_rss" js="0">RSS Settings</word>
|
||||
<word key="blog_allow_rssimport" js="0">Allow RSS imports</word>
|
||||
<word key="blog_allow_rss" js="0">Allow RSS exports</word>
|
||||
<word key="blogs" js="0">Blogs</word>
|
||||
<word key="blog_word_custom" js="0">Blog Name</word>
|
||||
<word key="blog_blog_member_id" js="0">Blog Author</word>
|
||||
<word key="blogs_sg" js="0">Blog</word>
|
||||
<word key="create_blog" js="0">Create a blog</word>
|
||||
<word key="create_new_blog" js="0">Create a new blog</word>
|
||||
<word key="add_entry_to" js="0">Add entry to a blog</word>
|
||||
<word key="blog_entry" js="0">Blog Entry</word>
|
||||
<word key="blog_entry_pl" js="0">Blog Entries</word>
|
||||
<word key="blog_entry_comment" js="0">Blog Comment</word>
|
||||
<word key="add_blog_entry" js="0">Add Blog Entry</word>
|
||||
<word key="entry_pl" js="0">Blog Entries</word>
|
||||
<word key="blog_entry_comment_pl" js="0">Blog Comments</word>
|
||||
<word key="entry_comments" js="0">Comments</word>
|
||||
<word key="blog_num_views" js="0">{!# [1:view][?:views]}</word>
|
||||
<word key="manage_blog" js="0">Manage Blog</word>
|
||||
<word key="select_blog" js="0">Select Blog</word>
|
||||
<word key="blog_settings" js="0">Blog Settings</word>
|
||||
<word key="blog_name" js="0">Name</word>
|
||||
<word key="blog_desc" js="0">Description</word>
|
||||
<word key="blog_desc_placeholder" js="0">Add a description...</word>
|
||||
<word key="blog_type" js="0">Type</word>
|
||||
<word key="blog_type_normal" js="0">Single author</word>
|
||||
<word key="blog_type_group" js="0">Group</word>
|
||||
<word key="blog_type_group_desc" js="0">Group blogs are jointly managed by all members in selected groups.</word>
|
||||
<word key="blog_groupblog_ids" js="0">Groups</word>
|
||||
<word key="blog_member_id" js="0">Author</word>
|
||||
<word key="blog_groupblog_name" js="0">Group Name</word>
|
||||
<word key="blog_groupblog_name_desc" js="0">Used in place of the owner's name when viewing a Group Blog.</word>
|
||||
<word key="edit_blog" js="0">Edit Blog</word>
|
||||
<word key="delete_blog" js="0">Delete</word>
|
||||
<word key="blog_privacy" js="0">Privacy</word>
|
||||
<word key="blog_privacy_open" js="0">Everyone can read this blog</word>
|
||||
<word key="blog_privacy_private" js="0">Only the members I choose can read this blog</word>
|
||||
<word key="blog_social_group" js="0">Members allowed to read this blog</word>
|
||||
<word key="no_blog_author_selected" js="0">No Blog Author selected</word>
|
||||
<word key="submit_entry" js="0">Submit New Blog Entry</word>
|
||||
<word key="blog_entry_title" js="0">Title</word>
|
||||
<word key="blog_entry_tags" js="0">Tags</word>
|
||||
<word key="blog_entry_auto_follow" js="0">Auto Follow</word>
|
||||
<word key="blog_entry_auto_follow_suffix" js="0">Notify me when other comments are posted</word>
|
||||
<word key="blog_entry_content" js="0">Content</word>
|
||||
<word key="blog_entry_date" js="0">Publish Time</word>
|
||||
<word key="blog_entry_publish" js="0">Publish</word>
|
||||
<word key="blog_entry_mainTab" js="0">Blog Entry</word>
|
||||
<word key="blog_entry_pollTab" js="0">Poll</word>
|
||||
<word key="blog_entry_poll" js="0"></word>
|
||||
<word key="create_blog_entry" js="0">Create Blog Entry</word>
|
||||
<word key="entry_submit" js="0">Submit Entry</word>
|
||||
<word key="entry_information" js="0">Entry Details</word>
|
||||
<word key="blog_entry__save" js="0">Save</word>
|
||||
<word key="immediately" js="0">Immediately</word>
|
||||
<word key="entry_gallery_album" js="0">Album</word>
|
||||
<word key="entry_gallery_album_desc" js="0">You can associate an album from the Gallery with this entry to display images alongside the entry content</word>
|
||||
<word key="block_entryFeed" js="0">Blog Entry Feed</word>
|
||||
<word key="block_entryFeed_desc" js="0">Create a feed of blog entries</word>
|
||||
<word key="widget_feed_container_blog_entry" js="0">Blogs</word>
|
||||
<word key="block_latestComments" js="0">Latest Comments From Your Blogs</word>
|
||||
<word key="block_latestComments_desc" js="0">Shows a list of latest comments from the logged in member's blogs</word>
|
||||
<word key="view_this_entry" js="0">View the entry %s</word>
|
||||
<word key="block_blogStatistics" js="0">Blog Statistics</word>
|
||||
<word key="block_blogStatistics_desc" js="0">Shows general blog statistics</word>
|
||||
<word key="total_blogs" js="0">Total Blogs</word>
|
||||
<word key="total_entries" js="0">Total Entries</word>
|
||||
<word key="prev_entry" js="0">Previous entry</word>
|
||||
<word key="next_entry" js="0">Next entry</word>
|
||||
<word key="blog_entry__comment_placeholder" js="0">Add a comment...</word>
|
||||
<word key="blog_entry_submit_comment" js="0">Submit Comment</word>
|
||||
<word key="entry_actions" js="0">Entry Actions</word>
|
||||
<word key="edit_title_blog" js="0">Edit this blog entry</word>
|
||||
<word key="feature_title_blog" js="0">Feature this blog entry</word>
|
||||
<word key="unfeature_title_blog" js="0">Unfeature this blog entry</word>
|
||||
<word key="pin_title_blog" js="0">Pin this blog entry</word>
|
||||
<word key="unpin_title_blog" js="0">Unpin this blog entry</word>
|
||||
<word key="hide_title_blog" js="0">Hide this blog entry</word>
|
||||
<word key="unhide_title_blog" js="0">Unhide this blog entry</word>
|
||||
<word key="blog_lock_title" js="0">Lock this blog entry</word>
|
||||
<word key="blog_unlock_title" js="0">Unlock this blog entry</word>
|
||||
<word key="blog_move_title" js="0">Move this blog entry</word>
|
||||
<word key="blog_delete_title" js="0">Delete this blog entry</word>
|
||||
<word key="approve_title_blog" js="0">Approve this blog entry</word>
|
||||
<word key="report_entry" js="0">Report Entry</word>
|
||||
<word key="unpublished" js="0">Unpublished</word>
|
||||
<word key="blog_entry_locked_can_comment" js="0">This blog entry is locked, but your permissions allow you to add new comments.</word>
|
||||
<word key="blog_entry_locked_cannot_comment" js="0">This blog entry is now closed to further comments.</word>
|
||||
<word key="entry_posted" js="0">Entry posted</word>
|
||||
<word key="entry_future_posted" js="0">Entry publishes on</word>
|
||||
<word key="entry_images" js="0">Images</word>
|
||||
<word key="blog_comments" js="0">{!#[1:comment][?:comments]}</word>
|
||||
<word key="blog_entries" js="0">{!#[1:entry][?:entries]}</word>
|
||||
<word key="blog_views" js="0">{!#[1:view][?:views]}</word>
|
||||
<word key="recent_entries" js="0">Recent Entries</word>
|
||||
<word key="featured_entries" js="0">Featured Entries</word>
|
||||
<word key="our_community_blogs" js="0">Our community blogs</word>
|
||||
<word key="my_blogs" js="0">My Blogs</word>
|
||||
<word key="blogs_with_content" js="0">Blogs With Entries</word>
|
||||
<word key="sort_last_edate" js="0">Last Entry</word>
|
||||
<word key="sort_num_views" js="0">Views</word>
|
||||
<word key="sort_rating_total" js="0">Rating</word>
|
||||
<word key="from_the_blog" js="0">From the blog</word>
|
||||
<word key="see_more_entries" js="0">See more entries from %s</word>
|
||||
<word key="no_entries_yet" js="0">No blog entries yet</word>
|
||||
<word key="read_more_entry" js="0">Read more of this entry</word>
|
||||
<word key="see_comments_on_entry" js="0">See comments for this entry</word>
|
||||
<word key="add_entry" js="0">Add new entry</word>
|
||||
<word key="this_is_group" js="0">This is a group blog</word>
|
||||
<word key="unread_blog" js="0">This entry is unread</word>
|
||||
<word key="read_blog" js="0">You've read this entry</word>
|
||||
<word key="go_to_blog" js="0">Go to the blog "%s"</word>
|
||||
<word key="latest_entry" js="0">Latest Entry</word>
|
||||
<word key="no_entries" js="0">No blog entries have been created</word>
|
||||
<word key="pin_blog" js="0">Pin</word>
|
||||
<word key="unpin_blog" js="0">Unpin</word>
|
||||
<word key="blog_by" js="0">A blog by %s</word>
|
||||
<word key="group_blog_by" js="0">A group blog by %s</word>
|
||||
<word key="contributors_to_this" js="0">Contributors to this blog</word>
|
||||
<word key="about_this_blog" js="0">About this blog</word>
|
||||
<word key="entries_in_this_blog" js="0">Entries in this blog</word>
|
||||
<word key="blog_rss_offline" js="0">RSS feed disabled</word>
|
||||
<word key="blog_rss_offline_admin" js="0">This RSS feed is disabled either because the setting "Allow RSS exports" is currently disabled in the ACP or it is disabled in the individual blog settings.</word>
|
||||
<word key="blog_enable_rss" js="0">Enable RSS Feed</word>
|
||||
<word key="blog_enable_rss_desc" js="0">Allow this blog to be syndicated with others by enabling RSS</word>
|
||||
<word key="blog_rss_title" js="0">Latest Entries</word>
|
||||
<word key="blog_rss_import" js="0">Atom/RSS Import</word>
|
||||
<word key="blog_rss_import_url" js="0">URL</word>
|
||||
<word key="blog_rss_import_auth_user" js="0">HTTP Authorization Username</word>
|
||||
<word key="blog_rss_import_auth_user_desc" js="0">Most feeds do not require authorization and you can leave this blank.</word>
|
||||
<word key="blog_rss_import_auth_pass" js="0">HTTP Authorization Password</word>
|
||||
<word key="blog_rss_import_auth_pass_desc" js="0">Most feeds do not require authorization and you can leave this blank.</word>
|
||||
<word key="blog_rss_import_tags" js="0">Tags</word>
|
||||
<word key="blog_rss_import_show_link" js="0">Text to use for link</word>
|
||||
<word key="blog_rss_import_show_link_desc" js="0">Will appear at the bottom of the post, linking to the original article.</word>
|
||||
<word key="blog_rss_import_show_link_default" js="0">View the full article</word>
|
||||
<word key="blog_enable_rss_import" js="0">Enable RSS import</word>
|
||||
<word key="blog_enable_rss_import_desc" js="0">Import entries from an external source using RSS</word>
|
||||
<word key="embed_blog_entry" js="0">Blog Entry</word>
|
||||
<word key="embed_blog" js="0">Blog</word>
|
||||
<word key="view_this_blog" js="0">View this blog</word>
|
||||
<word key="user_blogs" js="0">Blogs</word>
|
||||
<word key="profile_blog_blog" js="0">Blogs</word>
|
||||
<word key="also_contributes" js="0">Also contributes to:</word>
|
||||
<word key="contributes_to" js="0">Contributes To</word>
|
||||
<word key="most_recent_entry" js="0">Most recent entry</word>
|
||||
<word key="blog_byline_nodate" js="0">A blog by %s</word>
|
||||
<word key="blog_last_entry_date" js="0">Last entry posted %s</word>
|
||||
<word key="digest_area_entry" js="0">Entries</word>
|
||||
<word key="x_created_entry_in" js="0">%s posted a blog entry in %s</word>
|
||||
<word key="x_commented_entry" js="0">%s commented on an entry</word>
|
||||
<word key="loc_blog_viewing_index" js="0">Browsing Blogs</word>
|
||||
<word key="loc_blog_creating" js="0">Creating a Blog</word>
|
||||
<word key="loc_blog_viewing_blog" js="0">Viewing Blog: %s</word>
|
||||
<word key="loc_blog_adding_entry" js="0">Adding a Blog Entry in: %s</word>
|
||||
<word key="loc_blog_viewing_entry" js="0">Viewing Entry: %s</word>
|
||||
<word key="modperms__core_Content_blog_Entry" js="0">Blogs</word>
|
||||
<word key="can_pin_blog_entry" js="0">Can pin entries?</word>
|
||||
<word key="can_unpin_blog_entry" js="0">Can unpin entries?</word>
|
||||
<word key="can_feature_blog_entry" js="0">Can feature entries?</word>
|
||||
<word key="can_unfeature_blog_entry" js="0">Can unfeature entries?</word>
|
||||
<word key="can_edit_blog_entry" js="0">Can edit entries?</word>
|
||||
<word key="can_hide_blog_entry" js="0">Can hide entries?</word>
|
||||
<word key="can_unhide_blog_entry" js="0">Can unhide entries?</word>
|
||||
<word key="can_view_hidden_blog_entry" js="0">Can view hidden entries?</word>
|
||||
<word key="can_move_blog_entry" js="0">Can move entries?</word>
|
||||
<word key="can_lock_blog_entry" js="0">Can lock entries?</word>
|
||||
<word key="can_unlock_blog_entry" js="0">Can unlock entries?</word>
|
||||
<word key="can_reply_to_locked_blog_entry" js="0">Can reply to locked entries?</word>
|
||||
<word key="can_delete_blog_entry" js="0">Can delete entries?</word>
|
||||
<word key="can_edit_blog_entry_comment" js="0">Can edit comments?</word>
|
||||
<word key="can_hide_blog_entry_comment" js="0">Can hide comments?</word>
|
||||
<word key="can_unhide_blog_entry_comment" js="0">Can unhide comments?</word>
|
||||
<word key="can_view_hidden_blog_entry_comment" js="0">Can view hidden comments?</word>
|
||||
<word key="can_delete_blog_entry_comment" js="0">Can delete comments?</word>
|
||||
<word key="can_future_publish_blog_entry" js="0">Can set a future publishing date?</word>
|
||||
<word key="can_view_future_blog_entry" js="0">Can view pending publishing blog entries authored by other members?</word>
|
||||
<word key="group__blog_Blog" js="0">Blog</word>
|
||||
<word key="g_blog_allowlocal" js="0">Can create blogs?</word>
|
||||
<word key="g_blog_maxblogs" js="0">Maximum number of blogs</word>
|
||||
<word key="g_blog_allowprivate" js="0">Can create private blogs?</word>
|
||||
<word key="g_blog_allowprivate_desc" js="0">Private blogs can only be seen by the members that the creator chooses.</word>
|
||||
<word key="g_blog_allowpoll" js="0">Can add polls to blog entries?</word>
|
||||
<word key="g_blog_allowcomment" js="0">Can comment on blog entries?</word>
|
||||
<word key="g_blog_allowownmod" js="0">Can moderate own blog entries?</word>
|
||||
<word key="g_blog_allowownmod_desc" js="0">The user will be able to: edit comments and entries, delete comments and entries, and lock entries from further comments.</word>
|
||||
<word key="g_blog_allowdelete" js="0">Can delete own blogs?</word>
|
||||
</app>
|
||||
</language>
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"admin": {
|
||||
"blogs": {
|
||||
"default_controller": "",
|
||||
"protected": 0
|
||||
}
|
||||
},
|
||||
"front": {
|
||||
"blogs": {
|
||||
"default_controller": "browse",
|
||||
"protected": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"key": "blog_allow_rss",
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"key": "blog_allow_rssimport",
|
||||
"default": "1"
|
||||
},
|
||||
{
|
||||
"key": "blog_enable_rating",
|
||||
"default": "0"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
{"blogrssimport":"P0Y0M0DT0H30M0S"}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"20000": "2.0.0 Beta 1",
|
||||
"20001": "2.0.0 Beta 2",
|
||||
"20002": "2.0.0 Beta 3",
|
||||
"20003": "2.0.0 RC 1",
|
||||
"20004": "2.0.0 RC 2",
|
||||
"20005": "2.0.0",
|
||||
"20006": "2.0.1",
|
||||
"20007": "2.0.2",
|
||||
"20008": "2.0.3",
|
||||
"20009": "2.0.4",
|
||||
"21000": "2.1.0 Beta 1",
|
||||
"21001": "2.1.0 RC 1",
|
||||
"21002": "2.1.0 RC 2",
|
||||
"21003": "2.1.0",
|
||||
"22000": "2.2.0 Beta 1",
|
||||
"22001": "2.2.0 Beta 2",
|
||||
"22002": "2.2.0 Beta 3",
|
||||
"22003": "2.2.0",
|
||||
"22004": "2.2.1",
|
||||
"22005": "2.2.2",
|
||||
"23000": "2.3.0",
|
||||
"23001": "2.3.1",
|
||||
"23002": "2.3.2",
|
||||
"24000": "2.4.0 Beta 1",
|
||||
"24001": "2.4.0 Beta 2",
|
||||
"24002": "2.4.0",
|
||||
"24003": "2.4.1",
|
||||
"25000": "2.5.0 Alpha",
|
||||
"25001": "2.5.0 Beta 1",
|
||||
"25002": "2.5.0 Beta 2",
|
||||
"25003": "2.5.0",
|
||||
"25004": "2.5.1",
|
||||
"25005": "2.5.2",
|
||||
"26000": "2.6.0 Beta 1",
|
||||
"26001": "2.6.0 Beta 2",
|
||||
"26002": "2.6.0",
|
||||
"26003": "2.6.1",
|
||||
"26004": "2.6.2",
|
||||
"26005": "2.6.3",
|
||||
"40000": "4.0.0",
|
||||
"100000": "4.0.0 Beta 0",
|
||||
"100001": "4.0.0 Beta 1",
|
||||
"100002": "4.0.0 Beta 2",
|
||||
"100003": "4.0.0 Beta 3",
|
||||
"100004": "4.0.0 Beta 3a",
|
||||
"100005": "4.0.0 Beta 4",
|
||||
"100006": "4.0.0 Beta 4a",
|
||||
"100007": "4.0.0 Beta 4b",
|
||||
"100008": "4.0.0 Beta 5",
|
||||
"100009": "4.0.0 Beta 5a",
|
||||
"100010": "4.0.0 Beta 6",
|
||||
"100011": "4.0.0 Beta 7",
|
||||
"100012": "4.0.0 Beta 7a",
|
||||
"100013": "4.0.0 Beta 8",
|
||||
"100014": "4.0.0 RC 1",
|
||||
"100015": "4.0.0 RC2",
|
||||
"100016": "4.0.0 RC3",
|
||||
"100017": "4.0.0 RC4",
|
||||
"100018": "4.0.0 RC5",
|
||||
"100019": "4.0.0 RC5a",
|
||||
"100020": "4.0.0 RC6",
|
||||
"100021": "4.0.0 RC7",
|
||||
"100022": "4.0.0 RC7a",
|
||||
"100023": "4.0.0",
|
||||
"100024": "4.0.1",
|
||||
"100025": "4.0.2",
|
||||
"100026": "4.0.3",
|
||||
"100027": "4.0.4",
|
||||
"100028": "4.0.5",
|
||||
"100029": "4.0.5.1",
|
||||
"100030": "4.0.6",
|
||||
"100031": "4.0.6.1",
|
||||
"100032": "4.0.7",
|
||||
"100033": "4.0.8",
|
||||
"100034": "4.0.8.1",
|
||||
"100035": "4.0.9",
|
||||
"100036": "4.0.9.1",
|
||||
"100037": "4.0.9.2",
|
||||
"100038": "4.0.10",
|
||||
"100039": "4.0.10.1",
|
||||
"100040": "4.0.10.2",
|
||||
"100041": "4.0.11",
|
||||
"100042": "4.0.12",
|
||||
"100043": "4.0.12.1",
|
||||
"100044": "4.0.13",
|
||||
"100045": "4.0.13.1"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"blogStatistics": {
|
||||
"class": "\\IPS\\Widget\\StaticCache",
|
||||
"restrict": [],
|
||||
"default_area": "",
|
||||
"allow_reuse": false,
|
||||
"menu_style": "menu",
|
||||
"embeddable": true
|
||||
},
|
||||
"entryFeed": {
|
||||
"class": "\\IPS\\Widget\\PermissionCache",
|
||||
"restrict": [
|
||||
"sidebar",
|
||||
"cms"
|
||||
],
|
||||
"default_area": "",
|
||||
"allow_reuse": true,
|
||||
"menu_style": "modal",
|
||||
"embeddable": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Content Router extension: Blog
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\ContentRouter;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Content Router extension: Entries
|
||||
*/
|
||||
class _Blog
|
||||
{
|
||||
/**
|
||||
* @brief Content Item Classes
|
||||
*/
|
||||
public $classes = array( 'IPS\blog\Entry' );
|
||||
|
||||
/**
|
||||
* @brief Owned Node Classes
|
||||
*/
|
||||
public $ownedNodes = array( 'IPS\blog\Blog' );
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Create Menu Extension : Entry
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\CreateMenu;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Menu Extension: Entry
|
||||
*/
|
||||
class _Entry
|
||||
{
|
||||
/**
|
||||
* Get Items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
if ( \IPS\blog\Entry::canCreate( \IPS\Member::loggedIn() ) )
|
||||
{
|
||||
return array(
|
||||
'blog_entry' => array(
|
||||
'link' => \IPS\Http\Url::internal( "app=blog&module=blogs&controller=submit", 'front', 'blog_submit' ),
|
||||
'extraData' => array( 'data-ipsDialog' => true, 'data-ipsDialog-size' => "narrow", ),
|
||||
'title' => 'select_blog'
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Dashboard extension: Overview
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\Dashboard;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Dashboard extension: Overview
|
||||
*/
|
||||
class _Overview
|
||||
{
|
||||
/**
|
||||
* Can the current user view this dashboard item?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canView()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the block HTML show on the dashboard
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBlock()
|
||||
{
|
||||
/* Basic stats */
|
||||
$data = array(
|
||||
'total_blogs' => (int) \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs' )->first(),
|
||||
'total_entries' => (int) \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries' )->first(),
|
||||
'total_comments' => (int) \IPS\Db::i()->select( 'COUNT(*)', 'blog_comments' )->first(),
|
||||
);
|
||||
|
||||
/* Display */
|
||||
return \IPS\Theme::i()->getTemplate( 'dashboard', 'blog' )->overview( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the block information
|
||||
*
|
||||
* @return array array( 'name' => 'Block title', 'key' => 'unique_key', 'size' => [1,2,3], 'by' => 'Author name' )
|
||||
*/
|
||||
public function getInfo()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Editor Extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\EditorLocations;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Editor Extension: Blogs
|
||||
*/
|
||||
class _Blogs
|
||||
{
|
||||
/**
|
||||
* Can we use HTML in this editor?
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
|
||||
*/
|
||||
public function canUseHtml( $member )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we use attachments in this editor?
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Helpers\Form\Editor $field The editor field
|
||||
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
|
||||
*/
|
||||
public function canAttach( $member, $field )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3 )
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 )->can( 'view', $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Attachment lookup
|
||||
*
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @return \IPS\blog\Blog
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function attachmentLookup( $id1, $id2, $id3 )
|
||||
{
|
||||
return \IPS\blog\Blog::load( $id1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild attachment images in non-content item areas
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @return int Number completed
|
||||
* @note This method is optional and will only be called if it exists
|
||||
*/
|
||||
public function rebuildAttachmentImages( $offset, $max )
|
||||
{
|
||||
return $this->performRebuild( $offset, $max, array( 'IPS\Text\Parser', 'rebuildAttachmentUrls' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild content post-upgrade
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @return int Number completed
|
||||
* @note This method is optional and will only be called if it exists
|
||||
*/
|
||||
public function rebuildContent( $offset, $max )
|
||||
{
|
||||
return $this->performRebuild( $offset, $max, array( 'IPS\Text\LegacyParser', 'parseStatic' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform rebuild - abstracted as the call for rebuildContent() and rebuildAttachmentImages() is nearly identical
|
||||
*
|
||||
* @param int|null $offset Offset to start from
|
||||
* @param int|null $max Maximum to parse
|
||||
* @param callable $callback Method to call to rebuild content
|
||||
* @return int Number completed
|
||||
*/
|
||||
protected function performRebuild( $offset, $max, $callback )
|
||||
{
|
||||
$did = 0;
|
||||
|
||||
/* Language bits */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_sys_lang_words', "word_key LIKE 'blogs_blog_%_desc'", 'word_id ASC', array( $offset, $max ) ) as $word )
|
||||
{
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$rebuilt = call_user_func( $callback, $word['word_custom'] );
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
{
|
||||
if( $callback[1] == 'parseStatic' AND $e->getcode() == 103014 )
|
||||
{
|
||||
$rebuilt = preg_replace( "#\[/?([^\]]+?)\]#", '', $word['word_custom'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
if( $rebuilt !== FALSE )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_sys_lang_words', array( 'word_custom' => $rebuilt ), 'word_id=' . $word['word_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $did;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total content count to be used in progress indicator
|
||||
*
|
||||
* @return int Total Count
|
||||
*/
|
||||
public function contentCount()
|
||||
{
|
||||
return \IPS\Db::i()->select( 'COUNT(*) as count', 'core_sys_lang_words', "word_key LIKE 'blogs_blog_%_desc'" )->first();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Editor Extension: Blog Entries
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\EditorLocations;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Editor Extension: Blogs
|
||||
*/
|
||||
class _Entries
|
||||
{
|
||||
/**
|
||||
* Can we use HTML in this editor?
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
|
||||
*/
|
||||
public function canUseHtml( $member )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we use attachments in this editor?
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param \IPS\Helpers\Form\Editor $field The editor field
|
||||
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
|
||||
*/
|
||||
public function canAttach( $member, $field )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3 )
|
||||
{
|
||||
return \IPS\blog\Entry::load( $id1 )->canView( $member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Attachment lookup
|
||||
*
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @return \IPS\blog\Blog
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function attachmentLookup( $id1, $id2, $id3 )
|
||||
{
|
||||
return \IPS\blog\Entry::load( $id1 );
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief File Storage Extension: Blogs (cover photos)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 16 Jun 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\FileStorage;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* File Storage Extension: Blogs (cover photos)
|
||||
*/
|
||||
class _Blogs
|
||||
{
|
||||
/**
|
||||
* Count stored files
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', 'blog_cover_photo IS NOT NULL' )->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Move stored files
|
||||
*
|
||||
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
|
||||
* @param int $storageConfiguration New storage configuration ID
|
||||
* @param int|NULL $oldConfiguration Old storage configuration ID
|
||||
* @throws \Underflowexception When file record doesn't exist. Indicating there are no more files to move
|
||||
* @return void
|
||||
*/
|
||||
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_blogs', 'blog_cover_photo IS NOT NULL', 'blog_id', array( $offset, 1 ) )->first();
|
||||
|
||||
try
|
||||
{
|
||||
$file = \IPS\File::get( $oldConfiguration ?: 'blog_Blogs', $record['blog_cover_photo'] )->move( $storageConfiguration );
|
||||
|
||||
if ( (string) $file != $record['blog_cover_photo'] )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_blogs', array( 'blog_cover_photo' => (string) $file ), array( 'blog_id=?', $record['blog_id'] ) );
|
||||
}
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
/* Any issues are logged and the \IPS\Db::i()->update not run as the exception is thrown */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix all URLs
|
||||
*
|
||||
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
|
||||
* @return void
|
||||
*/
|
||||
public function fixUrls( $offset )
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_blogs', 'blog_cover_photo IS NOT NULL', 'blog_id', array( $offset, 1 ) )->first();
|
||||
|
||||
if ( $new = \IPS\File::repairUrl( $record['blog_cover_photo'] ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_blogs', array( 'blog_cover_photo' => $new ), array( 'blog_id=?', $record['blog_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a file is valid
|
||||
*
|
||||
* @param \IPS\Http\Url $file The file to check
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidFile( $file )
|
||||
{
|
||||
try
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_blogs', array( 'blog_cover_photo=?', (string) $file ) )->first();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all stored files
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_blogs', 'blog_cover_photo IS NOT NULL' ) as $blog )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\File::get( 'blog_Blogs', $blog['blog_cover_photo'] )->delete();
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief File Storage Extension: Blog Entries (cover photos)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 30 May 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\FileStorage;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* File Storage Extension: Blog Entries (cover photos)
|
||||
*/
|
||||
class _Entries
|
||||
{
|
||||
/**
|
||||
* Count stored files
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return \IPS\Db::i()->select( 'COUNT(*)', 'blog_entries', 'entry_cover_photo IS NOT NULL' )->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Move stored files
|
||||
*
|
||||
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
|
||||
* @param int $storageConfiguration New storage configuration ID
|
||||
* @param int|NULL $oldConfiguration Old storage configuration ID
|
||||
* @throws \Underflowexception When file record doesn't exist. Indicating there are no more files to move
|
||||
* @return void
|
||||
*/
|
||||
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_entries', 'entry_cover_photo IS NOT NULL', 'entry_id', array( $offset, 1 ) )->first();
|
||||
|
||||
try
|
||||
{
|
||||
$file = \IPS\File::get( $oldConfiguration ?: 'blog_Entries', $record['entry_cover_photo'] )->move( $storageConfiguration );
|
||||
|
||||
if ( (string) $file != $record['entry_cover_photo'] )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_cover_photo' => (string) $file ), array( 'entry_id=?', $record['entry_id'] ) );
|
||||
}
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
/* Any issues are logged and the \IPS\Db::i()->update not run as the exception is thrown */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix all URLs
|
||||
*
|
||||
* @param int $offset This will be sent starting with 0, increasing to get all files stored by this extension
|
||||
* @return void
|
||||
*/
|
||||
public function fixUrls( $offset )
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_entries', 'entry_cover_photo IS NOT NULL', 'entry_id', array( $offset, 1 ) )->first();
|
||||
|
||||
if ( $new = \IPS\File::repairUrl( $record['blog_cover_photo'] ) )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'blog_cover_photo' => $new ), array( 'entry_id=?', $record['entry_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a file is valid
|
||||
*
|
||||
* @param \IPS\Http\Url $file The file to check
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidFile( $file )
|
||||
{
|
||||
try
|
||||
{
|
||||
$record = \IPS\Db::i()->select( '*', 'blog_entries', array( 'entry_cover_photo=?', (string) $file ) )->first();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all stored files
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_entries', 'entry_cover_photo IS NOT NULL' ) as $blog )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\File::get( 'blog_Entries', $blog['entry_cover_photo'] )->delete();
|
||||
}
|
||||
catch( \Exception $e ){}
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Front Navigation Extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\FrontNavigation;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Front Navigation Extension: Blogs
|
||||
*/
|
||||
class _Blogs
|
||||
{
|
||||
/**
|
||||
* Can access?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function canView()
|
||||
{
|
||||
return !\IPS\Application::load('blog')->hide_tab and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'blog', 'blogs' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('frontnavigation_blogs');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Link
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
*/
|
||||
public function link()
|
||||
{
|
||||
return \IPS\Http\Url::internal( "app=blog&module=blogs&controller=browse", 'front', 'blogs' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Active?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function active()
|
||||
{
|
||||
return \IPS\Dispatcher::i()->application->directory === 'blog';
|
||||
}
|
||||
|
||||
/**
|
||||
* Children
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Admin CP Group Form
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 11 Jul 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\GroupForm;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin CP Group Form
|
||||
*/
|
||||
class _Blog
|
||||
{
|
||||
/**
|
||||
* Process Form
|
||||
*
|
||||
* @param \IPS\Form\Tabbed $form The form
|
||||
* @param \IPS\Member\Group $group Existing Group
|
||||
* @return void
|
||||
*/
|
||||
public function process( &$form, $group )
|
||||
{
|
||||
if( $group->g_id != \IPS\Settings::i()->guest_group )
|
||||
{
|
||||
$form->add(new \IPS\Helpers\Form\YesNo('g_blog_allowlocal', $group->g_blog_allowlocal, FALSE, array('togglesOn' => array('g_blog_maxblogs', 'g_blog_allowprivate', 'g_blog_preventpublish', 'g_blog_allowownmod', 'g_blog_allowdelete'))));
|
||||
$form->add(new \IPS\Helpers\Form\Number('g_blog_maxblogs', $group->g_blog_maxblogs, FALSE, array('unlimited' => 0), NULL, NULL, NULL, 'g_blog_maxblogs'));
|
||||
$form->add(new \IPS\Helpers\Form\YesNo('g_blog_allowprivate', $group->g_blog_allowprivate, FALSE, array(), NULL, NULL, NULL, 'g_blog_allowprivate'));
|
||||
$form->add(new \IPS\Helpers\Form\YesNo('g_blog_allowownmod', $group->g_blog_allowownmod, FALSE, array(), NULL, NULL, NULL, 'g_blog_allowownmod'));
|
||||
$form->add(new \IPS\Helpers\Form\YesNo('g_blog_allowdelete', $group->g_blog_allowdelete, FALSE, array(), NULL, NULL, NULL, 'g_blog_allowdelete'));
|
||||
$form->add(new \IPS\Helpers\Form\YesNo('g_blog_allowcomment', $group->g_blog_allowcomment));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save
|
||||
*
|
||||
* @param array $values Values from form
|
||||
* @param \IPS\Member\Group $group The group
|
||||
* @return void
|
||||
*/
|
||||
public function save( $values, &$group )
|
||||
{
|
||||
if( $group->g_id != \IPS\Settings::i()->guest_group )
|
||||
{
|
||||
$group->g_blog_allowlocal = $values['g_blog_allowlocal'];
|
||||
$group->g_blog_maxblogs = $values['g_blog_maxblogs'];
|
||||
$group->g_blog_allowprivate = $values['g_blog_allowprivate'];
|
||||
$group->g_blog_allowownmod = $values['g_blog_allowownmod'];
|
||||
$group->g_blog_allowdelete = $values['g_blog_allowdelete'];
|
||||
$group->g_blog_allowcomment = $values['g_blog_allowcomment'];
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief ACP Live Search Extension
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\LiveSearch;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ACP Live Search Extension
|
||||
*/
|
||||
class _Blogs
|
||||
{
|
||||
/**
|
||||
* Check we have access
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function hasAccess()
|
||||
{
|
||||
/* Check Permissions */
|
||||
return \IPS\Member::loggedIn()->hasAcpRestriction( 'blog', 'blog', 'blogs_manage' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the search results
|
||||
*
|
||||
* @param string Search Term
|
||||
* @return array Array of results
|
||||
*/
|
||||
public function getResults( $searchTerm )
|
||||
{
|
||||
/* Init */
|
||||
$results = array();
|
||||
$searchTerm = mb_strtolower( $searchTerm );
|
||||
|
||||
/* Then mix in blogs, but make sure we limit to be safe */
|
||||
if( $this->hasAccess() )
|
||||
{
|
||||
/* Perform the search */
|
||||
$blogs = \IPS\Db::i()->select(
|
||||
"*",
|
||||
'blog_blogs',
|
||||
array( "word_custom LIKE CONCAT( '%', ?, '%' ) AND lang_id=?", $searchTerm, \IPS\Member::loggedIn()->language()->id ),
|
||||
NULL,
|
||||
array( 0, 500 )
|
||||
)->join(
|
||||
'core_sys_lang_words',
|
||||
"word_key=CONCAT( 'blogs_blog_', blog_id )"
|
||||
);
|
||||
|
||||
/* Format results */
|
||||
foreach ( $blogs as $blog )
|
||||
{
|
||||
$blog = \IPS\blog\Blog::constructFromData( $blog );
|
||||
|
||||
$results[] = \IPS\Theme::i()->getTemplate( 'livesearch', 'blog', 'admin' )->blog( $blog );
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Member Sync
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 20 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\MemberSync;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Sync
|
||||
*/
|
||||
class _Blog
|
||||
{
|
||||
/**
|
||||
* Member is merged with another member
|
||||
*
|
||||
* @param \IPS\Member $member Member being kept
|
||||
* @param \IPS\Member $member2 Member being removed
|
||||
* @return void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_blogs', array( 'blog_member_id' => $member->member_id ), array( 'blog_member_id=?', $member2->member_id ) );
|
||||
\IPS\Db::i()->update( 'blog_rss_import', array( 'rss_member' => $member->member_id ), array( 'rss_member=?', $member2->member_id ) );
|
||||
|
||||
foreach( \IPS\blog\Blog::loadByOwner( $member2 ) as $blog )
|
||||
{
|
||||
$blog->member_id = $member->member_id;
|
||||
$blog->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Member is deleted
|
||||
*
|
||||
* @param $member \IPS\Member The member
|
||||
* @return void
|
||||
*/
|
||||
public function onDelete( $member )
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_rss_import', array( 'rss_member' => 0 ), array( 'rss_member=?', $member->member_id ) );
|
||||
|
||||
foreach( \IPS\blog\Blog::loadByOwner( $member ) as $blog )
|
||||
{
|
||||
$blog->member_id = 0;
|
||||
$blog->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Profile extension: Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 02 Apr 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\extensions\core\Profile;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Profile extension: Blogs
|
||||
*/
|
||||
class _Blog
|
||||
{
|
||||
/**
|
||||
* Member
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Member $member Member whose profile we are viewing
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Member $member )
|
||||
{
|
||||
$this->member = $member;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is there content to display?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function showTab()
|
||||
{
|
||||
$where = array(
|
||||
array( '(' . \IPS\Db::i()->findInSet( 'blog_groupblog_ids', $this->member->groups ) . ' OR ' . 'blog_member_id=? )', $this->member->member_id ),
|
||||
array( 'blog_disabled=0' )
|
||||
);
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$where[] = array( '( blog_social_group IS NULL OR blog_member_id=? OR blog_social_group IN(?) )', \IPS\Member::loggedIn()->member_id, \IPS\Db::i()->select( 'group_id', 'core_sys_social_group_members', array( 'member_id=?', \IPS\Member::loggedIn()->member_id ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = array( 'blog_social_group IS NULL' );
|
||||
}
|
||||
|
||||
return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', $where )->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'profile.css', 'blog', 'front' ) );
|
||||
|
||||
$table = new \IPS\blog\Blog\ProfileTable( $this->member->url() );
|
||||
$table->setOwner( $this->member );
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'blog' ), 'profileBlogTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'global', 'blog' ), 'profileBlogRows' );
|
||||
|
||||
return (string) $table;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Group Blogs Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\admin\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* groupBlogs
|
||||
*/
|
||||
class _blogs extends \IPS\Node\Controller
|
||||
{
|
||||
/**
|
||||
* Node Class
|
||||
*/
|
||||
protected $nodeClass = '\IPS\blog\Blog';
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'blogs_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
/* Create the table */
|
||||
$table = new \IPS\Helpers\Table\Db( 'blog_blogs', \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs' ) );
|
||||
$table->langPrefix = 'blog_';
|
||||
|
||||
/* Column stuff */
|
||||
$table->include = array( 'word_custom' );
|
||||
$table->mainColumn = 'word_custom';
|
||||
|
||||
$table->joins = array(
|
||||
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'blogs_blog_', blog_blogs.blog_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
);
|
||||
|
||||
/* Sort stuff */
|
||||
$table->sortBy = $table->sortBy ?: 'word_custom';
|
||||
$table->sortDirection = $table->sortDirection ?: 'asc';
|
||||
|
||||
/* Search */
|
||||
$table->quickSearch = 'word_custom';
|
||||
$table->advancedSearch = array(
|
||||
'word_custom' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
|
||||
'blog_member_id' => \IPS\Helpers\Table\SEARCH_MEMBER,
|
||||
);
|
||||
|
||||
$table->parsers = array(
|
||||
'blog_member_id' => function( $val, $row )
|
||||
{
|
||||
return \IPS\Member::load( $val )->link();
|
||||
}
|
||||
);
|
||||
|
||||
/* Row buttons */
|
||||
$table->rowButtons = function( $row )
|
||||
{
|
||||
$blog = \IPS\blog\Blog::constructFromData( $row );
|
||||
|
||||
return array(
|
||||
'edit' => array(
|
||||
'icon' => 'pencil',
|
||||
'title' => 'edit',
|
||||
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=form&id=' ) . $row['blog_id'],
|
||||
'data' => array(),
|
||||
'hotkey'=> 'e return'
|
||||
),
|
||||
'copy' => array(
|
||||
'icon' => 'files-o',
|
||||
'title' => 'copy',
|
||||
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=copy&id=' ) . $row['blog_id'],
|
||||
'data' => array()
|
||||
),
|
||||
'empty' => array(
|
||||
'icon' => 'trash-o',
|
||||
'title' => 'empty',
|
||||
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=delete&deleteNode=0&id=' ) . $row['blog_id'],
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('empty') ),
|
||||
'hotkey'=> 'd'
|
||||
),
|
||||
'delete' => array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=delete&deleteNode=1&id=' ) . $row['blog_id'],
|
||||
'data' => ( $blog->getContentItemCount() ) ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('delete') ) : array( 'delete' => '' ),
|
||||
'hotkey'=> 'd'
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
/* Root buttons */
|
||||
$table->rootButtons = array(
|
||||
'add' => array(
|
||||
'icon' => 'plus',
|
||||
'title' => 'add_blog',
|
||||
'link' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=blogs&do=form' ),
|
||||
'data' => array()
|
||||
),
|
||||
);
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('blogs');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( 'title', (string) $table );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add/Edit Form
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
parent::form();
|
||||
|
||||
if ( \IPS\Request::i()->id )
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('edit_blog') . ': ' . \IPS\Output::i()->title;
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('add_blog');
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Blog Settings
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\admin\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Blog settings
|
||||
*/
|
||||
class _settings extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'blog_settings_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Blog Settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_enable_rating', \IPS\Settings::i()->blog_enable_rating ) );
|
||||
|
||||
$form->addHeader('blog_settings_rss');
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_allow_rssimport', \IPS\Settings::i()->blog_allow_rssimport ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_allow_rss', \IPS\Settings::i()->blog_allow_rss ) );
|
||||
|
||||
if ( $form->values() )
|
||||
{
|
||||
$form->saveAsSettings();
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__blog_settings' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('settings');
|
||||
\IPS\Output::i()->output = $form;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief All Blogs
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\front\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* browse
|
||||
*/
|
||||
class _browse extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
/* Featured stuff */
|
||||
$featured = iterator_to_array( \IPS\blog\Entry::featured( 5, '_rand' ) );
|
||||
|
||||
/* Blogs table */
|
||||
$table = new \IPS\blog\Blog\Table( \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=browse', 'front', 'blogs' ) );
|
||||
$table->title = 'our_community_blogs';
|
||||
$table->classes = array( 'cBlogList', 'ipsAreaBackground', 'ipsDataList_large' );
|
||||
|
||||
/* Filters */
|
||||
$table->filters = array(
|
||||
'my_blogs' => array( '(' . \IPS\Db::i()->findInSet( 'blog_groupblog_ids', \IPS\Member::loggedIn()->groups ) . ' OR ' . 'blog_member_id=? )', \IPS\Member::loggedIn()->member_id ),
|
||||
'blogs_with_content' => array( 'blog_count_entries>0' )
|
||||
);
|
||||
|
||||
$blogs = \IPS\blog\Blog::loadByOwner( \IPS\Member::loggedIn(), array( array( 'blog_disabled=?', 0 ) ) );
|
||||
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=blog', 'front', 'blogs' ), array(), 'loc_blog_viewing_index' );
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_browse.js', 'blog', 'front' ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('blogs');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->index( $table, $featured, $blogs );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Create Blog
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 24 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\front\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Blog
|
||||
*/
|
||||
class _create extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
if ( !\IPS\blog\Blog::canCreate() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B227/1', 403, '' );
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'select_blog', 'continue' );
|
||||
$form->class = 'ipsForm_vertical';
|
||||
|
||||
$blog = new \IPS\blog\Blog;
|
||||
$blog->member_id = \IPS\Member::loggedIn()->member_id;
|
||||
$blog->form( $form, TRUE );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$blog->saveForm( $blog->formatFormValues( $values ) );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( $blog->url() );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->setLocation( \IPS\Http\Url::internal( 'app=blog', 'front', 'blogs' ), array(), 'loc_blog_creating' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('create_blog');
|
||||
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->createBlog( $form );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief View Blog Entry Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\front\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* View Blog Entry Controller
|
||||
*/
|
||||
class _entry extends \IPS\Content\Controller
|
||||
{
|
||||
/**
|
||||
* [Content\Controller] Class
|
||||
*/
|
||||
protected static $contentModel = 'IPS\blog\Entry';
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->entry = \IPS\blog\Entry::load( \IPS\Request::i()->id );
|
||||
|
||||
if ( !$this->entry->canView( \IPS\Member::loggedIn() ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B202/1', 403, '' );
|
||||
}
|
||||
|
||||
if ( $this->entry->cover_photo )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:image'] = $this->entry->cover_photo;
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
if ( !isset( \IPS\Request::i()->do ) or \IPS\Request::i()->do !== 'embed' )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B202/2', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
parent::manage();
|
||||
|
||||
$previous = NULL;
|
||||
$next = NULL;
|
||||
|
||||
/* Prev */
|
||||
try
|
||||
{
|
||||
$previous = \IPS\Db::i()->select(
|
||||
'*',
|
||||
'blog_entries',
|
||||
array( 'entry_blog_id=? AND entry_date<?', $this->entry->blog_id, $this->entry->date ),
|
||||
'entry_date DESC'
|
||||
,1
|
||||
)->first();
|
||||
|
||||
$previous = \IPS\blog\Entry::constructFromData( $previous );
|
||||
}
|
||||
catch ( \UnderflowException $e ) {}
|
||||
|
||||
/* Next */
|
||||
try
|
||||
{
|
||||
$next = \IPS\Db::i()->select(
|
||||
'*',
|
||||
'blog_entries',
|
||||
array( 'entry_blog_id=? AND entry_date>?', $this->entry->blog_id, $this->entry->date ),
|
||||
'entry_date ASC'
|
||||
,1
|
||||
)->first();
|
||||
|
||||
$next = \IPS\blog\Entry::constructFromData( $next );
|
||||
}
|
||||
catch ( \UnderflowException $e ) {}
|
||||
|
||||
/* Online User Location */
|
||||
\IPS\Session::i()->setLocation( $this->entry->url(), $this->entry->onlineListPermissions(), 'loc_blog_viewing_entry', array( $this->entry->name => FALSE ) );
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'view' )->entry( $this->entry, $previous, $next );
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Submit
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 10 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\front\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit
|
||||
*/
|
||||
class _submit extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\blog\Entry::canCreate( \IPS\Member::loggedIn(), NULL, TRUE );
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'submit_entry' );
|
||||
|
||||
/* Load Blog */
|
||||
try
|
||||
{
|
||||
/* Can we add to this Blog? */
|
||||
$blog = \IPS\blog\Blog::load( \IPS\Request::i()->id );
|
||||
\IPS\blog\Entry::canCreate( \IPS\Member::loggedIn(), $blog, TRUE );
|
||||
|
||||
$form = \IPS\blog\Entry::create( $blog );
|
||||
$formTemplate = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'submit', 'blog' ) ), 'submitFormTemplate' ) );
|
||||
|
||||
\IPS\Session::i()->setLocation( $blog->url(), array(), 'loc_blog_adding_entry', array( "blogs_blog_{$blog->id}" => TRUE ) );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $blog->url(), $blog->_title );
|
||||
\IPS\Output::i()->sidebar['enabled'] = FALSE;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->submit( $formTemplate );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form( 'select_blog', 'continue' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'blog_select', NULL, TRUE, array(
|
||||
'url' => \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=submit', 'front', 'blog_submit' ),
|
||||
'class' => 'IPS\blog\Blog',
|
||||
'permissionCheck' => 'add',
|
||||
'forceOwner' => \IPS\Member::loggedIn(),
|
||||
) ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=submit', 'front', 'blog_submit' )->setQueryString( 'id', $values['blog_select']->_id );
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'submit' )->blogSelector( $form );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief View Blog Entry Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\modules\front\blogs;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* View Blog Entry Controller
|
||||
*/
|
||||
class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* [Content\Controller] Class
|
||||
*/
|
||||
protected static $contentModel = 'IPS\blog\Blog';
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
/* Load blog and check permissions */
|
||||
try
|
||||
{
|
||||
$this->blog = \IPS\blog\Blog::loadAndCheckPerms( \IPS\Request::i()->id, 'read' );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2B201/1', 404, '' );
|
||||
}
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
/* Build table */
|
||||
$where = array();
|
||||
if ( !in_array( $this->blog->id, array_keys( \IPS\blog\Blog::loadByOwner( \IPS\Member::loggedIn() ) ) ) )
|
||||
{
|
||||
$where[] = array( "entry_status!='draft'" );
|
||||
}
|
||||
|
||||
$table = new \IPS\Helpers\Table\Content( 'IPS\blog\Entry', $this->blog->url(), $where, $this->blog );
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'view' ), 'blogTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'view' ), 'rows' );
|
||||
$table->title = \IPS\Member::loggedIn()->language()->addToStack('entries_in_this_blog');
|
||||
$table->sortBy = \IPS\Request::i()->sortby ?: 'date';
|
||||
|
||||
/* Update views */
|
||||
\IPS\Db::i()->update(
|
||||
'blog_blogs',
|
||||
"`blog_num_views`=`blog_num_views`+1",
|
||||
array( "blog_id=?", $this->blog->id ),
|
||||
array(),
|
||||
NULL,
|
||||
\IPS\Db::LOW_PRIORITY
|
||||
);
|
||||
|
||||
/* Online User Location */
|
||||
\IPS\Session::i()->setLocation( $this->blog->url(), array(), 'loc_blog_viewing_blog', array( "blogs_blog_{$this->blog->id}" => TRUE ) );
|
||||
|
||||
/* Output */
|
||||
\IPS\Output::i()->title = $this->blog->_title;
|
||||
|
||||
if( \IPS\Settings::i()->blog_allow_rss and $this->blog->settings['allowrss'] )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds['blog_rss_title'] = \IPS\Http\Url::internal( "app=blog&module=blogs&controller=view&id={$this->blog->_id}", 'front', 'blogs_rss', array( $this->blog->seo_name ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_browse.js', 'blog', 'front' ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'view' )->view( $this->blog, (string) $table );
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( 'blog' ) ) ) ) ] = array( 'type' => 'blog_entry', 'nodes' => $this->blog->_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit blog
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function editBlog()
|
||||
{
|
||||
if( !$this->blog->canEdit() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/2', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Build form */
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->class .= 'ipsForm_vertical';
|
||||
|
||||
$this->blog->form( $form, TRUE );
|
||||
|
||||
/* Handle submissions */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if( !$values['blog_name'] )
|
||||
{
|
||||
$form->elements['']['blog_name']->error = \IPS\Member::loggedIn()->language()->addToStack('form_required');
|
||||
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->blog->saveForm( $this->blog->formatFormValues( $values ) );
|
||||
|
||||
\IPS\Output::i()->redirect( $this->blog->url() );
|
||||
}
|
||||
|
||||
/* Display form */
|
||||
\IPS\Output::i()->title = $this->blog->_title;
|
||||
\IPS\Output::i()->breadcrumb[] = array( $this->blog->url(), $this->blog->_title );
|
||||
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Blog
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function deleteBlog()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
if( !$this->blog->canDelete() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/3', 403, '' );
|
||||
}
|
||||
|
||||
$this->blog->disabled = TRUE;
|
||||
$this->blog->save();
|
||||
|
||||
\IPS\Task::queue( 'core', 'DeleteOrMoveContent', array( 'class' => 'IPS\blog\Blog', 'id' => $this->blog->id, 'deleteWhenDone' => TRUE ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=blog&module=blogs&controller=browse', 'front', 'blogs' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Pin/Unpin Blog
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function changePin()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Do we have permission */
|
||||
if ( ( $this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_unpin_content') ) or ( !$this->blog->pinned and !\IPS\Member::loggedIn()->modPermission('can_pin_content') ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/4', 403, '' );
|
||||
}
|
||||
|
||||
$this->blog->pinned = $this->blog->pinned ? FALSE : TRUE;
|
||||
$this->blog->save();
|
||||
|
||||
/* Respond or redirect */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( 'OK' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $this->blog->url() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RSS feed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function rss()
|
||||
{
|
||||
if( !\IPS\Settings::i()->blog_allow_rss or !$this->blog->settings['allowrss'] )
|
||||
{
|
||||
\IPS\Output::i()->error( 'blog_rss_offline', '2B201/5', 403, 'blog_rss_offline_admin' );
|
||||
}
|
||||
|
||||
$document = \IPS\Xml\Rss::newDocument( $this->blog->url(), \IPS\Member::loggedIn()->language()->get("blogs_blog_{$this->blog->id}"), \IPS\Member::loggedIn()->language()->get("blogs_blog_{$this->blog->id}_desc") );
|
||||
|
||||
foreach ( \IPS\blog\Entry::getItemsWithPermission( array( array( 'entry_blog_id=?', $this->blog->id ), array( 'entry_status!=?', 'draft' ) ), 'entry_date DESC', 25, 'read', FALSE, 0, new \IPS\Member ) as $entry )
|
||||
{
|
||||
$document->addItem( $entry->name, $entry->url(), $entry->content, \IPS\DateTime::ts( $entry->date ), $entry->id );
|
||||
}
|
||||
|
||||
/* @note application/rss+xml is not a registered IANA mime-type so we need to stick with text/xml for RSS */
|
||||
\IPS\Output::i()->sendOutput( $document->asXML(), 200, 'text/xml' );
|
||||
}
|
||||
|
||||
/**
|
||||
* RSS imports
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function rssImport()
|
||||
{
|
||||
if( !\IPS\Settings::i()->blog_allow_rssimport )
|
||||
{
|
||||
\IPS\Output::i()->error( 'rss_import_disabled', '2B201/7', 403, '' );
|
||||
}
|
||||
|
||||
if( !$this->blog->canEdit() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission', '2B201/6', 403, '' );
|
||||
}
|
||||
|
||||
/* Check for existing feed */
|
||||
try
|
||||
{
|
||||
$existing = \IPS\Db::i()->select( '*', 'blog_rss_import', array( 'rss_blog_id=?', $this->blog->id ) )->first();
|
||||
$feed = \IPS\blog\Blog\Feed::constructFromData( $existing );
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
$feed = new \IPS\blog\Blog\Feed;
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'blog_enable_rss_import', $feed->url ? TRUE : FALSE, FALSE, array( 'togglesOn' => array( 'blog_rss_import_url', 'blog_rss_import_auth_user', 'blog_rss_import_auth_pass', 'blog_rss_import_show_link', 'blog_rss_import_tags' ) ) ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'blog_rss_import_url', $feed ? $feed->url : NULL, TRUE, array(), NULL, NULL, NULL, 'blog_rss_import_url' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_user', $feed ? $feed->rss_auth_user : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_user' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_auth_pass', $feed ? $feed->rss_auth_pass : NULL, FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_auth_pass' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_show_link', $feed->rss_import_show_link ?: \IPS\Member::loggedIn()->language()->addToStack('blog_rss_import_show_link_default' ), FALSE, array(), NULL, NULL, NULL, 'blog_rss_import_show_link' ) );
|
||||
|
||||
$options = array( 'autocomplete' => array( 'unique' => TRUE, 'source' => \IPS\Content\Item::definedTags( $this->blog ), 'freeChoice' => ( \IPS\Settings::i()->tags_open_system ? TRUE : FALSE ) ) );
|
||||
if ( \IPS\Settings::i()->tags_force_lower )
|
||||
{
|
||||
$options['autocomplete']['forceLower'] = TRUE;
|
||||
}
|
||||
if ( \IPS\Settings::i()->tags_min )
|
||||
{
|
||||
$options['autocomplete']['minItems'] = \IPS\Settings::i()->tags_min;
|
||||
}
|
||||
if ( \IPS\Settings::i()->tags_max )
|
||||
{
|
||||
$options['autocomplete']['maxItems'] = \IPS\Settings::i()->tags_max;
|
||||
}
|
||||
if ( \IPS\Settings::i()->tags_len_min )
|
||||
{
|
||||
$options['autocomplete']['minLength'] = \IPS\Settings::i()->tags_len_min;
|
||||
}
|
||||
if ( \IPS\Settings::i()->tags_len_max )
|
||||
{
|
||||
$options['autocomplete']['maxLength'] = \IPS\Settings::i()->tags_len_max;
|
||||
}
|
||||
if ( \IPS\Settings::i()->tags_clean )
|
||||
{
|
||||
$options['autocomplete']['filterProfanity'] = TRUE;
|
||||
}
|
||||
|
||||
$options['autocomplete']['prefix'] = \IPS\Content\Item::canPrefix( NULL, $this->blog );
|
||||
|
||||
/* Language strings for tags description */
|
||||
if ( \IPS\Settings::i()->tags_open_system )
|
||||
{
|
||||
$extralang = array();
|
||||
|
||||
if ( \IPS\Settings::i()->tags_min && \IPS\Settings::i()->tags_max )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_min_max', FALSE, array( 'sprintf' => array( \IPS\Settings::i()->tags_max ), 'pluralize' => array( \IPS\Settings::i()->tags_min ) ) );
|
||||
}
|
||||
else if( \IPS\Settings::i()->tags_min )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_min', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->tags_min ) ) );
|
||||
}
|
||||
else if( \IPS\Settings::i()->tags_min )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_max', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->tags_max ) ) );
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->tags_len_min && \IPS\Settings::i()->tags_len_max )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_len_min_max', FALSE, array( 'sprintf' => array( \IPS\Settings::i()->tags_len_min, \IPS\Settings::i()->tags_len_max ) ) );
|
||||
}
|
||||
else if( \IPS\Settings::i()->tags_len_min )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_len_min', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->tags_len_min ) ) );
|
||||
}
|
||||
else if( \IPS\Settings::i()->tags_len_max )
|
||||
{
|
||||
$extralang[] = \IPS\Member::loggedIn()->language()->addToStack( 'tags_desc_len_max', FALSE, array( 'sprintf' => array( \IPS\Settings::i()->tags_len_max ) ) );
|
||||
}
|
||||
|
||||
$options['autocomplete']['desc'] = \IPS\Member::loggedIn()->language()->addToStack('tags_desc') . ( ( count( $extralang ) ) ? '<br>' . implode( $extralang, ' ' ) : '' );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'blog_rss_import_tags', $feed ? json_decode( $feed->tags, TRUE ) : array(), \IPS\Settings::i()->tags_min and \IPS\Settings::i()->tags_min_req, $options, NULL, NULL, NULL, 'blog_rss_import_tags' ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if( $values['blog_enable_rss_import'] )
|
||||
{
|
||||
try
|
||||
{
|
||||
$request = $values['blog_rss_import_url']->request();
|
||||
|
||||
if ( $values['blog_rss_import_auth_user'] or $values['blog_rss_import_auth_pass'] )
|
||||
{
|
||||
$request = $request->login( $values['blog_rss_import_auth_user'], $values['blog_rss_import_auth_pass'] );
|
||||
}
|
||||
|
||||
$response = $request->get();
|
||||
|
||||
if ( $response->httpResponseCode == 401 )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'rss_import_auth' );
|
||||
}
|
||||
|
||||
$response = $response->decodeXml();
|
||||
if ( !( $response instanceof \IPS\Xml\Rss ) and !( $response instanceof \IPS\Xml\Atom ) )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'rss_import_invalid' );
|
||||
}
|
||||
|
||||
if( !$form->error )
|
||||
{
|
||||
$feed->blog_id = $this->blog->id;
|
||||
$feed->url = $values['blog_rss_import_url'];
|
||||
$feed->import_show_link = $values['blog_rss_import_show_link'];
|
||||
$feed->auth_user = $values['blog_rss_import_auth_user'];
|
||||
$feed->auth_pass = $values['blog_rss_import_auth_pass'];
|
||||
$feed->tags = json_encode( $values['blog_rss_import_tags'] );
|
||||
$feed->member = $this->blog->owner() ? $this->blog->owner()->member_id : \IPS\Member::loggedIn()->member_id;
|
||||
|
||||
$feed->save();
|
||||
$feed->run();
|
||||
|
||||
\IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'blogrssimport' ) );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( $this->blog->url() );
|
||||
}
|
||||
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'form_url_bad' );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$form->error = \IPS\Member::loggedIn()->language()->addToStack( 'rss_import_invalid' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Db::i()->delete( 'blog_rss_import', array( 'rss_blog_id=?', $this->blog->id ) );
|
||||
|
||||
/* Redirect */
|
||||
\IPS\Output::i()->redirect( $this->blog->url() );
|
||||
}
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->output = $form->error ? $form : \IPS\Theme::i()->getTemplate( 'view', 'blog', 'front' )->rssImport( $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cover Photo Storage Extension
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _coverPhotoStorageExtension()
|
||||
{
|
||||
return 'blog_Blogs';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cover Photo
|
||||
*
|
||||
* @param \IPS\Helpers\CoverPhoto $photo New Photo
|
||||
* @return void
|
||||
*/
|
||||
protected function _coverPhotoSet( \IPS\Helpers\CoverPhoto $photo )
|
||||
{
|
||||
$this->blog->cover_photo = (string) $photo->file;
|
||||
$this->blog->cover_photo_offset = $photo->offset;
|
||||
$this->blog->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cover Photo
|
||||
*
|
||||
* @return \IPS\Helpers\CoverPhoto
|
||||
*/
|
||||
protected function _coverPhotoGet()
|
||||
{
|
||||
return $this->blog->coverPhoto();
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_allowlocal",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can create blogs?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_maxblogs",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Maximum number of blogs",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_allowprivate",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can create private blogs?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_allowownmod",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can moderate own blogs?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_allowdelete",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can delete own blogs?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_groups",
|
||||
{
|
||||
"name": "g_blog_allowcomment",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"null": false,
|
||||
"default": 0,
|
||||
"comment": "Can comment on blogs?",
|
||||
"unsigned": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_name_seo",
|
||||
{
|
||||
"allow_null": true,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": null,
|
||||
"length": 255,
|
||||
"name": "entry_name_seo",
|
||||
"type": "VARCHAR",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 30 Oct 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100002;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix SEO titles
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\Db::i()->update( 'blog_blogs', array( 'blog_seo_name' => NULL ) );
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_name_seo' => NULL ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Resetting blog friendly URL titles";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix Polls
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step2()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? intval( \IPS\Request::i()->extra ) : 0;
|
||||
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_polls', NULL, 'poll_id ASC', array( $limit, 1000 ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
foreach ( $select as $poll )
|
||||
{
|
||||
/* Sometimes data from 3.4.x isn't always as well formed as we'd like, especially when non-latin chars are involved */
|
||||
$data = unserialize( $poll['choices'] );
|
||||
|
||||
if( !is_array( $data ) )
|
||||
{
|
||||
$poll['choices'] = str_replace( '\\"', '"', $poll['choices'] );
|
||||
$data = unserialize( $poll['choices'] );
|
||||
}
|
||||
|
||||
$_decoded = FALSE;
|
||||
|
||||
if( !is_array( $data ) )
|
||||
{
|
||||
$data = unserialize( utf8_decode( $poll['choices'] ) );
|
||||
|
||||
if( is_array( $data ) )
|
||||
{
|
||||
$_decoded = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if( is_array( $data ) AND $_decoded )
|
||||
{
|
||||
foreach( $data as $_key => $_data )
|
||||
{
|
||||
$data[ $_key ]['question'] = utf8_encode( $_data[ $_key ]['question'] );
|
||||
|
||||
if( is_array( $_data['choice'] ) )
|
||||
{
|
||||
foreach( $_data['choice'] as $_idx => $_choice )
|
||||
{
|
||||
$data[ $_key ]['choice'][ $_idx ] = utf8_encode( $_choice );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = @json_encode( $data );
|
||||
|
||||
/* @link http://community.invisionpower.com/4bugtrack/beta-8-json_encode-invalid-utf-8-sequence-in-argument-during-upgrade-from-347-r2636/
|
||||
Sometimes the array unserializes fine but there are still "bad" characters in there */
|
||||
if( $result === FALSE )
|
||||
{
|
||||
$data = unserialize( $poll['choices'] );
|
||||
|
||||
if( !is_array( $data ) )
|
||||
{
|
||||
$poll['choices'] = str_replace( '\\"', '"', $poll['choices'] );
|
||||
$data = unserialize( $poll['choices'] );
|
||||
}
|
||||
|
||||
if( !is_array( $data ) )
|
||||
{
|
||||
$data = unserialize( utf8_decode( $poll['choices'] ) );
|
||||
}
|
||||
|
||||
if( is_array( $data ) )
|
||||
{
|
||||
foreach( $data as $_key => $_data )
|
||||
{
|
||||
$data[ $_key ]['question'] = utf8_encode( $_data['question'] );
|
||||
|
||||
if( is_array( $_data['choice'] ) )
|
||||
{
|
||||
foreach( $_data['choice'] as $_idx => $_choice )
|
||||
{
|
||||
$data[ $_key ]['choice'][ $_idx ] = utf8_encode( $_choice );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No choices, no poll */
|
||||
\IPS\Db::i()->delete( 'core_polls', array( 'pid=?', $poll['pid'] ) );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = @json_encode( $data );
|
||||
}
|
||||
|
||||
unset( $poll['poll_id'] );
|
||||
$poll['choices'] = $result;
|
||||
$poll['tid'] = 0;
|
||||
$poll['forum_id'] = 0;
|
||||
$poll['poll_only'] = 0;
|
||||
$poll['poll_view_voters'] = 0;
|
||||
|
||||
$entryId = $poll['entry_id'];
|
||||
unset( $poll['entry_id'] );
|
||||
|
||||
$pollId = \IPS\Db::i()->insert( 'core_polls', $poll );
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_poll_state' => $pollId ), array( 'entry_id=?', $entryId ) );
|
||||
}
|
||||
|
||||
return $limit + 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Upgrading polls...";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix Voters
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step3()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? intval( \IPS\Request::i()->extra ) : 0;
|
||||
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_voters', NULL, 'vote_id ASC', array( $limit, 1000 ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
foreach ( $select as $vote )
|
||||
{
|
||||
try
|
||||
{
|
||||
$pollId = \IPS\Db::i()->select( 'entry_poll_state', 'blog_entries', array( 'entry_id=?', $vote['entry_id'] ) )->first();
|
||||
|
||||
unset( $vote['vote_id'] );
|
||||
unset( $vote['entry_id'] );
|
||||
$vote['member_choices'] = null;
|
||||
$vote['poll'] = $pollId;
|
||||
|
||||
\IPS\Db::i()->insert( 'core_voters', $vote );
|
||||
}
|
||||
catch( \UnderflowException $ex ) { }
|
||||
}
|
||||
|
||||
return $limit + 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Upgrading polls...";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,205 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
"comment_text"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_name"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "dropIndex",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_content"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_akismet_logs",
|
||||
true
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_bookmarks",
|
||||
true
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_categories",
|
||||
true
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_category_mapping",
|
||||
true
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_cblock_cache",
|
||||
true
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_cblocks",
|
||||
true
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_custom_cblocks",
|
||||
true
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_default_cblocks",
|
||||
true
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_editors_map",
|
||||
true
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_lastinfo",
|
||||
true
|
||||
]
|
||||
},
|
||||
"14": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_mediatag",
|
||||
true
|
||||
]
|
||||
},
|
||||
"15": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_moderators",
|
||||
true
|
||||
]
|
||||
},
|
||||
"16": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_pingservices",
|
||||
true
|
||||
]
|
||||
},
|
||||
"17": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_polls",
|
||||
true
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_ratings",
|
||||
true
|
||||
]
|
||||
},
|
||||
"19": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_rsscache",
|
||||
true
|
||||
]
|
||||
},
|
||||
"20": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_themes",
|
||||
true
|
||||
]
|
||||
},
|
||||
"21": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_this",
|
||||
true
|
||||
]
|
||||
},
|
||||
"22": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_trackback",
|
||||
true
|
||||
]
|
||||
},
|
||||
"23": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_trackback_spamlogs",
|
||||
true
|
||||
]
|
||||
},
|
||||
"24": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_tracker",
|
||||
true
|
||||
]
|
||||
},
|
||||
"25": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_tracker_queue",
|
||||
true
|
||||
]
|
||||
},
|
||||
"26": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_updatepings",
|
||||
true
|
||||
]
|
||||
},
|
||||
"27": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_upgrade_history",
|
||||
true
|
||||
]
|
||||
},
|
||||
"28": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_views",
|
||||
true
|
||||
]
|
||||
},
|
||||
"29": {
|
||||
"method": "dropTable",
|
||||
"params": [
|
||||
"blog_voters",
|
||||
true
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 15 Jan 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100015;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 RC 2 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Finish - This is run after all apps have been upgraded
|
||||
*
|
||||
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildItems', array( 'class' => 'IPS\blog\Entry' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\blog\Entry', 'count' => 0 ), 4, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\blog\Blog', 'count' => 0 ), 5, array( 'class' ) );
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 24 Feb 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100016;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Convert RSS tags
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( 'rss_id, rss_tags', 'blog_rss_import' ) as $feed )
|
||||
{
|
||||
$update = array();
|
||||
if( @unserialize( $feed['rss_tags'] ) !== FALSE )
|
||||
{
|
||||
$update['rss_tags'] = json_encode( unserialize( $feed['rss_tags'] ) );
|
||||
\IPS\Db::i()->update( 'blog_rss_import', $update, array( 'rss_id=?', $feed['rss_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Converting RSS feeds";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 RC 5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100018;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 RC 5 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Make sure all theme settings are applied to every theme.
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\blog\Entry' ), 4 );
|
||||
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\blog\Entry\Comment' ), 4 );
|
||||
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\blog\Blog', 'count' => 0 ), 5, array( 'class' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
"entry_poll_state",
|
||||
{
|
||||
"name": "entry_poll_state",
|
||||
"type": "INT",
|
||||
"length": 8,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "ip_lookup",
|
||||
"columns": [
|
||||
"comment_ip_address"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "ip_lookup",
|
||||
"columns": [
|
||||
"entry_ip_address"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"blog_comments",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "comment_approved",
|
||||
"columns": [
|
||||
"comment_approved"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 15 Mar 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100021;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Convert blog view levels
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
/* Some init */
|
||||
$did = 0;
|
||||
$limit = 0;
|
||||
|
||||
if( isset( \IPS\Request::i()->extra ) )
|
||||
{
|
||||
$limit = \IPS\Request::i()->extra;
|
||||
}
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'blog_blogs', "blog_view_level IN('private','friends','privateclub')", 'blog_id ASC', array( $limit, 50 ) ) as $blog )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
$blog = \IPS\blog\Blog::constructFromData( $blog );
|
||||
|
||||
/* Figure out type of blog and act accordingly */
|
||||
switch( $blog->view_level )
|
||||
{
|
||||
case 'private':
|
||||
$group = \IPS\Db::i()->insert( 'core_sys_social_groups', array( 'owner_id' => $blog->member_id ) );
|
||||
\IPS\Db::i()->insert( 'core_sys_social_group_members', array( 'group_id' => $group, 'member_id' => $blog->member_id ) );
|
||||
|
||||
$blog->social_group = $group;
|
||||
break;
|
||||
|
||||
case 'friends':
|
||||
case 'privateclub':
|
||||
$group = \IPS\Db::i()->insert( 'core_sys_social_groups', array( 'owner_id' => $blog->member_id ) );
|
||||
|
||||
if( $blog->authorized_users )
|
||||
{
|
||||
$users = explode( ',', trim( $blog->authorized_users, ',' ) );
|
||||
|
||||
foreach( $users as $user )
|
||||
{
|
||||
\IPS\Db::i()->replace( 'core_sys_social_group_members', array( 'group_id' => $group, 'member_id' => $user ) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->replace( 'core_sys_social_group_members', array( 'group_id' => $group, 'member_id' => $blog->member_id ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_sys_social_group_members', array( 'group_id' => $group, 'member_id' => $blog->member_id ) );
|
||||
}
|
||||
|
||||
$blog->social_group = $group;
|
||||
break;
|
||||
}
|
||||
|
||||
$blog->save();
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return $limit + $did;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'blog_blogs', "blog_view_level IN('private','friends','privateclub')" )->first();
|
||||
}
|
||||
|
||||
return "Upgrading blogs (Updated so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"blog_entries",
|
||||
{
|
||||
"name": "entry_hidden_comments",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.4 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100027;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.4 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Convert entry images
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? intval( \IPS\Request::i()->extra ) : 0;
|
||||
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', "entry_image<>''", 'entry_id ASC', array( $limit, 1000 ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
foreach ( $select as $entry )
|
||||
{
|
||||
try
|
||||
{
|
||||
$filePath = \IPS\ROOT_PATH . '/uploads/' . $entry['entry_image'];
|
||||
|
||||
$file = \IPS\File::create( 'core_Attachment', $entry['entry_image'], NULL, NULL, FALSE, $filePath );
|
||||
$attachment = $file->makeAttachment('');
|
||||
$fileName = htmlentities( $attachment['attach_file'], \IPS\HTMLENTITIES, 'UTF-8', TRUE );
|
||||
|
||||
$image = <<<IMAGE
|
||||
<a href="<fileStore.core_Attachment>/{$file}" class="ipsAttachLink ipsAttachLink_image" style="float:left;"><img data-fileid="{$attachment['attach_id']}" src="<fileStore.core_Attachment>/{$file}" class="ipsImage ipsImage_thumbnailed" style="margin:10px;" alt="{$fileName}"></a>
|
||||
IMAGE;
|
||||
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_content' => $image . $entry['entry_content'] ), array( 'entry_id=?', $entry['entry_id'] ) );
|
||||
|
||||
$map = array(
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'blog_Entries',
|
||||
'id1' => $entry['entry_id'],
|
||||
'id2' => NULL,
|
||||
'id3' => NULL,
|
||||
'temp' => NULL,
|
||||
);
|
||||
|
||||
\IPS\Db::i()->replace( 'core_attachments_map', $map );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
|
||||
return $limit + 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Converting entry images";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.5 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 5 May 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100028;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.5 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Make sure all theme settings are applied to every theme.
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::repairFileUrls('blog');
|
||||
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\blog\Entry' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\blog\Entry\Comment' ), 3, array( 'class' ) );
|
||||
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'blog_Blogs' ), 3, array( 'extension' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.9 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 19 Jun 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100035;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.9 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Update widgets
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
$areas = array( 'core_widget_areas' );
|
||||
if ( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
$areas[] = 'cms_page_widget_areas';
|
||||
}
|
||||
|
||||
foreach ( $areas as $table )
|
||||
{
|
||||
foreach ( \IPS\Db::i()->select( '*', $table ) as $area )
|
||||
{
|
||||
$widgetsColumn = $table == 'core_widget_areas' ? 'widgets' : 'area_widgets';
|
||||
$whereClause = $table == 'core_widget_areas' ? array( 'id=? AND area=?', $area['id'], $area['area'] ) : array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] );
|
||||
|
||||
$widgets = json_decode( $area[ $widgetsColumn ], TRUE );
|
||||
$update = FALSE;
|
||||
|
||||
foreach ( $widgets as $k => $widget )
|
||||
{
|
||||
if ( $widget['key'] == 'recentEntries' )
|
||||
{
|
||||
$widgets[ $k ]['key'] = 'entryFeed';
|
||||
if ( isset( $widgets[ $k ]['configuration']['number_to_show'] ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_show'] = $widgets[ $k ]['configuration']['number_to_show'];
|
||||
unset( $widgets[ $k ]['configuration']['number_to_show'] );
|
||||
}
|
||||
|
||||
$update = TRUE;
|
||||
}
|
||||
|
||||
if ( $update )
|
||||
{
|
||||
\IPS\Db::i()->update( $table, array( $widgetsColumn => json_encode( $widgets ) ), $whereClause );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_widgets",
|
||||
[
|
||||
"app=? AND `key`=?",
|
||||
"blog",
|
||||
"recentEntries"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.10 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blogs
|
||||
* @since 07 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_100038;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.10 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* ...
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
if ( !\IPS\Db::i()->checkForColumn( 'blog_entries', 'entry_is_future_entry' ) )
|
||||
{
|
||||
\IPS\Db::i()->addColumn( 'blog_entries', array(
|
||||
'name' => 'entry_is_future_entry',
|
||||
'type' => "TINYINT",
|
||||
'length' => 1,
|
||||
'allow_null' => false,
|
||||
'default' => "0",
|
||||
'comment' => "Flag to show if an entry is set to be published in the future via the task",
|
||||
'unsigned' => true,
|
||||
) );
|
||||
|
||||
\IPS\Db::i()->update( 'blog_entries', array( 'entry_is_future_entry' => 1 ), array( "entry_date>? AND entry_status=?", time(), 'draft' ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// You can create as many additional methods (step2, step3, etc.) as is necessary.
|
||||
// Each step will be executed in a new HTTP request
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN('blog_use_friendlyurls', 'blog_friendly_url', 'blog_friendlyurl_path', 'blog_boardindex_path');";
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_22000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 22000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_lastinfo CHANGE blog_tag_cloud blog_tag_cloud MEDIUMTEXT;";
|
||||
$SQL[] = "UPDATE blog_lastinfo SET blog_tag_cloud='';";
|
||||
|
||||
if( ! \IPS\Db::i()->checkForColumn( 'blog_themes', 'theme_css_overwrite' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_themes ADD theme_css_overwrite TINYINT( 1 ) NOT NULL DEFAULT '0';";
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_22002;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 22002 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
// Add comment_approved for new comments functionality:
|
||||
$SQL[] = "ALTER TABLE blog_comments ADD comment_approved INT(1) DEFAULT '0'";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 1 WHERE comment_queued = 0";
|
||||
$SQL[] = "UPDATE blog_comments SET comment_approved = 0 WHERE comment_queued = 1";
|
||||
|
||||
// Get DB prefix:
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
|
||||
// Convert tracker to like:
|
||||
if ( \IPS\Db::i()->checkForTable('blog_tracker') )
|
||||
{
|
||||
if( \IPS\Db::i()->checkForTable('core_like') )
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), MD5(CONCAT('blog;blog;', blog_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_like` (like_id, like_lookup_id, like_app, like_area, like_rel_id, like_member_id, like_is_anon, like_added, like_notify_do, like_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), MD5(CONCAT('blog;entries;', entry_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;blog;', blog_id, ';', member_id)), 'blog', 'blog', blog_id, member_id, 0, UNIX_TIMESTAMP(), 1, 'immediate' FROM `{$PRE}blog_tracker`";
|
||||
|
||||
$SQL[] = "INSERT IGNORE INTO `{$PRE}core_follow` (follow_id, follow_app, follow_area, follow_rel_id, follow_member_id, follow_is_anon, follow_added, follow_notify_do, follow_notify_freq) SELECT MD5(CONCAT('blog;entries;', entry_id, ';', member_id)), 'blog', 'entries', entry_id, member_id, 0, UNIX_TIMESTAMP(), 1,'immediate' FROM `{$PRE}blog_tracker` WHERE entry_id <> 0 AND entry_id IS NOT NULL";
|
||||
}
|
||||
|
||||
$SQL[] = "DROP TABLE blog_tracker";
|
||||
$SQL[] = "DROP TABLE blog_tracker_queue";
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_23000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 23000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// Add indexs on blog_views
|
||||
$SQL[] = "ALTER TABLE blog_views ADD INDEX ( blog_id );";
|
||||
|
||||
// Remove unused settings
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key='blog_exturl_newwindow';";
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_23002;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 23002 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/* Get DB functions/prefix */
|
||||
$PRE = \IPS\Db::i()->prefix;
|
||||
$DB = \IPS\Db::i();
|
||||
|
||||
// Remove unused column - sometimes we don't have it thought...
|
||||
if ( $DB->checkForColumn( 'blog_comments', 'comment_queued' ) )
|
||||
{
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_queued;";
|
||||
}
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_comments CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_trackback_spamlogs CHANGE ip_address ip_address VARCHAR( 46 ) NULL DEFAULT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_voters CHANGE ip_address ip_address VARCHAR( 46 ) NOT NULL;";
|
||||
$SQL[] = "ALTER TABLE blog_akismet_logs CHANGE log_date log_date INT( 10 ) NOT NULL DEFAULT '0';";
|
||||
|
||||
/* Drop unused fields */
|
||||
$SQL[] = "ALTER TABLE blog_comments DROP comment_use_sig, DROP comment_use_emo, DROP comment_html_state, DROP comment_append_edit,
|
||||
DROP comment_edit_name, DROP INDEX comment_entry_id, ADD INDEX ( entry_id, comment_approved );";
|
||||
|
||||
/* Mess up indexes */
|
||||
$SQL[] = "ALTER TABLE blog_entries DROP INDEX entry_status, ADD INDEX entry_status ( entry_status, entry_last_update );";
|
||||
|
||||
|
||||
/* Remove custom skin choice */
|
||||
$SQL[] = "UPDATE blog_blogs SET blog_skin_id=0;";
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_24000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 24000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_blogs DROP COLUMN blog_header_id;";
|
||||
$SQL[] = "DROP TABLE blog_headers;";
|
||||
|
||||
$SQL[] = "DELETE FROM core_sys_conf_settings WHERE conf_key IN ('blog_enable_dheader','blog_cache_dheader','blog_headers');";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_entries ADD COLUMN entry_image VARCHAR(255) NOT NULL DEFAULT '', ADD COLUMN entry_views INT(10) NOT NULL DEFAULT 0;";
|
||||
|
||||
$SQL[] = "ALTER TABLE blog_views ADD COLUMN entry_id INT(10) NOT NULL DEFAULT 0;";
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage Blog
|
||||
* @since 03 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\blog\setup\upg_25000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Conversion from 3.0
|
||||
*
|
||||
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::runLegacySql( 'blog', 25000 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
// Some installs may still have this old (hidden) settings group installed
|
||||
$SQL[] = "DELETE FROM core_sys_settings_titles WHERE conf_title_keyword='blog_masks';";
|
||||
|
||||
Loaded 100 of 7517 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user