├── www ├── img │ └── empty ├── js │ └── empty ├── robots.txt ├── css │ └── test.css ├── favicon.ico ├── sweany │ ├── captcha │ │ └── captcha.ttf │ ├── flags │ │ └── 16x16 │ │ │ ├── de.png │ │ │ └── en.png │ ├── calendar │ │ └── img │ │ │ ├── close.jpg │ │ │ ├── btn_next.png │ │ │ ├── btn_previous.png │ │ │ ├── iconCalendar.gif │ │ │ └── disable_date_bg.png │ ├── bbcode │ │ ├── img │ │ │ ├── text │ │ │ │ ├── bold.png │ │ │ │ ├── code.png │ │ │ │ ├── link.png │ │ │ │ ├── image.png │ │ │ │ ├── italic.png │ │ │ │ ├── strike.png │ │ │ │ └── underline.png │ │ │ └── smiley │ │ │ │ ├── cool.png │ │ │ │ ├── cry.png │ │ │ │ ├── grin.png │ │ │ │ ├── happy.png │ │ │ │ ├── mad.png │ │ │ │ ├── red.png │ │ │ │ ├── roll.png │ │ │ │ ├── smile.png │ │ │ │ ├── yell.png │ │ │ │ ├── confuse.png │ │ │ │ ├── tongue.png │ │ │ │ ├── unhappy.png │ │ │ │ ├── evilgrin.png │ │ │ │ └── surprise.png │ │ └── js │ │ │ └── bbeditor.js │ └── debug.js └── .htaccess ├── sweany ├── cache │ └── empty ├── core │ ├── README │ ├── bootstrap │ │ ├── README │ │ ├── aBootTemplate.php │ │ ├── Validator.php │ │ └── Database.php │ ├── built-in │ │ ├── README │ │ ├── model │ │ │ └── empty │ │ ├── view │ │ │ ├── README │ │ │ ├── FrameworkDefault │ │ │ │ ├── README │ │ │ │ ├── 404.tpl.php │ │ │ │ ├── info_message.tpl.php │ │ │ │ ├── admin_translations.tpl.php │ │ │ │ ├── admin_emails.tpl.php │ │ │ │ └── admin_visitors.tpl.php │ │ │ └── missing.tpl.php │ │ ├── tables │ │ │ ├── LanguageSectionsTable.php │ │ │ ├── EmailsTable.php │ │ │ ├── FailedLoginsTable.php │ │ │ ├── VisitorsTable.php │ │ │ └── UsersTable.php │ │ ├── admin │ │ │ └── panel.tpl.php │ │ ├── LayoutController.php │ │ ├── BlockController.php │ │ └── PageModel.php │ ├── database │ │ └── README │ ├── helper │ │ ├── README │ │ └── History.php │ ├── validator │ │ ├── README │ │ ├── Validate01Basics.php │ │ ├── Validate08LogVisitors.php │ │ ├── Validate06User.php │ │ └── Validate09Plugins.php │ ├── renderable │ │ ├── README │ │ ├── js.tpl.php │ │ ├── css.tpl.php │ │ ├── jpg.tpl.php │ │ ├── json.tpl.php │ │ ├── pdf.tpl.php │ │ ├── png.tpl.php │ │ ├── xml.tpl.php │ │ └── TODO │ ├── skeletons │ │ ├── email │ │ │ └── default.tpl.php │ │ └── html │ │ │ └── default.tpl.php │ └── Config.php ├── log │ └── empty ├── helper │ ├── README │ ├── lib │ │ └── README │ ├── Sanitize.php │ ├── Loader.php │ ├── TinyUrl.php │ ├── Arrays.php │ ├── Client.php │ ├── Captcha.php │ ├── Request.php │ ├── Url.php │ ├── Session.php │ ├── Css.php │ └── LogCat.php ├── cli │ ├── README │ └── password.php ├── TODO └── README ├── usr ├── blocks │ └── README ├── plugins │ ├── Message │ │ ├── TODO │ │ ├── www │ │ │ ├── img │ │ │ │ ├── icon_new.png │ │ │ │ ├── icon_inbox.png │ │ │ │ ├── icon_outbox.png │ │ │ │ ├── icon_trash.png │ │ │ │ ├── action_delete.png │ │ │ │ ├── action_reply.png │ │ │ │ ├── action_trash.png │ │ │ │ ├── flag_msg_new.png │ │ │ │ ├── flag_msg_read.png │ │ │ │ ├── icon_archive.png │ │ │ │ ├── action_archive.png │ │ │ │ ├── action_restore.png │ │ │ │ └── flag_msg_replied.png │ │ │ └── css │ │ │ │ └── message.css │ │ ├── pages │ │ │ ├── model │ │ │ │ └── MessageModel.php │ │ │ └── view │ │ │ │ ├── read_alert.tpl.php │ │ │ │ ├── write.tpl.php │ │ │ │ ├── reply.tpl.php │ │ │ │ └── alerts.tpl.php │ │ ├── languages │ │ │ └── README │ │ ├── blocks │ │ │ └── MessageBlock.php │ │ ├── config.php │ │ └── ValidateMessage.php │ ├── Contact │ │ ├── pages │ │ │ ├── view │ │ │ │ ├── index.tpl.php │ │ │ │ └── contact.tpl.php │ │ │ ├── model │ │ │ │ └── ContactModel.php │ │ │ └── controller │ │ │ │ └── Contact.php │ │ ├── config.php │ │ ├── blocks │ │ │ └── view │ │ │ │ ├── admin_show_all.tpl.php │ │ │ │ ├── add_contact.tpl.php │ │ │ │ └── admin_show_one.tpl.php │ │ ├── languages │ │ │ ├── README │ │ │ ├── en.xml │ │ │ └── de.xml │ │ ├── ValidateContact.php │ │ └── tables │ │ │ └── ContactTable.php │ ├── Forums │ │ ├── www │ │ │ ├── img │ │ │ │ ├── pm.png │ │ │ │ ├── forum_bug.png │ │ │ │ ├── button_edit.png │ │ │ │ ├── button_quote.png │ │ │ │ ├── forum_device.png │ │ │ │ ├── forum_news.png │ │ │ │ ├── forum_feedback.png │ │ │ │ ├── forum_notebook.png │ │ │ │ ├── icon_date_time.png │ │ │ │ ├── forum_discussion.png │ │ │ │ ├── threads │ │ │ │ │ ├── is_closed.png │ │ │ │ │ ├── is_locked.png │ │ │ │ │ └── is_sticky.png │ │ │ │ └── profiles │ │ │ │ │ └── avatar │ │ │ │ │ └── 16x16 │ │ │ │ │ └── default.png │ │ │ ├── css │ │ │ │ └── forum.css │ │ │ └── js │ │ │ │ └── forum.js │ │ ├── blocks │ │ │ └── view │ │ │ │ ├── news_overview.tpl.php │ │ │ │ ├── online_users.tpl.php │ │ │ │ ├── latest_posts_by_user.tpl.php │ │ │ │ ├── activity_overview_list.tpl.php │ │ │ │ └── activity_overview.tpl.php │ │ ├── languages │ │ │ └── README │ │ ├── tables │ │ │ ├── ForumCategoriesTable.php │ │ │ ├── ForumPostsTable.php │ │ │ └── ForumForumsTable.php │ │ ├── config.php │ │ └── pages │ │ │ └── view │ │ │ └── add_thread.tpl.php │ ├── User │ │ ├── pages │ │ │ ├── model │ │ │ │ └── UserModel.php │ │ │ └── view │ │ │ │ ├── login.tpl.php │ │ │ │ ├── reset_password_invalid.tpl.php │ │ │ │ ├── lost_password.tpl.php │ │ │ │ ├── reset_password_valid.tpl.php │ │ │ │ ├── validate_account.tpl.php │ │ │ │ ├── settings.tpl.php │ │ │ │ ├── show_profile.tpl.php │ │ │ │ └── edit_data.tpl.php │ │ ├── blocks │ │ │ └── view │ │ │ │ ├── logout_link.tpl.php │ │ │ │ ├── login_link.tpl.php │ │ │ │ ├── latest_users_list.tpl.php │ │ │ │ ├── form_reset_password.tpl.php │ │ │ │ ├── form_lost_password.tpl.php │ │ │ │ ├── form_login.tpl.php │ │ │ │ ├── Copy of form_register.tpl.php │ │ │ │ └── form_register.tpl.php │ │ ├── languages │ │ │ └── README │ │ ├── www │ │ │ └── css │ │ │ │ └── user.css │ │ └── config.php │ ├── Guestbook │ │ ├── www │ │ │ ├── img │ │ │ │ └── avatars │ │ │ │ │ ├── cool_avatars_0131.jpg │ │ │ │ │ ├── cool_avatars_0159.jpg │ │ │ │ │ ├── cool_avatars_0298.jpg │ │ │ │ │ ├── cool_avatars_0299.jpg │ │ │ │ │ ├── cool_avatars_0356.jpg │ │ │ │ │ ├── fantasy_avatar_0049.jpg │ │ │ │ │ ├── fantasy_avatar_0063.jpg │ │ │ │ │ ├── fantasy_avatar_0068.jpg │ │ │ │ │ ├── fantasy_avatar_0071.jpg │ │ │ │ │ ├── fantasy_avatar_0075.jpg │ │ │ │ │ ├── fantasy_avatar_0076.jpg │ │ │ │ │ ├── fantasy_avatar_0077.jpg │ │ │ │ │ ├── fantasy_avatar_0137.jpg │ │ │ │ │ ├── fantasy_avatar_0141.jpg │ │ │ │ │ ├── fantasy_avatar_0287.jpg │ │ │ │ │ ├── fantasy_avatar_0291.jpg │ │ │ │ │ └── fantasy_avatar_0399.jpg │ │ │ ├── js │ │ │ │ └── guestbook.js │ │ │ └── html │ │ │ │ └── select_avatar.php │ │ ├── pages │ │ │ ├── model │ │ │ │ └── GuestbookModel.php │ │ │ ├── view │ │ │ │ └── index.tpl.php │ │ │ └── controller │ │ │ │ └── Guestbook.php │ │ ├── blocks │ │ │ └── view │ │ │ │ ├── frontpage.tpl.php │ │ │ │ ├── signed.tpl.php │ │ │ │ └── unsigned.tpl.php │ │ ├── languages │ │ │ ├── README │ │ │ ├── en.xml │ │ │ └── de.xml │ │ ├── ValidateGuestbook.php │ │ ├── tables │ │ │ └── GuestbookTable.php │ │ └── config.php │ └── Faq │ │ ├── ValidateFaq.php │ │ ├── www │ │ └── css │ │ │ └── faq.css │ │ ├── config.php │ │ ├── tables │ │ ├── FaqTable.php │ │ └── FaqSectionTable.php │ │ ├── languages │ │ ├── en.xml │ │ ├── de.xml │ │ └── README │ │ └── pages │ │ ├── view │ │ └── index.tpl.php │ │ └── controller │ │ └── Faq.php ├── tables │ └── README ├── README ├── pages │ ├── view │ │ ├── README │ │ └── Home │ │ │ └── index.tpl.php │ ├── model │ │ └── HomeModel.php │ ├── _core │ │ └── README │ ├── wrapper │ │ └── README │ └── controller │ │ └── Home.php ├── vendors │ └── README ├── layouts │ ├── Layouts.php │ └── view │ │ ├── default.tpl.php │ │ └── frontpage.tpl.php └── languages │ ├── README │ ├── en.xml │ └── de.xml ├── VERSION ├── CREDITS ├── .gitignore ├── .github └── workflows │ └── linting.yml ├── Makefile ├── .htaccess ├── TODO └── INSTALL /www/img/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /www/js/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/cache/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/log/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /usr/blocks/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/helper/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/bootstrap/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/built-in/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/database/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/helper/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/validator/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/helper/lib/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | sweany-0.9.4-beta 2 | -------------------------------------------------------------------------------- /sweany/core/built-in/model/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/js.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/css.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/jpg.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/json.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/pdf.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/png.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sweany/core/renderable/xml.tpl.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | cytopia 2 | -------------------------------------------------------------------------------- /www/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | -------------------------------------------------------------------------------- /sweany/core/renderable/TODO: -------------------------------------------------------------------------------- 1 | TO BE IMPLEMENTED! 2 | -------------------------------------------------------------------------------- /sweany/cli/README: -------------------------------------------------------------------------------- 1 | This directory contains useful console tools 2 | -------------------------------------------------------------------------------- /usr/plugins/Message/TODO: -------------------------------------------------------------------------------- 1 | This plugin needs more validation!!! 2 | -------------------------------------------------------------------------------- /www/css/test.css: -------------------------------------------------------------------------------- 1 | /* test css for demonstration purpose only */ 2 | -------------------------------------------------------------------------------- /usr/plugins/Contact/pages/view/index.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /usr/tables/README: -------------------------------------------------------------------------------- 1 | See ExampleTable.php_example 2 | for a complete example 3 | -------------------------------------------------------------------------------- /usr/README: -------------------------------------------------------------------------------- 1 | See config.php_example for all options including their description 2 | -------------------------------------------------------------------------------- /www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/www/favicon.ico -------------------------------------------------------------------------------- /usr/pages/view/README: -------------------------------------------------------------------------------- 1 | Folder Layout 2 | 3 | /.tpl.php 4 | -------------------------------------------------------------------------------- /sweany/TODO: -------------------------------------------------------------------------------- 1 | l1_core.php sweany 2 | l2_core.php parts from lib (all files used by l1_core.php) 3 | -------------------------------------------------------------------------------- /sweany/README: -------------------------------------------------------------------------------- 1 | l1_core.php sweany 2 | l2_core.php parts from lib (all files used by l1_core.php) 3 | -------------------------------------------------------------------------------- /www/sweany/captcha/captcha.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/www/sweany/captcha/captcha.ttf -------------------------------------------------------------------------------- /www/sweany/flags/16x16/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/www/sweany/flags/16x16/de.png -------------------------------------------------------------------------------- /www/sweany/flags/16x16/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/www/sweany/flags/16x16/en.png -------------------------------------------------------------------------------- /usr/plugins/Forums/www/img/pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/usr/plugins/Forums/www/img/pm.png -------------------------------------------------------------------------------- /www/sweany/calendar/img/close.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cytopia/sweany/master/www/sweany/calendar/img/close.jpg -------------------------------------------------------------------------------- /usr/pages/model/HomeModel.php: -------------------------------------------------------------------------------- 1 | headline; ?> 2 | 3 |

teaser; ?>

4 | 5 | 6 | -------------------------------------------------------------------------------- /usr/plugins/Faq/ValidateFaq.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/reset_password_invalid.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |

invalidKey;?>

3 |

invalidKeyText;?>

4 |
5 | -------------------------------------------------------------------------------- /usr/plugins/Message/pages/model/MessageModel.php: -------------------------------------------------------------------------------- 1 | array('UserMessages', 'UserAlerts',) 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /www/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-d 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 6 | 7 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/lost_password.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |


5 |
6 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/reset_password_valid.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |

createNewPassword;?>

3 |

enterYourNewPassowrd;?>

4 | 5 |

6 |
7 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/FrameworkDefault/404.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |

title; ?>

8 |
9 |

text; ?>

10 |
11 | -------------------------------------------------------------------------------- /usr/pages/_core/README: -------------------------------------------------------------------------------- 1 | Sweany PHP has a couple of core views in sweany\core\built-in\view\FrameworkDefault 2 | 3 | You can overwrite any/some/none of them by placing a file with the same name from the above 4 | folder into this directory and put your custom code into it. 5 | -------------------------------------------------------------------------------- /usr/plugins/Faq/www/css/faq.css: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************* 2 | * 3 | * F A Q 4 | * 5 | **************************************************************************************************************/ 6 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/logout_link.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
logout, $logoutCtl, $logoutMethod, array($sessionId));?>
4 |
5 |
6 | -------------------------------------------------------------------------------- /sweany/core/skeletons/email/default.tpl.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Email 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /usr/plugins/Faq/config.php: -------------------------------------------------------------------------------- 1 | welcome; ?>
2 | site_name; ?>

3 | login, $loginCtl, $loginMethod); ?>
4 | or;?> signup, $signupCtl, $signupMethod); ?> 5 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/www/js/guestbook.js: -------------------------------------------------------------------------------- 1 | function popup(mylink, windowname) 2 | { 3 | if (! window.focus)return true; 4 | var href; 5 | if (typeof(mylink) == 'string') 6 | href=mylink; 7 | else 8 | href=mylink.href; 9 | window.open(href, windowname, 'width=400, height=200, scrollbars=yes'); 10 | return false; 11 | } 12 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/validate_account.tpl.php: -------------------------------------------------------------------------------- 1 | 2 |

accountActivated;?>

3 |

accountActivatedText;?>

4 | loginHere, 'User', 'login')?> 5 | 6 |

invalidKey;?>

7 |

invalidKeyText;?>

8 | 9 | -------------------------------------------------------------------------------- /usr/plugins/Faq/tables/FaqTable.php: -------------------------------------------------------------------------------- 1 | 'ASC', 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/FrameworkDefault/info_message.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |

title; ?>

8 | 9 |

10 |

11 |

12 | text; ?> 13 |

14 |
15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # do not upload generated sweany*.tar.gz 2 | *.tar.gz 3 | 4 | # do not upload scripts 5 | push_github.sh 6 | push_local.sh 7 | 8 | # do not upload backup dirs 9 | _bak/ 10 | /log/ 11 | 12 | # do not upload local config or logs 13 | usr/config.php 14 | sweany/log/core.log 15 | sweany/log/debug.log 16 | sweany/log/custom.log 17 | 18 | # win/mac auto-generated files 19 | Thumbs.db 20 | .DS_Store 21 | .DS_Store? 22 | -------------------------------------------------------------------------------- /usr/vendors/README: -------------------------------------------------------------------------------- 1 | Vendor created custom classes/functionality. 2 | Please use namespaces for your classes to not collide with core or project classes. 3 | 4 | Place php class files directly inside this folder. 5 | .php must match class name of class itself. 6 | If so, everything else will be taken care of by the auto-loader (lazy loading) 7 | 8 | TODO: 9 | + description how to use vendors 10 | + example vendor 11 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/missing.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |

Missing View

3 | 4 |

This has one of the following reasons:

5 |
    6 |
  • You have not set $this->view('name_of_the_view');
  • 7 |
  • The name of the view in $this->view(); is incorrect
  • 8 |
  • If you do not want a view to be displayed, you will have to set $this->render
  • 9 |
10 |

Enable $VALIDATION_MODE (if not done already) in config.php to find out more via Syslog output

11 |
12 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/www/html/select_avatar.php: -------------------------------------------------------------------------------- 1 | '; 11 | echo ''; 12 | echo ''; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sweany/core/built-in/tables/LanguageSectionsTable.php: -------------------------------------------------------------------------------- 1 | table = \Sweany\Settings::tblLangSections; 22 | } 23 | 24 | 25 | /************************************************** OVERRIDES **************************************************/ 26 | } 27 | -------------------------------------------------------------------------------- /usr/plugins/Forums/blocks/view/news_overview.tpl.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 |
6 |
7 | 8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | ### 4 | ### Lints all generic and json files in the whole git repository 5 | ### 6 | 7 | name: linting 8 | on: 9 | pull_request: 10 | push: 11 | branches: 12 | - master 13 | tags: 14 | 15 | jobs: 16 | lint: 17 | runs-on: ubuntu-latest 18 | strategy: 19 | fail-fast: False 20 | matrix: 21 | target: 22 | - Linting 23 | name: "[ ${{ matrix.target }} ]" 24 | steps: 25 | - name: Checkout repository 26 | uses: actions/checkout@master 27 | 28 | - name: Lint 29 | run: | 30 | make lint 31 | -------------------------------------------------------------------------------- /usr/layouts/Layouts.php: -------------------------------------------------------------------------------- 1 | core->user->isLoggedIn() ) 8 | { 9 | $params = array('User', 'login', 'User', 'login'); 10 | $this->attachPluginBlock('bLoginLogoutBox', 'User', 'User', 'loginLink', $params); 11 | } 12 | else 13 | { 14 | $params = array('User', 'logout'); 15 | $this->attachPluginBlock('bLoginLogoutBox', 'User', 'User', 'logoutLink', $params); 16 | } 17 | 18 | $this->view('frontpage'); 19 | } 20 | 21 | public function DefaultLayout() 22 | { 23 | $this->view('default'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/blocks/view/frontpage.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | fk_user_id ? Html::l($entry->username, 'User', 'show', array($entry->fk_user_id)) : $entry->author; ?> 4 | 5 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 |
6 | message), 150, true)); ?> 7 |
11 | created).' '.TimeHelper::date('H:i', $entry->created); ?> 12 |

19 | -------------------------------------------------------------------------------- /sweany/core/built-in/tables/EmailsTable.php: -------------------------------------------------------------------------------- 1 | 'DESC'); 19 | 20 | // AUTO FIELDS 21 | public $hasCreated = array('created' => 'integer'); 22 | 23 | /** 24 | * Constructor 25 | */ 26 | public function __construct() 27 | { 28 | parent::__construct(); 29 | $this->table = \Sweany\Settings::tblEmails; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /usr/plugins/Faq/tables/FaqSectionTable.php: -------------------------------------------------------------------------------- 1 | 'ASC', 17 | ); 18 | 19 | public $hasMany = array( 20 | 'Faq' => array( 21 | 'table' => 'faq', 22 | 'plugin' => 'Faq', 23 | 'foreignKey' => 'fk_section_id', 24 | 'fields' => array('id', 'question', 'answer', 'anchor'), 25 | 'order' => array('Faq.sort' => 'ASC'), 26 | ), 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /usr/pages/view/Home/index.tpl.php: -------------------------------------------------------------------------------- 1 |

Home Page

2 | 3 |

Test User Accounts

4 |
    5 |
  • admin : admin
  • 6 |
  • demo1 : demo1
  • 7 |
  • demo2 : demo2
  • 8 |
  • demo3 : demo3
  • 9 |
  • demo4 : demo4
  • 10 |
  • demo5 : demo5
  • 11 |
12 |

13 | 14 | isLoggedIn() ): ?> 15 |
16 |
17 |
18 |

19 | 20 | 21 | 22 |
23 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/latest_users_list.tpl.php: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 | 10 |
  • 11 | username, array('title' => $user->username)); ?> 12 | 13 | username, 'User', 'show', array($user->id), array('title' => $user->username)); ?> 14 | 15 |
  • 16 | 17 |
18 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/settings.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | regionalSettings); 6 | echo Form::getError('timezones'); 7 | echo Form::label('timezones', $language->timezone); 8 | echo Form::selectBox('timezones', $timezones, $def_zone).'
'; 9 | 10 | echo Form::getError('languages'); 11 | echo Form::label('languages', $language->language); 12 | echo Form::selectBox('languages', $languages, $def_lang); 13 | echo Form::fieldSetEnd().'
'; 14 | 15 | echo Form::submitButton('edit', $language->edit); 16 | 17 | echo Form::end(); 18 | ?> 19 |
20 | -------------------------------------------------------------------------------- /sweany/core/built-in/admin/panel.tpl.php: -------------------------------------------------------------------------------- 1 |
2 |      Admin Panel | Users | Translations | Visitors | Emails | toggle Blocks | toggle Wrapper | rebuild Cache 3 |
4 | -------------------------------------------------------------------------------- /usr/plugins/Faq/languages/en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | English 8 | en 9 | en-US 10 | Y-m-d 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | FAQ 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /usr/plugins/Faq/languages/de.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deutsch 8 | de 9 | de-DE 10 | d.m.Y 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | FAQ 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/form_reset_password.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
newPassword;?> 10 | 11 |
newPasswordRepeat;?> 16 | 17 |
create); ?>
25 | 26 | -------------------------------------------------------------------------------- /usr/plugins/Forums/blocks/view/online_users.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | username, $userProfileCtl, $userProfileMethod, array($onlineUser->id)) : $onlineUser->username; 7 | } 8 | ?> 9 | currOnlineUsers; ?>: 10 | ( 11 | 12 | regUser : $language->regUsers;?> 13 | / 14 | guestUser : $language->guestUsers;?> ) 15 |
16 | 17 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/form_lost_password.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | resetPassword); ?> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
yourEmail;?> 30, 'maxlength' => '50')); ?>
resetPassword); ?>
18 | 19 | 20 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/show_profile.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 | 7 | 8 |
9 | 10 | 11 | 12 | writeMessage, $userWriteMessageCtl, $userWriteMessageMethod, array($user_id));?> 13 |
14 | 15 | 16 | 17 |
18 | userNotFound;?> 19 |
20 | 21 |
22 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/blocks/view/signed.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | fieldset_name); ?> 3 | 4 | avatar)?> 5 | 'avatarField')); ?> choose;?>

6 | 7 | 8 | entry.' (*)')?> 9 |
10 | 11 | 12 | add);?> 13 | 14 | 15 | -------------------------------------------------------------------------------- /usr/plugins/Faq/pages/view/index.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |

name); ?>

6 | Faq as $faq): ?> 7 | question), 'Faq', null, null, null, $faq->anchor);?>
8 | 9 | 10 |
11 | 12 |
13 | 14 |

name); ?>

15 | Faq as $faq): ?> 16 | F: question);?> 17 |

A: answer);?>

18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /usr/plugins/Faq/pages/controller/Faq.php: -------------------------------------------------------------------------------- 1 | find('all'); 15 | 16 | // TODO: add self-defined CSS 17 | 18 | // ADD TEMPLATE ELEMENTS 19 | HtmlTemplate::setTitle($this->core->language->pageTitle); 20 | 21 | // VIEW VARIABLES 22 | $this->set('entries', $entries); 23 | 24 | // VIEW 25 | $this->view('index'); 26 | 27 | // LAYOUT OPTIONS 28 | if ( Config::exists('layout', 'faq') ) 29 | { 30 | $layout = Config::get('layout', 'user'); 31 | $this->layout($layout[0], $layout[1], isset($layout[3]) ? $layout[3] : array()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifneq (,) 2 | .error This Makefile requires GNU Make. 3 | endif 4 | 5 | .PHONY: lint 6 | 7 | CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) 8 | 9 | lint: _lint-files 10 | 11 | _lint-files: 12 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-cr --text --ignore '.git/,.github/,tests/' --path . 13 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-crlf --text --ignore '.git/,.github/,tests/' --path . 14 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-single-newline --text --ignore '.git/,.github/,tests/' --path . 15 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-trailing-space --text --ignore '.git/,.github/,tests/' --path . 16 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8 --text --ignore '.git/,.github/,tests/' --path . 17 | @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8-bom --text --ignore '.git/,.github/,tests/' --path . 18 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | RewriteEngine on 4 | 5 | # ---- redirect to plugin's www folder if requested 6 | # http://domain.tld/plugins//(css|js|img|html)/.(css|js|gif|jpg|jpeg|png|htm|html|php) 7 | # css 8 | RewriteRule ^plugins/([-A-z0-9]+)/css/([-A-z0-9]+)\.css usr/plugins/$1/www/css/$2\.css [L] 9 | # javascript 10 | RewriteRule ^plugins/([-A-z0-9]+)/js/([-A-z0-9]+)\.js usr/plugins/$1/www/js/$2\.js [L] 11 | # pictures 12 | RewriteRule ^plugins/([-A-z0-9]+)/img/(.*)\.(gif|jpg|jpeg|png) usr/plugins/$1/www/img/$2\.$3 [L] 13 | # htm(l)|php files 14 | RewriteRule ^plugins/([-A-z0-9]+)/html/(.*)\.(htm|html|php) usr/plugins/$1/www/html/$2\.$3 [L] 15 | 16 | # ---- if it is not a file or directory, move on to normal redirect 17 | RewriteCond %{REQUEST_FILENAME} !-f 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | 20 | # redirect anything else to www/ 21 | RewriteRule (.*) www/$1 [L] 22 | RewriteRule ^$ www/ [L] 23 | 24 | -------------------------------------------------------------------------------- /usr/plugins/Contact/blocks/view/admin_show_all.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | is_read) ? true : false; ?> 17 | 18 | 19 | 20 | 21 | >subject, $controller, $method, array($message->id));?> 22 | 23 | 24 | 25 | 26 | 27 | 28 |
countidnamesubjectreceivedstatus
id, $controller, $method, array($message->id));?>name;?>created);?>
29 |
30 | -------------------------------------------------------------------------------- /usr/pages/wrapper/README: -------------------------------------------------------------------------------- 1 | Wrappers are views that can hold a plugin view to customize its surrounding. 2 | 3 | Example: 4 | ---------- 5 | Assume you have a plugin called 'Forums'. Its controller is 'Forum' and 6 | there is a method that defines a view called 'index.tpl.php'. 7 | 8 | Then you can create a new folder in this directory, called 'Forums' (named after the plugin name) 9 | and in it place a file called 'index.tpl.php' 10 | 11 | In this file then you will automatically have access to the following variables: 12 | + $view 13 | + $user 14 | + $language 15 | 16 | The view holds the rendered content of the controller function that uses this view. 17 | $user is the user object 18 | $language is the language object 19 | 20 | You can then place custom layout around the working plugin page such as: 21 | 22 | 23 |
24 | 25 |
26 |
27 | ... custom content... 28 |
29 | 30 | 31 | Note: 32 | ---------- 33 | Wrappers are optionally, you do not have to create them. 34 | Only use if you want to customize some stuff 35 | -------------------------------------------------------------------------------- /usr/plugins/Forums/blocks/view/latest_posts_by_user.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 23 | 24 | 25 | 26 | 27 |
PostThreadForum
13 | 14 |
15 | youReplied;?> at.' '.date('H:i', $post['created']); ?> 16 |
17 |
19 |
20 | 21 |
22 |
28 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | =========================================== 2 | = TODO 3 | =========================================== 4 | 5 | High Priority 6 | ------------------------- 7 | * Admin user in config.php (in case users module is disabled) 8 | + also make sure admin controller validate against this 9 | + store login in session 10 | + make sure $this->core->user->is_admin() return it correctly 11 | * Multiple Primary keys for ORM Model 12 | 13 | 14 | 15 | Medium Priority 16 | ------------------------- 17 | * Caching 18 | * daemonize-mode 19 | * re-activate Fast core 20 | * Vendors need propper testing (check out mailer) 21 | * PostgreSQL compatibility (1 of 2 is done) 22 | * SQLite compatibility (1 of 2 is done) 23 | * user groups 24 | * write Documentation 25 | 26 | 27 | Low Priority 28 | ------------------------- 29 | * Admin sections for plugins need to be programmed 30 | + Forum (create categories, forums|delete/move threads/posts) 31 | + Contact (view contact messages) 32 | * favicon.ico, Logo, Artwork and nicer base CSS Layout 33 | * Need testers and other people willing to contribute code and/or artwork 34 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/form_login.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | login); ?> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
username; ?>password; ?>
20, 'maxlength' => '50')); ?> 20, 'maxlength' => '50')); ?>
lostPassword, 'User', 'lostPassword'); ?>
25 | 26 | 27 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/pages/view/index.tpl.php: -------------------------------------------------------------------------------- 1 | add_entry; ?> 2 |
3 |
4 |
5 | 6 | 7 | 8 | 9 | 17 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 |
10 |
11 | 12 | fk_user_id ? Html::l($entry->username, 'User', 'show', array($entry->fk_user_id)) : $entry->author; ?>
13 |
14 | avatar) ? Html::img('/plugins/Guestbook/img/avatars/'.$entry->avatar, 'avatar', array('width' => '64', 'height' => '64')) : '';?> 15 |
16 |
18 | message); ?> 19 |
24 | created).' '.TimeHelper::date('H:i', $entry->created); ?> 25 |

32 |
33 |
34 |
35 |
36 | 37 |
38 | -------------------------------------------------------------------------------- /usr/plugins/Contact/blocks/view/add_contact.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | form_legend); ?> 4 | 5 |

form_note; ?>


6 | 7 | 8 | form_label_name); ?> 9 |
'; ?> 10 | 11 | 12 | form_label_email); ?> 13 |
'; ?> 14 | 15 | 16 | form_label_subject); ?> 17 |
'; ?> 18 | 19 | 20 | form_label_message); ?> 21 |
'; ?> 22 | 23 | 24 | form_btn_submit); ?> 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /usr/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/Faq/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/User/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/Contact/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/Forums/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /usr/plugins/Message/languages/README: -------------------------------------------------------------------------------- 1 | Language definition files go here. 2 | 3 | The name must be <2-Letter-Country-Code>.xml 4 | For example: de.xml, en.xml, ... 5 | 6 | 7 | 8 | Each File is build like this 9 | 10 | 11 | 12 | 13 | 14 | 15 | English 16 | en 17 | en-US 18 | 19 | 20 | Page not Found 21 | Sorry, the page you are looking for was not found. 22 | 23 | 24 | Redirecting 25 | Click here if your browser does not automatically redirect you. 26 | 27 | 28 | Changing Language 29 | The Language settings will be applied now 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | The actual language define goes here 39 | ... 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | By default, sweany requires a working mysql database 2 | for the plugins to work (see: "Core-Modules and Plugins" below 3 | to deactivate them) 4 | 5 | 6 | Required steps 7 | -------------------- 8 | + go to usr 9 | + copy config.php_example to config.php 10 | + adjust database settings in config.php 11 | + import db.sql to your mysql database 12 | 13 | 14 | 15 | 16 | Missing Log Files 17 | ------------------- 18 | Sweany assumes two logfiles in sweany/log 19 | + core.log 20 | + custom.log 21 | both have to be writable by the webserver. 22 | If they do not exist, create them. 23 | You can also change the names of them in usr/config.php 24 | 25 | 26 | 27 | Windows Users: 28 | ------------------- 29 | If sweany complains about invalid locale in config.php, 30 | you either have to find out your current correct 31 | locale string or set $DEFAULT_LOCALE = 'C'; in config.php 32 | 33 | 34 | 35 | Core-Modules and Plugins 36 | -------------------- 37 | If you intend to switch off core modules 38 | and sweany complains, that the plugins do need 39 | those core-modules, you can simple remove the plugins 40 | if you don't need them. 41 | 42 | Just remove the plugin folders of the plugins you want to remove from 43 | usr/plugins/ 44 | -------------------------------------------------------------------------------- /sweany/core/built-in/tables/FailedLoginsTable.php: -------------------------------------------------------------------------------- 1 | 'integer'); 23 | 24 | 25 | /* ******************************************** O V E R R I D E S ******************************************** */ 26 | 27 | /** 28 | * Constructor 29 | */ 30 | public function __construct() 31 | { 32 | parent::__construct(); 33 | $this->table = \Sweany\Settings::tblFailedLogins; 34 | } 35 | 36 | public function beforeSave(&$data) 37 | { 38 | $data['referer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; 39 | $data['useragent'] = isset($_SERVER['HTTP_USER_AGENT'])? $_SERVER['HTTP_USER_AGENT'] : ''; 40 | $data['ip'] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; 41 | $data['hostname'] = isset($_SERVER['REMOTE_ADDR']) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ''; 42 | $data['session_id'] = \Sweany\Session::id(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /usr/plugins/Contact/ValidateContact.php: -------------------------------------------------------------------------------- 1 | Contact Plugin: Requires LANGUAGE Module.'; 9 | return false; 10 | } 11 | 12 | if ( !$GLOBALS['SQL_ENABLE'] ) 13 | { 14 | self::$error = 'Contact Plugin: Requires SQL Module.'; 15 | return false; 16 | } 17 | 18 | 19 | // Validate Layout if exists 20 | if ( Config::exists('layout', 'contact') ) 21 | { 22 | $layout = Config::get('layout', 'contact'); 23 | 24 | if ( !is_array($layout) ) 25 | { 26 | self::$error = 'Contact Plugin: layout has to be an array. See config.php comments'; 27 | return false; 28 | } 29 | if ( !isset($layout[0]) || !isset($layout[1]) ) 30 | { 31 | self::$error = 'Contact Plugin: layout has to have at least 2 array keys. See config.php comments'; 32 | return false; 33 | } 34 | if ( !is_file(USR_LAYOUTS_PATH.DS.$layout[0].'.php') ) 35 | { 36 | self::$error = 'Contact Plugin: layout: '.$layout[0].'.php does not exist in '.USR_LAYOUTS_PATH; 37 | return false; 38 | } 39 | } 40 | 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/ValidateGuestbook.php: -------------------------------------------------------------------------------- 1 | Guestbook Plugin: Requires LANGUAGE Module.'; 9 | return false; 10 | } 11 | 12 | if ( !$GLOBALS['SQL_ENABLE'] ) 13 | { 14 | self::$error = 'Guestbook Plugin: Requires SQL Module.'; 15 | return false; 16 | } 17 | 18 | // Validate Layout if exists 19 | if ( Config::exists('layout', 'guestbook') ) 20 | { 21 | $layout = Config::get('layout', 'guestbook'); 22 | 23 | if ( !is_array($layout) ) 24 | { 25 | self::$error = 'Guestbook Plugin: layout has to be an array. See config.php comments'; 26 | return false; 27 | } 28 | if ( !isset($layout[0]) || !isset($layout[1]) ) 29 | { 30 | self::$error = 'Guestbook Plugin: layout has to have at least 2 array keys. See config.php comments'; 31 | return false; 32 | } 33 | if ( !is_file(USR_LAYOUTS_PATH.DS.$layout[0].'.php') ) 34 | { 35 | self::$error = 'Guestbook Plugin: layout: '.$layout[0].'.php does not exist in '.USR_LAYOUTS_PATH; 36 | return false; 37 | } 38 | } 39 | return true; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /usr/plugins/Forums/tables/ForumCategoriesTable.php: -------------------------------------------------------------------------------- 1 | 'ASC', 17 | ); 18 | 19 | public $hasMany = array( 20 | 'Forum' => array( 21 | 'table' => 'forum_forums', 22 | 'plugin' => 'Forums', 23 | 'foreignKey' => 'fk_forum_category_id', # Foreign key in Forum's table 24 | 'condition' => '', 25 | 'fields' => array('id', 'name', 'description', 'icon', 'seo_url'), 26 | 'subQueries' => array( 27 | 'thread_count' => 'SELECT COUNT(*) FROM forum_threads WHERE forum_threads.fk_forum_forums_id = Forum.id', 28 | 'post_count' => 'SELECT COUNT(*) FROM forum_posts WHERE forum_posts.fk_forum_thread_id IN (SELECT id FROM forum_threads WHERE forum_threads.fk_forum_forums_id = Forum.id)', 29 | ), 30 | 'order' => array('Forum.sort' => 'ASC'), 31 | // 'limit' => 5, 32 | 'dependent' => false, 33 | 'recursive' => array('hasMany' => array('LastThread')), // only follow LastThread in $hasMany of ForumForumsTable | instead of TRUE (which follows all relations) 34 | ), 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /usr/plugins/Message/blocks/MessageBlock.php: -------------------------------------------------------------------------------- 1 | countMyUnreadInboxMessages($this->core->user->id()); 11 | $num_alerts = $Alert->countMyUnreadInboxAlerts($this->core->user->id()); 12 | 13 | $this->render = false; 14 | 15 | if ( $num_messages == 0 && $num_alerts == 0 ) 16 | { 17 | return Html::l($this->core->language->noNewMessages, 'Message', 'inbox'); 18 | } 19 | else if ( $num_messages ) 20 | { 21 | if ( $num_messages == 1) 22 | { 23 | return Html::l($num_messages.' '.$this->core->language->aNewMessage, 'Message', 'inbox'); 24 | } 25 | else 26 | { 27 | return Html::l($num_messages.' '.$this->core->language->NewMessages, 'Message', 'inbox'); 28 | } 29 | } 30 | else 31 | { 32 | if ( $num_alerts == 1) 33 | { 34 | return Html::l($num_alerts.' '.$this->core->language->aNewAlert, 'Message', 'alerts'); 35 | } 36 | else 37 | { 38 | return Html::l($num_alerts.' '.$this->core->language->NewAlerts, 'Message', 'alerts'); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /usr/plugins/Contact/pages/controller/Contact.php: -------------------------------------------------------------------------------- 1 | attachPluginBlock('bContactForm', 'Contact', 'Contact', 'addContact'); 25 | 26 | //form was submitted successfully 27 | //show info and the redirect user to the start page 28 | //after 5 seconds delay 29 | if ($submitted) 30 | { 31 | $this->render = false; 32 | $this->redirectDelayedHome($this->core->language->submittedHead, $this->core->language->submittedBody, 5); 33 | return; 34 | } 35 | $this->set('language', $this->core->language); 36 | $this->view('index'); 37 | 38 | // LAYOUT OPTIONS 39 | if ( Config::exists('layout', 'contact') ) 40 | { 41 | $layout = Config::get('layout', 'contact'); 42 | $this->layout($layout[0], $layout[1], isset($layout[3]) ? $layout[3] : array()); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /usr/layouts/view/default.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 | 20 | 21 |
22 | 23 |
24 | 25 | 27 | 28 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /sweany/core/built-in/tables/VisitorsTable.php: -------------------------------------------------------------------------------- 1 | 'integer', // store current unix timestamp on save() 24 | ); 25 | 26 | public $order = array('Visitor.created' => 'DESC'); 27 | 28 | 29 | /* ******************************************** O V E R R I D E S ******************************************** */ 30 | 31 | /** 32 | * Constructor 33 | */ 34 | public function __construct() 35 | { 36 | parent::__construct(); 37 | $this->table = \Sweany\Settings::tblVisitors; 38 | } 39 | 40 | 41 | public function beforeSave(&$data) 42 | { 43 | $data['url'] = \Sweany\Url::getRequest(); 44 | $data['referer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; 45 | $data['useragent'] = isset($_SERVER['HTTP_USER_AGENT'])? $_SERVER['HTTP_USER_AGENT'] : ''; 46 | $data['ip'] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; 47 | $data['host'] = isset($_SERVER['REMOTE_ADDR']) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ''; 48 | $data['session_id'] = \Sweany\Session::id(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /usr/plugins/Message/config.php: -------------------------------------------------------------------------------- 1 | Message Plugin: Requires LANGUAGE Module.'; 9 | return false; 10 | } 11 | 12 | if ( !$GLOBALS['SQL_ENABLE'] ) 13 | { 14 | self::$error = 'Message Plugin: Requires SQL Module.'; 15 | return false; 16 | } 17 | if ( !$GLOBALS['USER_ENABLE'] ) 18 | { 19 | self::$error = 'Message Plugin: Requires USER Module.'; 20 | return false; 21 | } 22 | 23 | // Validate Layout if exists 24 | if ( Config::exists('layout', 'message') ) 25 | { 26 | $layout = Config::get('layout', 'message'); 27 | 28 | if ( !is_array($layout) ) 29 | { 30 | self::$error = 'Message Plugin: layout has to be an array. See config.php comments'; 31 | return false; 32 | } 33 | if ( !isset($layout[0]) || !isset($layout[1]) ) 34 | { 35 | self::$error = 'Message Plugin: layout has to have at least 2 array keys. See config.php comments'; 36 | return false; 37 | } 38 | if ( !is_file(USR_LAYOUTS_PATH.DS.$layout[0].'.php') ) 39 | { 40 | self::$error = 'Message Plugin: layout: '.$layout[0].'.php does not exist in '.USR_LAYOUTS_PATH; 41 | return false; 42 | } 43 | } 44 | 45 | return true; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /usr/plugins/User/www/css/user.css: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************* 2 | * 3 | * U S E R 4 | * 5 | **************************************************************************************************************/ 6 | .plugin_user_edit_data_form { 7 | padding:5px; 8 | } 9 | .plugin_user_edit_data_form input { 10 | margin:3px; 11 | } 12 | .plugin_user_edit_data_form input[type=submit] { 13 | background-color : #00A9FD; 14 | border : solid 1px #2F2F2F; 15 | color : #D7D7D7; 16 | font-size : 15px; 17 | padding:2px; 18 | margin:10px; 19 | } 20 | .plugin_user_edit_data_form label { 21 | float : left; 22 | width : 180px; 23 | margin-right : 0.5em; 24 | padding-top : 0.2em; 25 | text-align : right; 26 | font-weight : bold; 27 | } 28 | 29 | .plugin_user_edit_data_fields{ 30 | margin-bottom: 10px; 31 | } 32 | 33 | .plugin_user_edit_data_fields label { 34 | float : left; 35 | width : 200px; 36 | margin-right : 0.5em; 37 | padding-top : 0.2em; 38 | text-align : right; 39 | font-weight : bold; 40 | } 41 | 42 | 43 | .userLoginForm { 44 | margin-bottom:10px; 45 | } 46 | 47 | .userRegistrationFormEnabled { 48 | } 49 | .userRegistrationFormDisabled { 50 | color:gray; 51 | } 52 | -------------------------------------------------------------------------------- /sweany/core/built-in/tables/UsersTable.php: -------------------------------------------------------------------------------- 1 | table = \Sweany\Settings::tblUsers; 49 | } 50 | 51 | public function delete($id, $related = true, $force = false) 52 | { 53 | $fields = array( 54 | 'is_deleted' => 1, 55 | ); 56 | return parent::update($id, $fields, 0); 57 | } 58 | public function deleteAll($condition, $related = true, $force = false) 59 | { 60 | $fields = array( 61 | 'is_deleted' => 1, 62 | ); 63 | return parent::updateAll($condition, $fields); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /sweany/helper/Sanitize.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.8 2012-08-17 13:25 25 | * 26 | * 27 | * Sanitize 28 | */ 29 | class Sanitize 30 | { 31 | public static function html($string, $strip_tags = false) 32 | { 33 | $charset = 'UTF-8'; 34 | $quotes = ENT_QUOTES; // will convert both double and single quotes. 35 | $double = true; // encode existing html entities. 36 | 37 | if ($strip_tags) { 38 | $string = strip_tags($string); 39 | } 40 | return htmlentities($string, $quotes, $charset, $double); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sweany/helper/Loader.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.8 2012-07-29 13:25 25 | * 26 | */ 27 | Class Loader 28 | { 29 | 30 | public static function loadTable($class) 31 | { 32 | return \Sweany\AutoLoader::loadTable($class, 'user'); 33 | } 34 | 35 | 36 | public static function loadCoreTable($class) 37 | { 38 | return \Sweany\AutoLoader::loadCoreTable($class, 'user'); 39 | } 40 | 41 | 42 | public static function loadPluginTable($class, $plugin) 43 | { 44 | return \Sweany\AutoLoader::loadPluginTable($class, $plugin, 'user'); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /sweany/cli/password.php: -------------------------------------------------------------------------------- 1 | \n\n"; 35 | } 36 | 37 | 38 | if ( $argc != 2 ) { 39 | displayUsage(); 40 | exit; 41 | } 42 | 43 | $pwd = $argv[1]; 44 | 45 | $salt = generateHash(); 46 | $enc = encryptPassword($pwd, $salt); 47 | 48 | echo "===============================\n"; 49 | echo "= Sweany Password Generator =\n"; 50 | echo "===============================\n\n"; 51 | echo "[input]\n"; 52 | echo "------------------\n"; 53 | echo "cleartext: $pwd\n\n"; 54 | echo "[output]\n"; 55 | echo "------------------\n"; 56 | echo "password: $enc\n"; 57 | echo "salt: $salt\n"; 58 | -------------------------------------------------------------------------------- /sweany/helper/TinyUrl.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Strings 28 | */ 29 | class TinyUrl 30 | { 31 | /** 32 | * Generate a tinyUrl from a normal Url 33 | * 34 | */ 35 | public static function generate($url, $timeout = 5) 36 | { 37 | $ch = curl_init(); 38 | curl_setopt($ch, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url='.$url); 39 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 40 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); 41 | $data = curl_exec($ch); 42 | curl_close($ch); 43 | return $data; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /usr/plugins/User/pages/view/edit_data.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | currentPassword); 9 | echo Form::passwordField('old_password').'
'; 10 | ?> 11 |
12 |
13 | changePassword); 15 | echo Form::getError('new_password1'); 16 | echo Form::label('new_password1', $language->newPassword); 17 | echo Form::passwordField('new_password1').'
'; 18 | 19 | echo Form::getError('new_password2'); 20 | echo Form::label('new_password2', $language->repeatNewPassword); 21 | echo Form::passwordField('new_password2'); 22 | echo Form::fieldSetEnd().'
'; 23 | ?> 24 |
25 |
26 | changeEmail); 28 | echo Form::getError('email1'); 29 | echo Form::label('email1', $language->newEmail); 30 | echo Form::inputField('email1', $email).'
'; 31 | 32 | echo Form::getError('email2'); 33 | echo Form::label('email2', $language->repeatNewEmail); 34 | echo Form::inputField('email2', $email); 35 | echo Form::fieldSetEnd(); 36 | ?> 37 |
38 | edit); 40 | 41 | echo Form::end(); 42 | ?> 43 |
44 | -------------------------------------------------------------------------------- /usr/plugins/Contact/blocks/view/admin_show_one.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
Sys User Idfk_user_id;?>
Sys User Nameusername;?>
Refererreferer;?>
Useragentuseragent;?>
IPip;?>
Hosthost;?>
 
Contact Idid;?>
Receivedcreated);?>
Namename;?>
Emailemail;?>
Subjectsubject;?>
Message
message;?>
62 |
63 | -------------------------------------------------------------------------------- /sweany/core/validator/Validate01Basics.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.validator 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-08-08 11:25 25 | * 26 | * 27 | * This (optional) core will validate various settings of 28 | * the framework itself. 29 | */ 30 | namespace Sweany; 31 | class Validate01Basics extends aBootTemplate 32 | { 33 | public static function initialize($options = null) 34 | { 35 | if ( version_compare(phpversion(), '5.4.0', '<') ) 36 | { 37 | echo '

Validation Error: Wrong PHP Version

'; 38 | self::$error = 'You need at least PHP 5.4.0. Your version is: '.phpversion(); 39 | return false; 40 | } 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sweany/helper/Arrays.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Arrays 28 | */ 29 | class Arrays 30 | { 31 | 32 | /** 33 | * Array unshift assoc 34 | * Prepend one or more associative elements 35 | * to the beginning of an array. 36 | * 37 | * Behaves like array_unshift(), but works with associative keys 38 | * 39 | * @param mixed[] &$arr Array 40 | * @param mixed $key Array key 41 | * @param mixed $va Array value 42 | */ 43 | public static function array_unshift_assoc(&$arr, $key, $val) 44 | { 45 | $arr = array_reverse($arr, true); 46 | $arr[$key] = $val; 47 | $arr = array_reverse($arr, true); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sweany/helper/Client.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | *Client 27 | * Server 28 | */ 29 | class Client 30 | { 31 | public static function referer() 32 | { 33 | return isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; 34 | } 35 | 36 | public static function useragent() 37 | { 38 | return isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; 39 | } 40 | 41 | public static function ip() 42 | { 43 | return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; 44 | } 45 | 46 | public static function host() 47 | { 48 | return isset($_SERVER['REMOTE_ADDR']) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ''; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /usr/layouts/view/frontpage.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 | 19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | 30 |
31 | 32 | 35 | 36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/blocks/view/unsigned.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | fieldset_name); ?> 3 | 4 | 5 | 6 | 'display:none;')); ?> 7 | 8 | 9 | author.' (*)')?> 10 |

11 | 12 | email)?> 13 |

14 | 15 | 16 | avatar)?> 17 | 'avatarField')); ?> choose;?>

18 | 19 | 20 | entry.' (*)')?> 21 |
22 | 23 | captcha.' (*)')?> 24 |
25 | 26 | 27 | 28 | captcha_text;?>
29 | 30 |

31 | 32 | 33 | add);?> 34 | 35 | 36 | -------------------------------------------------------------------------------- /usr/plugins/Message/pages/view/read_alert.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | new, 'Message', 'write');?> 3 |
4 |
5 | inbox, 'Message', 'inbox');?> 6 |
7 |
8 | alerts, 'Message', 'alerts');?> 9 |
10 |
11 | archive, 'Message', 'archive');?> 12 |
13 |
14 | trash, 'Message', 'trash');?> 15 |
16 |
17 | outbox, 'Message', 'outbox');?> 18 |
19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
received; ?>created).', '.TimeHelper::date($language->getCustom('/root/core/settings', 'date_format'), $message->created).', '.TimeHelper::date('H:i', $message->created); ?>
from;?>:
subject?>:subject; ?>
41 |
42 | message); ?> 43 |
44 |
45 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/FrameworkDefault/admin_translations.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |

Translations

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | $name): ?> 26 | translation->$tran)) {$todo=true;} ?> 27 | 31 | 32 | 33 | 34 | 35 | 36 |
Default ()Todo
text;?> 28 | translation->$tran) ?$lang->translation->$tran : ''; ?> 29 | group.']['.$tran.']', $def_value); ?> 30 |

37 | 38 | 39 | 40 |
41 | -------------------------------------------------------------------------------- /usr/plugins/Forums/config.php: -------------------------------------------------------------------------------- 1 | method($user_id) 35 | * that will show the profile of user . 36 | */ 37 | Config::set('userProfileLinkEnable', true, 'forum'); 38 | Config::set('userProfileCtl', 'User', 'forum'); 39 | Config::set('userProfileMethod', 'show', 'forum'); 40 | 41 | 42 | /* 43 | * Do you want to enable the 'write pm to user' feature? 44 | * This will then show up in the thread view as an icon, 45 | * linking to the write message-to-user. 46 | * 47 | * If yes, you will have to have a controller call 48 | * in the following format: 49 | * controller->method($user_id) 50 | * that will provide an interface to write a message to . 51 | */ 52 | Config::set('writeMessageLinkEnable', true, 'forum'); 53 | Config::set('writeMessageCtl', 'Message', 'forum'); 54 | Config::set('writeMessageMethod', 'write', 'forum'); 55 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/FrameworkDefault/admin_emails.tpl.php: -------------------------------------------------------------------------------- 1 | 6 |
7 |

Emails

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
IdRecipientHeadersSubjectMessageCreated
id;?>recipient;?>', $email->headers);?>subject;?>message;?>created ? TimeHelper::date('Y-m-d H:i', $email->created) : '';?>
34 | 35 |
36 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/Copy of form_register.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | registerForFree); ?> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
username;?>: 20, 'maxlength' => '50')); ?>
email;?> 20, 'maxlength' => '50')); ?>
password;?> 20, 'maxlength' => '50')); ?>
terms;?> 24 | 25 | IHerebyAccept, ''.$language->dataPolicy.'', ''.$language->terms.'');?> 26 |

register); ?>
35 | 36 | 37 | -------------------------------------------------------------------------------- /usr/plugins/Forums/www/css/forum.css: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************* 2 | * 3 | * F O R U M 4 | * 5 | **************************************************************************************************************/ 6 | /* 7 | forumPostTitle forumPostBody 8 | forumNavi 9 | forumUsername 10 | forumForumLink 11 | forumCategoryName 12 | forumEntryLink 13 | forumEntryime 14 | */ 15 | 16 | 17 | .forum pre { 18 | width:70% 19 | } 20 | 21 | h1.forum{ 22 | margin: 0; 23 | color: #fff; 24 | padding:10px; 25 | color: #FF6903; 26 | font-size:16.5px; 27 | } 28 | table.forum { 29 | font-size: 10pt; 30 | color: gray; 31 | width:100%; 32 | } 33 | table.forum th{ 34 | background-color: #313131; 35 | font-size: 9pt; 36 | text-align: left; 37 | color:#FFF; 38 | padding-left:5px; 39 | padding-right:5px; 40 | padding-top:3px; 41 | padding-bottom:3px; 42 | } 43 | table.forum td{/* 44 | background-color: #414141; 45 | font-weight: normal; 46 | padding-left:5px; 47 | padding-right:5px; 48 | padding-top:3px; 49 | padding-bottom:3px; 50 | font-size: 9pt;*/ 51 | } 52 | 53 | 54 | /******************************* Classes ********************/ 55 | 56 | .forumPostTitle { 57 | 58 | } 59 | 60 | .forumThreadTitle { 61 | 62 | font-weight:bold; 63 | color:black; 64 | margin:1em 0.2em; 65 | padding-bottom:0.3em; 66 | border-bottom:1px dotted black 67 | 68 | } 69 | 70 | .forumThreadTitleLink { 71 | } 72 | 73 | .forumPostBody { 74 | margin:1em 0.2em; 75 | } 76 | .threadUsername { 77 | font-weight:bold; 78 | font-size:16px; 79 | } 80 | 81 | 82 | /* hover Boxes */ 83 | .bbCodeIcons { 84 | border: solid 1px #FDFDFD; 85 | padding-right:2px; 86 | float:left; 87 | } 88 | .bbCodeIcons:hover { 89 | cursor:pointer; 90 | cursor:hand; 91 | border: solid 1px #FF6903; 92 | } 93 | -------------------------------------------------------------------------------- /sweany/core/built-in/LayoutController.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Abstract parent for layout controller 28 | */ 29 | abstract class LayoutController extends BaseController 30 | { 31 | 32 | /* ***************************************************** VARIABLES ***************************************************** */ 33 | 34 | /* 35 | * Defines the type of the controller 36 | * page, layout or block. 37 | * This is used to tell the language class, 38 | * which section to use 39 | */ 40 | protected $ctrl_type = 'layout'; 41 | 42 | 43 | 44 | /* ***************************************************** CONSTRUCTOR ***************************************************** */ 45 | 46 | public function __construct() 47 | { 48 | parent::__construct(); 49 | 50 | 51 | // default Layout 52 | $this->view($GLOBALS['DEFAULT_LAYOUT']); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sweany/core/built-in/BlockController.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Abstract parent for block controller 28 | */ 29 | abstract Class BlockController extends BaseController 30 | { 31 | 32 | /* ***************************************************** VARIABLES ***************************************************** */ 33 | 34 | /* 35 | * Defines the type of the controller 36 | * page, layout or block. 37 | * This is used to tell the language class, 38 | * which section to use 39 | */ 40 | protected $ctrl_type = 'block'; 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | /* ***************************************************** CONSTRUCTOR ***************************************************** */ 49 | 50 | function __construct() 51 | { 52 | parent::__construct(); 53 | 54 | } 55 | 56 | 57 | function __destruct() 58 | { 59 | parent::__destruct(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/tables/GuestbookTable.php: -------------------------------------------------------------------------------- 1 | 'integer'); 27 | 28 | public $condition = array('Guestbook.is_deleted = 0 AND Guestbook.is_approved = 1'); 29 | public $order = array('Guestbook.created' => 'DESC'); 30 | 31 | 32 | public function beforeSave(&$data) 33 | { 34 | $data['fk_user_id'] = \Sweany\Users::id(); 35 | $data['username'] = \Sweany\Users::name(); 36 | $data['author'] = isset($data['author']) ? htmlentities($data['author']) : ''; 37 | 38 | $data['referer'] = Client::referer(); 39 | $data['useragent'] = Client::useragent(); 40 | $data['ip'] = Client::ip(); 41 | $data['host'] = Client::host(); 42 | $data['session_id'] = Session::id(); 43 | 44 | if ( $data['fk_user_id'] ) 45 | { 46 | // auto-approve entries of registered users 47 | $data['is_approved'] = 1; 48 | } 49 | } 50 | 51 | /** 52 | * @override 53 | * @param integer $id Id of entity 54 | * @param void $related No effect here (no relations defined) 55 | * @return boolean success 56 | */ 57 | public function delete($id, $related = true, $force = false) 58 | { 59 | $fields = array( 60 | 'is_deleted' => 1, 61 | ); 62 | return parent::update($id, $fields, 0); 63 | } 64 | public function deleteAll($condition, $related = true, $force = false) 65 | { 66 | $fields = array( 67 | 'is_deleted' => 1, 68 | ); 69 | return parent::updateAll($condition, $fields); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /usr/languages/en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | English 8 | en 9 | en-US 10 | en_US.UTF-8 11 | Y-m-d 12 | 13 | 14 | 15 | Page not Found 16 | Sorry, the page you are looking for was not found. 17 | 18 | 19 | Redirecting 20 | Click here if your browser does not automatically redirect you. 21 | 22 | 23 | Changing Language 24 | The Language settings will be applied now. 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Sweany PHP 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Tag1 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /usr/languages/de.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deutsch 8 | de 9 | de-DE 10 | de_DE.UTF-8 11 | d.m.Y 12 | 13 | 14 | 15 | Seite nicht gefunden 16 | Die gesuchte Seite konnte nicht gefunden werden. 17 | 18 | 19 | Weiterleitung 20 | Klicke hier, falls dein Browser dich nicht automatisch weiterleitet. 21 | 22 | 23 | Sprache wechseln 24 | Die neuen Spracheinstellungen werden jetzt angewandt. 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Sweany PHP 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Tag1 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/pages/controller/Guestbook.php: -------------------------------------------------------------------------------- 1 | core->user->isLoggedIn() ) 25 | { 26 | if ( $ret = $this->attachPluginBlock('bAddEntry', 'Guestbook', 'Guestbook', 'addEntrySigned') ) 27 | { 28 | // Entries of logged in users are automatically approved 29 | $this->redirect('Guestbook', null, array(), $ret); 30 | } 31 | } 32 | else 33 | { 34 | if ( $this->attachPluginBlock('bAddEntry', 'Guestbook', 'Guestbook', 'addEntryUnsigned') ) 35 | { 36 | // Entries of anonymous users must be approved first, so we display a note here 37 | $this->redirectDelayed('Guestbook', null, array(), $this->core->language->redirect_title, $this->core->language->redirect_message, 10); 38 | } 39 | } 40 | 41 | Javascript::addFile('/plugins/Guestbook/js/guestbook.js'); 42 | 43 | $tblGB = Loader::LoadPluginTable('Guestbook', 'Guestbook'); 44 | $this->set('entries', $tblGB->find('all')); 45 | 46 | $this->set('language', $this->core->language); 47 | $this->view('index'); 48 | 49 | // LAYOUT OPTIONS 50 | if ( Config::exists('layout', 'guestbook') ) 51 | { 52 | $layout = Config::get('layout', 'guestbook'); 53 | $this->layout($layout[0], $layout[1], isset($layout[3]) ? $layout[3] : array()); 54 | } 55 | } 56 | 57 | public function admin() 58 | { 59 | $this->error('404'); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /usr/plugins/Contact/languages/en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | English 8 | en 9 | en-US 10 | Y-m-d 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Thank you for submitting 21 | Your message has been send successfully. 22 | 23 | 24 | 25 | 26 | Contact form 27 | Please fill in all fields and choose an appropriate subject. 28 | Name 29 | Email 30 | Subject 31 | Message 32 | - please choose - 33 | Send 34 | Please write your name 35 | invalid email 36 | invalid choice 37 | Please write a message 38 | 39 | 40 | General Inquiry 41 | Feedback 42 | Feature Request 43 | Get involved 44 | Report Error 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /usr/plugins/Contact/languages/de.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deutsch 8 | de 9 | de-DE 10 | d.m.Y 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Danke fuer die Nachricht 21 | Deine Nachricht wurde erfolgreich versand. 22 | 23 | 24 | 25 | 26 | Kontakt Form 27 | Bitte fuelle alle Felder aus und waehle einen geeigneten Betreff. 28 | Name 29 | Email 30 | Betreff 31 | Nachricht 32 | - bitte waehlen - 33 | Senden 34 | Gib deinen Namen an 35 | ungueltige Email 36 | ungueltige Auswahl 37 | Schreibe eine Nachricht 38 | 39 | 40 | Allgemeine Anfrage 41 | Feedback 42 | Neues Feature 43 | Mitmachen 44 | Fehler melden 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /usr/plugins/Message/pages/view/write.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | new, 'Message', 'write');?> 3 |
4 |
5 | inbox, 'Message', 'inbox');?> 6 |
7 |
8 | alerts, 'Message', 'alerts');?> 9 |
10 |
11 | archive, 'Message', 'archive');?> 12 |
13 |
14 | trash, 'Message', 'trash');?> 15 |
16 |
17 | outbox, 'Message', 'outbox');?> 18 |
19 |
20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 | 56 | 57 |
to;?>: 28 | 29 | 30 | 31 |
subject; ?>: 36 | 37 | 55)); ?> 38 |
45 | 46 | 47 |
54 | send); ?> 55 |
58 | 59 |
60 | -------------------------------------------------------------------------------- /usr/plugins/Forums/www/js/forum.js: -------------------------------------------------------------------------------- 1 | function quickEditThread(threadId) 2 | { 3 | var threadEl = document.getElementById('startThread'); 4 | 5 | MakePOSTRequest("/Forums/ajax_get_quick_edit_thread_box/"+threadId, "threadId="+threadId, function(quickEditBox) 6 | { 7 | if (quickEditBox.length>3) 8 | { 9 | threadEl.innerHTML = quickEditBox; 10 | } 11 | }); 12 | } 13 | function submitEditThread(threadId) 14 | { 15 | var threadEl = document.getElementById('startThread'); 16 | var body = document.getElementById('quickEditBoxText').value; 17 | 18 | MakePOSTRequest("/Forums/ajax_edit_thread/"+threadId, "threadId="+threadId+"&body="+body, function(newBodyToDisplay) 19 | { 20 | // something went wrong, we are receiving an error code 21 | // so just reload the page 22 | if ( !isNaN(newBodyToDisplay) ) 23 | { 24 | window.location.reload(); 25 | } 26 | // all right, update the post with the new update 27 | else 28 | { 29 | threadEl.innerHTML = newBodyToDisplay; 30 | } 31 | }); 32 | } 33 | 34 | function quickEditPost(postId) 35 | { 36 | var postEl = document.getElementById('post_'+postId); 37 | 38 | MakePOSTRequest("/Forums/ajax_get_quick_edit_post_box/"+postId, "postId="+postId, function(quickEditBox) 39 | { 40 | if (quickEditBox.length>3) 41 | { 42 | postEl.innerHTML = quickEditBox; 43 | } 44 | }); 45 | } 46 | function submitEditPost(postId) 47 | { 48 | var postEl = document.getElementById('post_'+postId); 49 | var body = document.getElementById('quickEditBoxText').value; 50 | 51 | MakePOSTRequest("/Forums/ajax_edit_post/"+postId, "postId="+postId+"&body="+body, function(newBodyToDisplay) 52 | { 53 | // something went wrong, we are receiving an error code 54 | // so just reload the page 55 | if ( !isNaN(newBodyToDisplay) ) 56 | { 57 | window.location.reload(); 58 | } 59 | // all right, update the post with the new update 60 | else 61 | { 62 | postEl.innerHTML = newBodyToDisplay; 63 | } 64 | }); 65 | } 66 | function cancelEdit() 67 | { 68 | window.location.reload(); 69 | } 70 | -------------------------------------------------------------------------------- /usr/plugins/Message/www/css/message.css: -------------------------------------------------------------------------------- 1 | /************************************************************************************************************* 2 | * 3 | * M E S S A G E P L U G I N 4 | * 5 | **************************************************************************************************************/ 6 | 7 | .messageBox { 8 | font-size: 11px; 9 | line-height: 140%; 10 | background-color: #FFF; 11 | border: solid 1px #2F2F2F; 12 | padding: 10px; 13 | } 14 | 15 | .messageBoxMenu { 16 | font-size: 11px; 17 | line-height: 140%; 18 | float: left; 19 | position: relative; 20 | top: 1px; 21 | width: 60px; 22 | padding: 10px; 23 | padding-top: 9px; 24 | margin-right: 5px; 25 | font-weight: bold; 26 | text-align: center; 27 | background-color: #FFF; 28 | border: solid 1px #2F2F2F; 29 | border-bottom: none; 30 | } 31 | 32 | .messageBoxMenuActive { 33 | padding-top: 10px; 34 | } 35 | 36 | .msgActionButtons { 37 | float: left; 38 | vertical-align: middle; 39 | text-align: center; 40 | font-size: 11px; 41 | font-weight: normal; 42 | border: none; 43 | margin: 1px; 44 | padding: 2px; 45 | width: 60px; 46 | } 47 | 48 | .msgActionButtons:hover { 49 | cursor: hand; 50 | border: solid 1px #FF6903; 51 | margin: 0px; 52 | } 53 | 54 | .msgBodyDisplayBox { 55 | background-color: white; 56 | color: black; 57 | padding: 10px; 58 | border: solid 2px #2F2F2F; 59 | min-height: 100px; 60 | } 61 | 62 | .msgBoxIcons { 63 | float: left; 64 | vertical-align: middle; 65 | text-align: center; 66 | height: 90px; 67 | width: 90px; 68 | border: none; 69 | margin: 1px; 70 | } 71 | 72 | .msgBoxIcons:hover { 73 | cursor: hand; 74 | border: solid 1px #FF6903; 75 | margin: 0px; 76 | } 77 | 78 | /* Ajax Live Search Result Box for searching usernames */ 79 | .liveSearchResults { 80 | width: 160px; 81 | padding: 2px; 82 | background-color: #1C1C1C; 83 | border: 1px solid #2F2F2F; 84 | cursor: pointer; 85 | } 86 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/languages/en.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | English 8 | en 9 | en-US 10 | Y-m-d 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Add entry 21 | Entry added successfully 22 | Thank you for your gustbook comment. The entry will be visible after reviewing. 23 | 24 | 25 | 26 | 27 | Write a guestbook comment 28 | Author 29 | Email 30 | Avatar 31 | Choose 32 | Entry 33 | Captcha 34 | Enter the above listed Characters here 35 | Add 36 | At least 3 characters 37 | You should write something 38 | The chosen avatar is not valid 39 | Wrong captcha 40 | No bots allowed 41 | 42 | 43 | Add guestbook entry 44 | Avatar 45 | Choose 46 | Entry 47 | Add 48 | You should write sommething 49 | The chosen avatar is not valid 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /sweany/core/built-in/view/FrameworkDefault/admin_visitors.tpl.php: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |

Visitors

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | url); 26 | $url = str_replace('&', '& ', $url); 27 | 28 | $referer = str_replace('/', '/ ', $visitor->referer); 29 | $referer = str_replace('&', '& ', $referer); 30 | ?> 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
IdURLRefererIPHostCreated
id;?>ip;?>host;?>created ? TimeHelper::date('Y-m-d H:i', $visitor->created) : '';?>
42 | 43 |
44 |
45 | -------------------------------------------------------------------------------- /usr/plugins/Message/pages/view/reply.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | reply;?> 3 |
4 |
5 | inbox, 'Message', 'inbox');?> 6 |
7 |
8 | alerts, 'Message', 'alerts');?> 9 |
10 |
11 | archive, 'Message', 'archive');?> 12 |
13 |
14 | trash, 'Message', 'trash');?> 15 |
16 |
17 | outbox, 'Message', 'outbox');?> 18 |
19 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 | 53 | 54 |
to;?>:
subject;?>: 32 | 33 | 55)); ?> 34 |
41 | 42 | 43 |
50 | 51 | reply); ?> 52 |
55 | 56 | 57 |

invalidUser;?>

58 | 59 |
60 | -------------------------------------------------------------------------------- /sweany/helper/Captcha.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.8 2012-08-13 13:25 25 | * 26 | * 27 | * Captcha Helper 28 | */ 29 | 30 | Class Captcha 31 | { 32 | 33 | private static $img_path = '/sweany/captcha/captcha.php'; 34 | private static $font_path = '/sweany/captcha/captcha.ttf'; 35 | 36 | 37 | /** 38 | * Return a renderable captcha image 39 | * 40 | * @param string $alt Img Alternative Text 41 | * @param mixed[] $options Options for the img tag 42 | * @return string Renderable image tag 43 | */ 44 | public static function img($alt = '', $options = array()) 45 | { 46 | return Html::img(self::$img_path, $alt, $options); 47 | } 48 | 49 | 50 | /** 51 | * Get the characters displayed on the captcha 52 | * 53 | * @return string The characters from the captcha 54 | */ 55 | public static function read($destroy = true) 56 | { 57 | // Get the current captcha text from the session 58 | $text = \Sweany\Session::get('captcha_spam'); 59 | 60 | // Destroy the session 61 | if ($destroy) { 62 | \Sweany\Session::del('captcha_spam'); 63 | } 64 | 65 | return $text; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /sweany/helper/Request.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Request Helper 28 | */ 29 | class Request 30 | { 31 | public static function get($key, $default_val = null) 32 | { 33 | if ( isset($_REQUEST[$key]) ) { 34 | return ( $_REQUEST[$key] ); 35 | } else { 36 | return ( $default_val ); 37 | } 38 | } 39 | 40 | /** 41 | * 42 | * Informs whether or not the controller request 43 | * was done via ajax. 44 | */ 45 | public static function isAjax() 46 | { 47 | return ( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ); 48 | } 49 | 50 | public static function isPost() 51 | {} 52 | public static function isGet() 53 | {} 54 | public static function isPut() 55 | {} 56 | public static function isDelete() 57 | {} 58 | public static function isSSL() 59 | {} 60 | public static function isXml() 61 | {} 62 | public static function isRss() 63 | {} 64 | public static function isAtom() 65 | {} 66 | public static function isMobile() 67 | {} 68 | public static function isWap() 69 | {} 70 | } 71 | -------------------------------------------------------------------------------- /usr/plugins/Contact/tables/ContactTable.php: -------------------------------------------------------------------------------- 1 | 'fk_user_id', // use nice alias here 11 | 'username', 12 | 'name', 13 | 'email', 14 | 'subject', 15 | 'message', 16 | 'is_read', 17 | 'is_archived', 18 | 'is_deleted', 19 | 'referer', 20 | 'useragent', 21 | 'ip', 22 | 'host', 23 | 'session_id', 24 | 'created', 25 | ); 26 | 27 | public $hasCreated = array('created' => 'integer'); 28 | 29 | 30 | public function beforeSave(&$data) 31 | { 32 | $data['name'] = isset($data['name']) ? Strings::removeTags($data['name']) : ''; 33 | $data['email'] = isset($data['email']) ? Strings::removeTags($data['email']) : ''; 34 | $data['message'] = isset($data['message']) ? Strings::removeTags($data['message']) : ''; 35 | 36 | $data['fk_user_id'] = \Sweany\Users::id(); 37 | $data['username'] = \Sweany\Users::name(); 38 | 39 | $data['referer'] = Client::referer(); 40 | $data['useragent'] = Client::useragent(); 41 | $data['ip'] = Client::ip(); 42 | $data['host'] = Client::host(); 43 | $data['session_id'] = Session::id(); 44 | } 45 | 46 | /** 47 | * @override 48 | * @param integer $id Id of entity 49 | * @param void $related No effect here (no relations defined) 50 | * @return boolean success 51 | */ 52 | public function delete($id, $related = true, $force = false) 53 | { 54 | $fields = array( 55 | 'is_deleted' => 1, 56 | ); 57 | return parent::update($id, $fields, 0); 58 | } 59 | public function deleteAll($condition, $related = true, $force = false) 60 | { 61 | $fields = array( 62 | 'is_deleted' => 1, 63 | ); 64 | return parent::updateAll($condition, $fields); 65 | } 66 | 67 | 68 | 69 | public function countNew() 70 | { 71 | $condition = array('`is_read` = :read', array(':read' => 0)); 72 | return $this->count($condition); 73 | } 74 | 75 | public function markRead($id) 76 | { 77 | return $this->update($id, array('is_read' => 1)); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /usr/plugins/Forums/tables/ForumPostsTable.php: -------------------------------------------------------------------------------- 1 | 'integer'); 8 | public $hasCreated = array('created' => 'integer'); 9 | 10 | public $fields = array( 11 | // FIELDS 12 | 'id', 13 | 'fk_forum_thread_id', 14 | 'thread_id' => 'fk_forum_thread_id', 15 | 'fk_user_id', 16 | 'user_id' => 'fk_user_id', 17 | 'title', 18 | 'body', 19 | 'created', 20 | 'modified', 21 | ); 22 | 23 | // many to one 24 | public $belongsTo = array( 25 | 'User' => array( 26 | 'table' => 'core_users', 27 | 'core' => true, 28 | 'primaryKey' => 'id', 29 | 'foreignKey' => 'fk_user_id', 30 | // 'condition' => '', 31 | 'fields' => array('id', 'username'), 32 | // 'subQueries' => array(), 33 | ), 34 | 'Thread' => array( 35 | 'table' => 'forum_threads', 36 | 'plugin' => 'Forums', 37 | 'primaryKey' => 'id', 38 | 'foreignKey' => 'fk_forum_thread_id', 39 | // 'condition' => '', 40 | 'fields' => array('id', 'title', 'fk_forum_forums_id', 'seo_url', 'is_locked', 'is_closed'), 41 | // 'subQueries' => array(''), 42 | ), 43 | ); 44 | 45 | /************************************************** GET FUNCTIONS **************************************************/ 46 | 47 | public function countUserPosts($user_id) 48 | { 49 | $condition = array('`fk_user_id` = :uid', array(':uid' => $user_id)); 50 | return $this->count($condition); 51 | } 52 | 53 | /************************************************** INSERT/UPDATE FUNCTIONS **************************************************/ 54 | 55 | /** 56 | * @Override 57 | */ 58 | public function beforeSave(&$data) 59 | { 60 | $data['title'] = Strings::removeTags($data['title']); 61 | } 62 | public function afterSave($Post) 63 | { 64 | $Thread = Loader::loadTable('ForumThreads', 'Forums'); 65 | $tid = $Post->fk_forum_thread_id; 66 | 67 | $data['last_post_created'] = $Post->created; 68 | $data['last_post_id'] = $Post->id; 69 | 70 | $Thread->update($tid, $data); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /usr/plugins/Forums/blocks/view/activity_overview_list.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 29 | 30 | 31 | 32 |
title;?>, username;?>lastEntry;?>
13 |
'text-decoration: underline;')); ?>
14 | 15 |
17 |
18 | 19 | 20 | today, $language->yesterday); ?>
21 | by;?> 22 | 23 | 24 | today, $language->yesterday); ?>
25 | by;?> 26 | 27 |
28 |
33 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/languages/de.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deutsch 8 | de 9 | de-DE 10 | d.m.Y 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Eintrag hinzufügen 21 | Eintrag erfolgreich hinzugefügt 22 | Vielen Dank für deinen Gästebuch-Eintrag. Dieser wird so schnell wie möglich freigeschaltet. 23 | 24 | 25 | 26 | 27 | Gästebuch Eintrag schreiben 28 | Author 29 | Email 30 | Avatar 31 | Auswählen 32 | Eintrag 33 | Captcha 34 | Gib die obigen Zahlen/Buchstaben hier ein 35 | Hinzufügen 36 | Gibt bitte mindestens 3 Zeichen ein 37 | Du solltest schon etwas schreiben 38 | Der ausgewählte Avatar ist ungültig 39 | Das eingegebene Captcha war leider falsch 40 | Bots sind nicht erlaubt 41 | 42 | 43 | Gästebuch Eintrag schreiben 44 | Avatar 45 | Auswählen 46 | Eintrag 47 | Hinzufügen 48 | Du solltest schon etwas schreiben 49 | Der ausgewählte Avatar ist ungültig 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /usr/plugins/Guestbook/config.php: -------------------------------------------------------------------------------- 1 | input.value.length) 70 | { 71 | pos = input.value.length; 72 | } 73 | /* 02) Insert format code */ 74 | var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:"); 75 | input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /sweany/helper/Url.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * URL Helper 28 | */ 29 | 30 | /** 31 | * TODO: coreUrl and this class still need to be seperated 32 | * and rewritten! 33 | * 34 | */ 35 | class Url 36 | { 37 | public static function getController() 38 | { 39 | return \Sweany\Url::getController(); 40 | } 41 | 42 | public static function getMethod() 43 | { 44 | return \Sweany\Url::getMethod(); 45 | } 46 | 47 | public static function getParams() 48 | { 49 | return \Sweany\Url::getParams(); 50 | } 51 | public static function getRequest() 52 | { 53 | return \Sweany\Url::getRequest(); 54 | } 55 | 56 | /** 57 | * 58 | * Get http|https and domain 59 | */ 60 | public static function getSiteUrl() 61 | { 62 | $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://'; 63 | $domainName = $_SERVER['HTTP_HOST']; 64 | return $protocol.$domainName; 65 | } 66 | 67 | public static function getFullUrl() 68 | { 69 | return self::getSiteUrl().$_SERVER['REQUEST_URI']; 70 | } 71 | 72 | public static function cleanUrlParams($urlParamString) 73 | { 74 | $clean = preg_replace("/[^a-zA-Z0-9.\/_|+ -]/", '', $urlParamString); 75 | $clean = preg_replace("/[\/|+ -]+/", '-', $clean); 76 | return ($clean); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /usr/plugins/Forums/pages/view/add_thread.tpl.php: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | isLoggedIn()):?> 5 |
6 |
createThread; ?>
7 |

createLoginNote; ?> here, $userLoginCtl,$userLoginMethod);?> or;?> registerFree, $userRegisterCtl,$userRegisterMethod);?>

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 |
preview; ?>
20 |
21 |
22 |

26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 64 | 65 | 66 |
44 | 45 |
createThread; ?>

46 | title.':
'; 50 | echo Form::getError('title'); 51 | echo Form::inputField('title', NULL, array('size' => 50)).BR; 52 | echo $language->message.':'; 53 | echo Form::getError('body'); ?> 54 |
55 | 'postBody'))?> 56 |

57 | id); 59 | echo Form::submitButton('add_thread_submit', $language->create); 60 | echo Form::submitButton('add_thread_preview', $language->preview); 61 | echo Form::end(); 62 | ?>
63 |
67 | 68 | -------------------------------------------------------------------------------- /sweany/core/Config.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.8 2012-09-17 11:08 25 | * 26 | * 27 | * This Module provides global configuration settings for config.php 28 | * and all plugin config.php files 29 | * 30 | */ 31 | 32 | class Config 33 | { 34 | /** 35 | * 36 | * Store for variable values 37 | * @var mixed[] 38 | */ 39 | private static $store = null; 40 | 41 | 42 | 43 | /** 44 | * 45 | * Set the config value for a given variable 46 | * @param string $var Variable Name 47 | * @param mixed $val Variable Value 48 | * @param string $scope Scope Name 49 | */ 50 | public static function set($var, $val, $scope = 'globals') 51 | { 52 | self::$store[$scope][$var] = $val; 53 | } 54 | 55 | /** 56 | * 57 | * Get the config value for a given variable 58 | * @param string $var Variable Name 59 | * @param string $scope Scope Name 60 | * @return mixed value 61 | */ 62 | public static function get($var, $scope = 'globals') 63 | { 64 | return isset(self::$store[$scope][$var]) ? self::$store[$scope][$var] : null; 65 | } 66 | 67 | /** 68 | * 69 | * Check if configuration has been set 70 | * @param string $var Variable Name 71 | * @param string $scope Scope Name 72 | * @return boolean exists 73 | */ 74 | public static function exists($var, $scope = 'globals') 75 | { 76 | return isset(self::$store[$scope][$var]); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /usr/pages/controller/Home.php: -------------------------------------------------------------------------------- 1 | attachBlock() 17 | $this->attachPluginBlock('bForumThreads', 'Forums', 'Forum', 'ActivityOverview', array(6)); 18 | 19 | // Set variables for the view 20 | // This sets the language class to the view 21 | // The language elements $language->foo 22 | // are bound to this page with id="index" 23 | // from language xml file 24 | $this->set('language', $this->core->language); 25 | $this->set('user', $this->core->user); 26 | 27 | // Logging (demonstration) 28 | // You can log various stuff to file via this helper 29 | LogCat::i('some info text for the log file'); 30 | LogCat::w('error occured here'); 31 | 32 | 33 | // Specify the view to be used for this function. 34 | // You can also have multiple views for a single function via 35 | // $this->views() 36 | $this->view('index'); 37 | 38 | // If not specified, the default layout will be used 39 | // the default layout view can also be modified, but then there 40 | // will be no layout controller available. 41 | // default view is usr/layout/view/template.tpl.php 42 | // The view for Layouts->FrontPage is specified 43 | // in Layouts Controller in the function 'FrontPage' 44 | // This function loads the login/logout block 45 | $this->layout('Layouts', 'FrontPage'); 46 | 47 | // Loading additional css file 48 | // Just for demonstration purposes 49 | Css::addFile('/css/test.css'); 50 | 51 | 52 | // ADD TEMPLATE ELEMENTS 53 | // If not set, each page will use the 54 | // default title, keywords, description 55 | // from config.php 56 | // Set only for demonstration purposes. 57 | 58 | // Set the page title 59 | HtmlTemplate::setTitle('Home'); 60 | 61 | // Set seo keywords 62 | HtmlTemplate::setKeywords('sweany php, mvc framework'); 63 | 64 | // Set seo description 65 | HtmlTemplate::setDescription('Sweany PHP - performant mvc framework'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /sweany/core/validator/Validate08LogVisitors.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.validator 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-08-08 11:25 25 | * 26 | * 27 | * This (optional) core will validate various settings of 28 | * the framework itself. 29 | */ 30 | namespace Sweany; 31 | class Validate08LogVisitors extends aBootTemplate 32 | { 33 | /* ******************************************** OVERRIDE INITIALIZE ********************************************/ 34 | public static function initialize($options = null) 35 | { 36 | if ( $GLOBALS['SQL_LOG_VISITORS_ENABLE'] == true ) 37 | { 38 | if ( !self::_checkLogVisitors() ) 39 | { 40 | echo '

Validation Error

'; 41 | echo self::$error; 42 | return false; 43 | } 44 | } 45 | return true; 46 | } 47 | 48 | 49 | 50 | /* ******************************************** VALIDATORS ********************************************/ 51 | 52 | private static function _checkLogVisitors() 53 | { 54 | $db = \Sweany\Database::getInstance(); 55 | 56 | if ( $GLOBALS['SQL_ENABLE'] == false ) 57 | { 58 | self::$error = 'Log Visitors Module: You have to enable SQL Module in order to use it.'; 59 | return false; 60 | } 61 | // CHECK SQL TABLES 62 | if ( count($db->select("show tables from `$GLOBALS[SQL_DB]` like 'core_visitors'; ")) < 1 ) 63 | { 64 | self::$error = 'MySQL: core_visitors table does not exist'; 65 | return false; 66 | } 67 | return true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /sweany/core/helper/History.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Class that stores the Users History 28 | */ 29 | namespace Sweany; 30 | class History 31 | { 32 | private static $lastPage = array(); 33 | 34 | public static function track() 35 | { 36 | $controller = \Sweany\Url::getController(); 37 | $method = \Sweany\Url::getMethod(); 38 | $params = \Sweany\Url::getParams(); 39 | 40 | // If no params are specified and the method name is equal to the default method name 41 | // we will remove it, so the redirect will look nicer by not specifying the method 42 | if ( !count($params) && $method == $GLOBALS['ANY_CONTROLLER_DEFAULT_METHOD'] ) 43 | { 44 | $method = null; 45 | $params = null; 46 | } 47 | $history = array('controller' => $controller, 'method' => $method, 'params' => $params); 48 | 49 | \Sweany\Session::set(array(\Sweany\Settings::sessSweany => \Sweany\Settings::sessHistory), $history); 50 | } 51 | 52 | public static function getPrevPage() 53 | { 54 | if ( \Sweany\Session::exists(\Sweany\Settings::sessSweany, \Sweany\Settings::sessHistory) ) 55 | { 56 | return \Sweany\Session::get(\Sweany\Settings::sessSweany, \Sweany\Settings::sessHistory); 57 | } 58 | // No previous page exists yet, so redirect to '/' by setting all params to null 59 | else 60 | { 61 | return array('controller' => null, 'method' => null, 'params' => null); 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /sweany/core/skeletons/html/default.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | xml:lang="" dir="ltr" lang="" > 3 | > 4 | <?php echo strlen(HtmlTemplate::getTitle())?HtmlTemplate::getTitle():$GLOBALS['HTML_DEFAULT_PAGE_TITLE'];?> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | > 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /sweany/core/bootstrap/aBootTemplate.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.init 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * All core modules (sys/core/*) must implement this class 28 | * and override their own 'initialize()' function. 29 | * 30 | */ 31 | namespace Sweany; 32 | 33 | class aBootTemplate 34 | { 35 | /** 36 | * 37 | * Will contain the error message (if any) 38 | * that occured during core module initialization 39 | * (see www/index.php for handling) 40 | */ 41 | protected static $error = null; 42 | 43 | /** 44 | * 45 | * Initialize Function for the core moduls 46 | * The inherited calsses MUST define their own init() function 47 | * otherwise we will throw an error 48 | */ 49 | public static function initialize($options = null) 50 | { 51 | self::$error = 'initialize() function not defined'; 52 | return false; 53 | } 54 | 55 | 56 | /** 57 | * Some core modules do need a destroy function] 58 | * E.g. MySQL needs to close the link at the end 59 | * So that we do not forget about this, we have to override 60 | * This destroy function as it will be called at the end in (index.php) 61 | * If it is not overriden we will point it out by being childish and dont start 62 | * the page 63 | */ 64 | public static function cleanup() 65 | { 66 | } 67 | 68 | 69 | /** 70 | * 71 | * Used to return the error that happened during Core initialization 72 | */ 73 | public static function getError() 74 | { 75 | return self::$error; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /sweany/core/bootstrap/Validator.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.init 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-08-08 11:25 25 | * 26 | * 27 | * This (optional) core will validate various settings of 28 | * the framework itself. 29 | */ 30 | namespace Sweany; 31 | 32 | class Validator extends aBootTemplate 33 | { 34 | 35 | /* ******************************************** OVERRIDE INITIALIZE ********************************************/ 36 | public static function initialize($options = null) 37 | { 38 | ini_set('display_errors', 1); 39 | error_reporting(-1); 40 | 41 | if ( !\Sweany\Validate01Basics::initialize($options) ) 42 | { 43 | return false; 44 | } 45 | if ( !\Sweany\Validate02Config::initialize($options) ) 46 | { 47 | return false; 48 | } 49 | if ( !\Sweany\Validate03Language::initialize($options) ) 50 | { 51 | return false; 52 | } 53 | if ( !\Sweany\Validate04Database::initialize($options) ) 54 | { 55 | return false; 56 | } 57 | if ( !\Sweany\Validate05Tables::initialize($options) ) 58 | { 59 | return false; 60 | } 61 | if ( !\Sweany\Validate06User::initialize($options) ) 62 | { 63 | return false; 64 | } 65 | if ( !\Sweany\Validate07UserOnlineCount::initialize($options) ) 66 | { 67 | return false; 68 | } 69 | if ( !\Sweany\Validate08LogVisitors::initialize($options) ) 70 | { 71 | return false; 72 | } 73 | if ( !\Sweany\Validate09Plugins::initialize($options) ) 74 | { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /sweany/helper/Session.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Session Helper 28 | */ 29 | class Session 30 | { 31 | 32 | /* ******************************************** GET ********************************************/ 33 | 34 | public static function id() 35 | { 36 | return session_id(); 37 | } 38 | 39 | public static function get($key = null, $subKey = null, $subSubKey = null, $subSubSubKey = null) 40 | { 41 | return \Sweany\Session::get($key, $subKey, $subSubKey, $subSubSubKey); 42 | } 43 | 44 | 45 | 46 | 47 | /* ******************************************** SET ********************************************/ 48 | public static function set($key, $val) 49 | { 50 | return \Sweany\Session::set($key, $val); 51 | } 52 | 53 | 54 | 55 | /* ******************************************** CHECK ********************************************/ 56 | 57 | public static function exists($key, $subKey = null, $subSubKey = null, $subSubSubKey = null) 58 | { 59 | return \Sweany\Session::exists($key, $subKey, $subSubKey, $subSubSubKey); 60 | } 61 | 62 | 63 | 64 | /* ******************************************** DELETE ********************************************/ 65 | 66 | public static function del($key, $subKey = null, $subSubKey = null, $subSubSubKey = null) 67 | { 68 | \Sweany\Session::del($key, $subKey, $subSubKey, $subSubSubKey); 69 | } 70 | 71 | 72 | public static function destroy() 73 | { 74 | \Sweany\Session::destroy(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /usr/plugins/User/blocks/view/form_register.tpl.php: -------------------------------------------------------------------------------- 1 | 'disabled'); 8 | $class = 'userRegistrationFormDisabled'; 9 | } 10 | else 11 | { 12 | $options = array(); 13 | $class = 'userRegistrationFormEnabled'; 14 | } 15 | ?> 16 | 17 | 18 | registerForFree); ?> 19 | '.$language->registrationDisabled.'

'; } ?> 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
username;?>:
email;?>:
password;?>:
terms;?>: 41 | 42 | IHerebyAccept, ''.$language->dataPolicy.'', ''.$language->terms.'');?> 43 |

register, $options); ?>
54 | 55 | 56 | -------------------------------------------------------------------------------- /sweany/core/validator/Validate06User.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.validator 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-08-08 11:25 25 | * 26 | * 27 | * This (optional) core will validate various settings of 28 | * the framework itself. 29 | */ 30 | namespace Sweany; 31 | class Validate06User extends aBootTemplate 32 | { 33 | /* ******************************************** OVERRIDE INITIALIZE ********************************************/ 34 | public static function initialize($options = null) 35 | { 36 | if ( $GLOBALS['USER_ENABLE'] == true ) 37 | { 38 | if ( !self::_checkUser() ) 39 | { 40 | echo '

Validation Error: User

'; 41 | echo self::$error; 42 | return false; 43 | } 44 | } 45 | return true; 46 | } 47 | 48 | private static function _checkUser() 49 | { 50 | $db = \Sweany\Database::getInstance(); 51 | 52 | if ( $GLOBALS['SQL_ENABLE'] == false ) 53 | { 54 | self::$error = 'User Module: You have to enable SQL Module in order to use it.'; 55 | return false; 56 | } 57 | 58 | // CHECK SQL TABLES 59 | if ( count($db->select("show tables from `$GLOBALS[SQL_DB]` like '".Settings::tblUsers."'; ")) < 1 ) 60 | { 61 | self::$error = 'Database: '.Settings::tblUsers.' table does not exist'; 62 | return false; 63 | } 64 | if ( count($db->select("show tables from `$GLOBALS[SQL_DB]` like '".Settings::tblFailedLogins."'; ")) < 1 ) 65 | { 66 | self::$error = 'Database: '.Settings::tblFailedLogins.' table does not exist'; 67 | return false; 68 | } 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /sweany/core/built-in/PageModel.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Abstract parent for page modesl 28 | */ 29 | abstract Class PageModel 30 | { 31 | /* ***************************************************** VARIABLES ***************************************************** */ 32 | 33 | /** 34 | * 35 | * Which Tables to autoload into this Model 36 | * 37 | * @param mixed[] $tables 38 | * 39 | * @format 40 | * $tables = Array 41 | * ( 42 | * '', # tables in the usr/tables folder 43 | * ' => '', # tables in the usr/plugins//tables folder 44 | * ); 45 | */ 46 | protected $tables = array(); 47 | 48 | 49 | /* ***************************************************** Constructor ***************************************************** */ 50 | 51 | public function __construct() 52 | { 53 | // Tables are only instanciated, if we use SQL, otherwise 54 | // we will not have access to any tables 55 | if ( $GLOBALS['SQL_ENABLE'] ) 56 | { 57 | // initialize table helpers 58 | foreach ($this->tables as $plugin => $table) 59 | { 60 | if ( is_array($table) ) 61 | { 62 | foreach ($table as $pluginTable) 63 | { 64 | $new_var = $pluginTable; 65 | $this->$new_var = \Sweany\AutoLoader::loadPluginTable($pluginTable, $plugin, 'user'); 66 | } 67 | } 68 | else 69 | { 70 | $new_var = $table; 71 | $this->$new_var = \Sweany\AutoLoader::loadTable($table, 'user'); 72 | } 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /usr/plugins/Message/pages/view/alerts.tpl.php: -------------------------------------------------------------------------------- 1 |
2 | new, 'Message', 'write');?> 3 |
4 |
5 | inbox, 'Message', 'inbox');?> 6 |
7 |
8 | alerts, 'Message', 'alerts');?> 9 |
10 |
11 | archive, 'Message', 'archive');?> 12 |
13 |
14 | trash, 'Message', 'trash');?> 15 |
16 |
17 | outbox, 'Message', 'outbox');?> 18 |
19 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 | is_read )? array('style' => 'font-weight: bold;') : null; ?> 52 | is_read ) ? 'flag_msg_read.png' : 'flag_msg_new.png'; ?> 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
#from;?>subject;?>received;?>

43 | newAlert;?>
44 | readAlert;?>
45 |
subject, $className, 'alert', array($message->id), $style); ?>created).', '.TimeHelper::date($language->getCustom('/root/core/settings', 'date_format'), $message->created); ?>created); ?>
65 |
66 | -------------------------------------------------------------------------------- /www/sweany/debug.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sweany MVC PHP framework 3 | * Copyright (C) 2011-2012 cytopia. 4 | * 5 | * Sweany is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * Sweaby is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with Sweany. If not, see . 17 | * 18 | * @copyright Copyright 2011-2012, cytopia 19 | * @link none yet 20 | * @package javascript 21 | * @author cytopia 22 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 23 | * @version 0.7 2012-08-15 13:25 24 | * 25 | * 26 | * CSS Debugging Helper 27 | */ 28 | 29 | 30 | /* 31 | * Array of colors 32 | */ 33 | var colors = new Array( 34 | '#A52A2A', 35 | '#8A2BE2', 36 | '#5F9EA0', 37 | '#D2691E', 38 | '#7FFF00', 39 | '#00008B', 40 | '#008B8B', 41 | '#B8860B', 42 | '#DEB887', 43 | '#DC143C', 44 | '#6495ED', 45 | '#A9A9A9', 46 | '#006400', 47 | '#FF8C00', 48 | '#E9967A', 49 | '#8FBC8F', 50 | '#483D8B', 51 | '#2F4F4F', 52 | '#228B22', 53 | '#ADFF2F', 54 | '#FF69B4', 55 | '#CD5C5C', 56 | '#FAEBD7', 57 | '#00FFFF', 58 | '#0000FF' 59 | ); 60 | 61 | /* 62 | * php like rand function 63 | */ 64 | /* 65 | function rand(from, to) 66 | { 67 | return Math.floor(Math.random() * (to - from + 1) + from); 68 | } 69 | */ 70 | /* 71 | * decimal to hex 72 | */ 73 | /* 74 | function d2h(d) 75 | { 76 | return d.toString(16); 77 | } 78 | */ 79 | function getColor(count) 80 | { 81 | var size = colors.length; 82 | /* reset to beginning if count exceeds size of color array */ 83 | count = (count >= size) ? count-size : count; 84 | return colors[count]; 85 | 86 | // return colors[rand(0,size-1)]; 87 | } 88 | 89 | /* 90 | * colorize Divs 91 | */ 92 | function debugDiv() 93 | { 94 | var divs = document.getElementsByTagName("div"); 95 | 96 | for (var i = 0; i < divs.length; i++) 97 | { 98 | divs[i].style.backgroundColor = getColor(i); /*"#" + d2h(rand(0,16))+d2h(rand(0,16))+d2h(rand(0,16));*/ 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /usr/plugins/Forums/tables/ForumForumsTable.php: -------------------------------------------------------------------------------- 1 | 'fk_forum_category_id', // Alias for better readability 11 | 'sort', 12 | 'display', 13 | 'can_create', 14 | 'can_reply', 15 | 'name', 16 | 'description', 17 | 'icon', 18 | 'seo_url', 19 | 'created', 20 | 'modified', 21 | ); 22 | 23 | public $hasMany = array( 24 | 'LastThread' => array( 25 | 'table' => 'forum_threads', 26 | 'plugin' => 'Forums', 27 | 'foreignKey' => 'fk_forum_forums_id', 28 | 'condition' => '', 29 | 'fields' => array('id', 'title', 'fk_user_id', 'seo_url', 'created', 'last_post_id', 'last_post_created'), 30 | 'subQueries' => array( 31 | 'username' => 'SELECT username FROM core_users WHERE core_users.id = LastThread.fk_user_id', 32 | 'post_count' => 'SELECT COUNT(*) FROM forum_posts WHERE forum_posts.id = LastThread.last_post_id', 33 | 'post_title' => 'SELECT title FROM forum_posts WHERE forum_posts.id = LastThread.last_post_id', 34 | 'post_user_id' => 'SELECT fk_user_id FROM forum_posts WHERE forum_posts.id = LastThread.last_post_id', 35 | 'post_username' => 'SELECT username FROM core_users WHERE core_users.id = (SELECT fk_user_id FROM forum_posts WHERE forum_posts.id = LastThread.last_post_id)', 36 | ), 37 | 'order' => array('GREATEST(LastThread.created, LastThread.last_post_created)'=>'DESC'), 38 | 'limit' => 1, 39 | 'flatten' => true, 40 | 'dependent' => false, 41 | ), 42 | 'Thread' => array( 43 | 'table' => 'forum_threads', 44 | 'plugin' => 'Forums', 45 | 'foreignKey' => 'fk_forum_forums_id', 46 | 'fields' => array('id', 'title', 'body', 'view_count', 'is_sticky', 'is_locked', 'is_closed', 'fk_user_id', 'seo_url', 'created', 'last_post_id', 'last_post_created'), 47 | 'subQueries' => array( 48 | 'username' => 'SELECT username FROM core_users WHERE core_users.id = Thread.fk_user_id', 49 | 'post_count' => 'SELECT COUNT(*) FROM forum_posts WHERE forum_posts.fk_forum_thread_id = Thread.id', 50 | ), 51 | 'order' => array( 52 | 'Thread.is_sticky' => 'DESC', 53 | 'GREATEST(Thread.created, Thread.last_post_created)' => 'DESC', 54 | ), 55 | 'recursive' => array( 56 | 'hasMany' => array('LastPost'), 57 | 'hasAndBelongsToMany' => array('UserHasRead'), 58 | ), 59 | 'dependent' => false, 60 | ), 61 | ); 62 | 63 | public $hasOne = array(); 64 | } 65 | -------------------------------------------------------------------------------- /sweany/helper/Css.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * CSS Helper 28 | */ 29 | Class Css 30 | { 31 | private static $css_files = array(); 32 | private static $css_inline = array(); 33 | 34 | 35 | /********************************************************* A C T I O N F U N C T I O N S *********************************************************/ 36 | 37 | public static function addFile($file) 38 | { 39 | $size = sizeof(self::$css_files); 40 | 41 | if ( $GLOBALS['ECSS_ENABLE'] ) 42 | { 43 | $options = ''; 44 | $options .= ( $GLOBALS['ECSS_COMPRESSED'] ) ? '&compressed' : ''; 45 | $options .= ( $GLOBALS['ECSS_COMMENTED'] ) ? '&comment' : ''; 46 | 47 | $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://'; 48 | $domain = $_SERVER['HTTP_HOST']; 49 | $file = '/sweany/ecss.php?file='.$protocol.$domain.$file.$options; 50 | } 51 | self::$css_files[$size] = ''; 52 | } 53 | 54 | public static function addInlineCss($css_code) 55 | { 56 | self::$css_inline[] = $css_code; 57 | } 58 | 59 | public static function getFiles() 60 | { 61 | $code = ''; 62 | 63 | foreach (self::$css_files as $file) { 64 | $code .= "\t".$file."\n"; 65 | } 66 | return $code; 67 | } 68 | 69 | public static function getInlineCss() 70 | { 71 | $code = implode("\n", self::$css_inline); 72 | $pre = ''; 74 | 75 | $code = isset($code[0]) ? $pre.$code.$post : ''; 76 | 77 | return $code; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /sweany/core/validator/Validate09Plugins.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.validator 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-08-08 11:25 25 | * 26 | * 27 | * This (optional) core will validate various settings of 28 | * the framework itself. 29 | */ 30 | namespace Sweany; 31 | class Validate09Plugins extends aBootTemplate 32 | { 33 | /* ******************************************** OVERRIDE INITIALIZE ********************************************/ 34 | public static function initialize($options = null) 35 | { 36 | if ( !self::_checkPlugins() ) 37 | { 38 | echo '

Validation Error: Plugins

'; 39 | echo self::$error; 40 | return false; 41 | } 42 | return true; 43 | } 44 | 45 | 46 | /* ******************************************** VALIDATORS ********************************************/ 47 | 48 | private static function _checkPlugins() 49 | { 50 | if ( $handle = opendir(USR_PLUGINS_PATH) ) 51 | { 52 | while ( false !== ($file = readdir($handle)) ) 53 | { 54 | if ( $file != '.' && $file != '..' && is_dir(USR_PLUGINS_PATH.DS.$file) ) 55 | { 56 | $validatorClass = 'Validate'.$file; 57 | $validatorPath = USR_PLUGINS_PATH.DS.$file.DS.$validatorClass.'.php'; 58 | if ( is_file($validatorPath) ) 59 | { 60 | // Load Plugin Config before validation 61 | if ( is_file(USR_PLUGINS_PATH.DS.$file.DS.'config.php') ) 62 | { 63 | require_once(USR_PLUGINS_PATH.DS.$file.DS.'config.php'); 64 | } 65 | 66 | // Load Validator 67 | require($validatorPath); 68 | 69 | if ( !$validatorClass::initialize() ) 70 | { 71 | return false; 72 | } 73 | } 74 | } 75 | } 76 | } 77 | return true; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /usr/plugins/Forums/blocks/view/activity_overview.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | User->username, $userProfileCtl, $userProfileMethod, array($Thread->User->id)) : $Thread->User->username; ?> 15 | 16 | 20 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
title;?>, username;?>lastEntry;?>answers;?>views;?>forum;?>
17 |
title, 30, true), 'Forums', 'showThread', array($Thread->Forum->id, $Thread->id, $Thread->seo_url), array('style' => 'text-decoration: underline;')); ?>
18 | 19 |
21 |
22 | LastPost->id)): ?> 23 | LastPost->username, $userProfileCtl, $userProfileMethod, array($Thread->LastPost->fk_user_id)) : $Thread->LastPost->username;?> 24 | LastPost->created, array($language->today, $language->yesterday)); ?> LastPost->created);?>
25 | by;?> 26 | 27 | User->username, $userProfileCtl, $userProfileMethod, array($Thread->User->id)) : $Thread->User->username;?> 28 | created, array($language->today, $language->yesterday)); ?> created);?>
29 | by;?> 30 | 31 |
32 |
post_count; ?>view_count; ?>Forum->name, 'Forums', 'showForum', array($Thread->Forum->id, $Thread->Forum->seo_url)); ?>
40 | -------------------------------------------------------------------------------- /sweany/core/bootstrap/Database.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.core.init 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Database Wrapper. 28 | */ 29 | namespace Sweany; 30 | 31 | class Database extends aBootTemplate 32 | { 33 | private static $db = null; 34 | private static $engine = null; 35 | private static $class = null; 36 | 37 | /*********************************************** OVERRIDE INITIALIZE ***********************************************/ 38 | 39 | public static function initialize($options = null) 40 | { 41 | $options['host'] = $GLOBALS['SQL_HOST']; 42 | $options['database'] = $GLOBALS['SQL_DB']; 43 | $options['user'] = $GLOBALS['SQL_USER']; 44 | $options['pass'] = $GLOBALS['SQL_PASS']; 45 | 46 | self::$engine = $GLOBALS['SQL_ENGINE']; 47 | self::$class = '\Sweany\\'.self::$engine; 48 | 49 | $engine = self::$engine; 50 | $class = self::$class; 51 | 52 | // TODO: if validator mode is on 53 | // check if file exists 54 | require_once(CORE_DATABASE.DS.'iDBO.php'); 55 | require_once(CORE_DATABASE.DS.$engine.'.php'); 56 | 57 | // Check if the database engine implements required interface class 58 | if ( !$class::_implemented ) 59 | { 60 | self::$error = 'Database engine: \''.$engine.'\' does not implement interface iDataBase'; 61 | return false; 62 | } 63 | 64 | // Initialize Database Connection 65 | if ( !$class::initialize($options) ) 66 | { 67 | self::$error = $class::getError(); 68 | return false; 69 | } 70 | 71 | return true; 72 | } 73 | 74 | 75 | /*********************************************** OVERRIDE CLEANUP ***********************************************/ 76 | 77 | public static function cleanup() 78 | { 79 | $class = self::$class; 80 | $class::cleanup(); 81 | } 82 | 83 | public static function getInstance() 84 | { 85 | if ( !self::$db ) 86 | { 87 | $class = self::$class; 88 | self::$db = new $class; 89 | } 90 | return self::$db; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /usr/plugins/User/config.php: -------------------------------------------------------------------------------- 1 | . 18 | * 19 | * @copyright Copyright 2011-2012, cytopia 20 | * @link none yet 21 | * @package sweany.lib 22 | * @author cytopia 23 | * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html 24 | * @version 0.7 2012-07-29 13:25 25 | * 26 | * 27 | * Project Log Helper 28 | */ 29 | 30 | class LogCat 31 | { 32 | /****************************************** V A R I A B L E S ******************************************/ 33 | 34 | 35 | 36 | 37 | 38 | /****************************************** F U N C T I O N S ******************************************/ 39 | 40 | 41 | /** 42 | * 43 | * Error 44 | * 45 | * @param String $message 46 | * Error message 47 | * 48 | */ 49 | public static function e($message) 50 | { 51 | self::_logToFile('ERROR', $message); 52 | } 53 | 54 | /** 55 | * 56 | * Warning 57 | * 58 | * @param String $message 59 | * Error message 60 | */ 61 | public static function w($message) 62 | { 63 | self::_logToFile('WARNING', $message); 64 | } 65 | 66 | /** 67 | * 68 | * Info 69 | * 70 | * @param String $title 71 | * Title for the error 72 | * 73 | */ 74 | public static function i($message) 75 | { 76 | self::_logToFile('INFO', $message); 77 | } 78 | 79 | 80 | 81 | /****************************************** P R I V A T E F U N C T I O N S ******************************************/ 82 | 83 | private static function _logToFile($type, $message) 84 | { 85 | // fopen, fwrite, fclose is the faster than file_put_contents (which isjust a wrapper for that) 86 | // fopen, fputs, fclose is fastest 87 | $fp = fopen(LOG_PATH.DS.$GLOBALS['FILE_LOG_USER'], 'a'); 88 | 89 | $type_len = strlen($type); 90 | $head = '['.date('Y-m-d H:i:s').'] ---- ['.$type.'] '.self::_getChars(50-$type_len, '-'); 91 | 92 | fputs($fp, $head."\n\r"); 93 | fputs($fp, $message."\n\r\n\r"); 94 | fclose($fp); 95 | } 96 | 97 | private static function _getChars($num, $char) 98 | { 99 | $space =''; 100 | for ($i=0; $i<$num; $i++) { 101 | $space .= $char; 102 | } 103 | return $space; 104 | } 105 | } 106 | --------------------------------------------------------------------------------