]> git.mxchange.org Git - mailer.git/commitdiff
Re-added
authorRoland Häder <roland@mxchange.org>
Thu, 2 Oct 2008 16:36:20 +0000 (16:36 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 2 Oct 2008 16:36:20 +0000 (16:36 +0000)
504 files changed:
.gitattributes
inc/.htaccess [new file with mode: 0644]
inc/autopurge.php [new file with mode: 0644]
inc/autopurge/.htaccess [new file with mode: 0644]
inc/autopurge/purge- [new file with mode: 0644]
inc/autopurge/purge-general.php [new file with mode: 0644]
inc/autopurge/purge-inact.php [new file with mode: 0644]
inc/autopurge/purge-mails.php [new file with mode: 0644]
inc/autopurge/purge-tsks.php [new file with mode: 0644]
inc/autopurge/purge-unconfirmed.php [new file with mode: 0644]
inc/cache/.htaccess [new file with mode: 0644]
inc/check-reset.php [new file with mode: 0644]
inc/databases.php [new file with mode: 0644]
inc/db/.htaccess [new file with mode: 0644]
inc/db/lib-mysql3.php [new file with mode: 0644]
inc/db/lib.php [new file with mode: 0644]
inc/doubler_send.php [new file with mode: 0644]
inc/extensions.php [new file with mode: 0644]
inc/extensions/.htaccess [new file with mode: 0644]
inc/extensions/ext- [new file with mode: 0644]
inc/extensions/ext-active.php [new file with mode: 0644]
inc/extensions/ext-admins.php [new file with mode: 0644]
inc/extensions/ext-admintheme1.php [new file with mode: 0644]
inc/extensions/ext-admintheme_default.php [new file with mode: 0644]
inc/extensions/ext-autopurge.php [new file with mode: 0644]
inc/extensions/ext-bank.php [new file with mode: 0644]
inc/extensions/ext-beg.php [new file with mode: 0644]
inc/extensions/ext-birthday.php [new file with mode: 0644]
inc/extensions/ext-bonus.php [new file with mode: 0644]
inc/extensions/ext-cache.php [new file with mode: 0644]
inc/extensions/ext-country.php [new file with mode: 0644]
inc/extensions/ext-demo.php [new file with mode: 0644]
inc/extensions/ext-doubler.php [new file with mode: 0644]
inc/extensions/ext-holiday.php [new file with mode: 0644]
inc/extensions/ext-html_mail.php [new file with mode: 0644]
inc/extensions/ext-mailid.php [new file with mode: 0644]
inc/extensions/ext-maintenance.php [new file with mode: 0644]
inc/extensions/ext-mediadata.php [new file with mode: 0644]
inc/extensions/ext-mods.php [new file with mode: 0644]
inc/extensions/ext-mydata.php [new file with mode: 0644]
inc/extensions/ext-newsletter.php [new file with mode: 0644]
inc/extensions/ext-nickname.php [new file with mode: 0644]
inc/extensions/ext-online.php [new file with mode: 0644]
inc/extensions/ext-optimize.php [new file with mode: 0644]
inc/extensions/ext-order.php [new file with mode: 0644]
inc/extensions/ext-other.php [new file with mode: 0644]
inc/extensions/ext-payout.php [new file with mode: 0644]
inc/extensions/ext-primera.php [new file with mode: 0644]
inc/extensions/ext-profile.php [new file with mode: 0644]
inc/extensions/ext-rallye.php [new file with mode: 0644]
inc/extensions/ext-refback.php [new file with mode: 0644]
inc/extensions/ext-register.php [new file with mode: 0644]
inc/extensions/ext-removeip.php [new file with mode: 0644]
inc/extensions/ext-repair.php [new file with mode: 0644]
inc/extensions/ext-rewrite.php [new file with mode: 0644]
inc/extensions/ext-safe.php [new file with mode: 0644]
inc/extensions/ext-sponsor.php [new file with mode: 0644]
inc/extensions/ext-sql_patches.php [new file with mode: 0644]
inc/extensions/ext-support.php [new file with mode: 0644]
inc/extensions/ext-surfbar.php [new file with mode: 0644]
inc/extensions/ext-task.php [new file with mode: 0644]
inc/extensions/ext-theme.php [new file with mode: 0644]
inc/extensions/ext-top10.php [new file with mode: 0644]
inc/extensions/ext-transfer.php [new file with mode: 0644]
inc/extensions/ext-user.php [new file with mode: 0644]
inc/extensions/ext-wernis.php [new file with mode: 0644]
inc/extensions/ext-yoomedia.php [new file with mode: 0644]
inc/fatal_errors.php [new file with mode: 0644]
inc/footer.php [new file with mode: 0644]
inc/functions.php [new file with mode: 0644]
inc/gen_mediadata.php [new file with mode: 0644]
inc/gen_refback.php [new file with mode: 0644]
inc/gen_sql_patches.php [new file with mode: 0644]
inc/header.php [new file with mode: 0644]
inc/install-inc.php [new file with mode: 0644]
inc/language.php [new file with mode: 0644]
inc/language/.htaccess [new file with mode: 0644]
inc/language/active_de.php [new file with mode: 0644]
inc/language/admins_de.php [new file with mode: 0644]
inc/language/autopurge_de.php [new file with mode: 0644]
inc/language/bank_de.php [new file with mode: 0644]
inc/language/beg_de.php [new file with mode: 0644]
inc/language/birthday_de.php [new file with mode: 0644]
inc/language/bonus_de.php [new file with mode: 0644]
inc/language/cache_de.php [new file with mode: 0644]
inc/language/country_de.php [new file with mode: 0644]
inc/language/de.php [new file with mode: 0644]
inc/language/doubler_de.php [new file with mode: 0644]
inc/language/en.ph [new file with mode: 0644]
inc/language/en.php [new file with mode: 0644]
inc/language/holiday_de.php [new file with mode: 0644]
inc/language/html_mail_de.php [new file with mode: 0644]
inc/language/install_de.php [new file with mode: 0644]
inc/language/mailid_de.php [new file with mode: 0644]
inc/language/maintenance_de.php [new file with mode: 0644]
inc/language/mediadata_de.php [new file with mode: 0644]
inc/language/mods_de.php [new file with mode: 0644]
inc/language/newsletter_de.php [new file with mode: 0644]
inc/language/nickname_de.php [new file with mode: 0644]
inc/language/online_de.php [new file with mode: 0644]
inc/language/optimize_de.php [new file with mode: 0644]
inc/language/order_de.php [new file with mode: 0644]
inc/language/other_de.php [new file with mode: 0644]
inc/language/payout_de.php [new file with mode: 0644]
inc/language/primera_de.php [new file with mode: 0644]
inc/language/rallye_de.php [new file with mode: 0644]
inc/language/refback_de.php [new file with mode: 0644]
inc/language/register_de.php [new file with mode: 0644]
inc/language/removeip_de.php [new file with mode: 0644]
inc/language/repair_de.php [new file with mode: 0644]
inc/language/rewrite_de.php [new file with mode: 0644]
inc/language/sponsor_de.php [new file with mode: 0644]
inc/language/support_de.php [new file with mode: 0644]
inc/language/surfbar_de.php [new file with mode: 0644]
inc/language/task_de.php [new file with mode: 0644]
inc/language/theme_de.php [new file with mode: 0644]
inc/language/top10_de.php [new file with mode: 0644]
inc/language/transfer_de.php [new file with mode: 0644]
inc/language/user_de.php [new file with mode: 0644]
inc/language/wernis_de.php [new file with mode: 0644]
inc/libs/.htaccess [new file with mode: 0644]
inc/libs/admins_functions.php [new file with mode: 0644]
inc/libs/autopurge_functions.php [new file with mode: 0644]
inc/libs/bonus_functions.php [new file with mode: 0644]
inc/libs/cache_functions.php [new file with mode: 0644]
inc/libs/country_functions.php [new file with mode: 0644]
inc/libs/doubler_functions.php [new file with mode: 0644]
inc/libs/holiday_functions.php [new file with mode: 0644]
inc/libs/html_mail_functions.php [new file with mode: 0644]
inc/libs/mediadata_functions.php [new file with mode: 0644]
inc/libs/newsletter_functions.php [new file with mode: 0644]
inc/libs/nickname_functions.php [new file with mode: 0644]
inc/libs/optimize_functions.php [new file with mode: 0644]
inc/libs/order_functions.php [new file with mode: 0644]
inc/libs/payout_functions.php [new file with mode: 0644]
inc/libs/primera_functions.php [new file with mode: 0644]
inc/libs/rallye_functions.php [new file with mode: 0644]
inc/libs/refback_functions.php [new file with mode: 0644]
inc/libs/register_functions.php [new file with mode: 0644]
inc/libs/removeip_functions.php [new file with mode: 0644]
inc/libs/rewrite_functions.php [new file with mode: 0644]
inc/libs/security_functions.php [new file with mode: 0644]
inc/libs/sponsor_functions.php [new file with mode: 0644]
inc/libs/surfbar_functions.php [new file with mode: 0644]
inc/libs/task_functions.php [new file with mode: 0644]
inc/libs/transfer_functions.php [new file with mode: 0644]
inc/libs/user_functions.php [new file with mode: 0644]
inc/libs/wernis_functions.php [new file with mode: 0644]
inc/load_cache.php [new file with mode: 0644]
inc/load_extensions.php [new file with mode: 0644]
inc/loader/.htaccess [new file with mode: 0644]
inc/loader/load_cache-admin.php [new file with mode: 0644]
inc/loader/load_cache-config.php [new file with mode: 0644]
inc/loader/load_cache-modreg.php [new file with mode: 0644]
inc/loader/load_cache-refdepths.php [new file with mode: 0644]
inc/loader/load_cache-refsystem.php [new file with mode: 0644]
inc/loader/load_cache-them.php [new file with mode: 0644]
inc/mails/.htaccess [new file with mode: 0644]
inc/mails/_mails.php [new file with mode: 0644]
inc/mails/beg_mails.php [new file with mode: 0644]
inc/mails/birthday_mails.php [new file with mode: 0644]
inc/mails/bonus_mails.php [new file with mode: 0644]
inc/modules/.htaccess [new file with mode: 0644]
inc/modules/admin.php [new file with mode: 0644]
inc/modules/admin/.htaccess [new file with mode: 0644]
inc/modules/admin/action- [new file with mode: 0644]
inc/modules/admin/action-admins.php [new file with mode: 0644]
inc/modules/admin/action-bank.php [new file with mode: 0644]
inc/modules/admin/action-country.php [new file with mode: 0644]
inc/modules/admin/action-doubler.php [new file with mode: 0644]
inc/modules/admin/action-email.php [new file with mode: 0644]
inc/modules/admin/action-holiday.php [new file with mode: 0644]
inc/modules/admin/action-login.php [new file with mode: 0644]
inc/modules/admin/action-logout.php [new file with mode: 0644]
inc/modules/admin/action-menu.php [new file with mode: 0644]
inc/modules/admin/action-misc.php [new file with mode: 0644]
inc/modules/admin/action-mods.php [new file with mode: 0644]
inc/modules/admin/action-newsletter.php [new file with mode: 0644]
inc/modules/admin/action-payouts.php [new file with mode: 0644]
inc/modules/admin/action-primera.php [new file with mode: 0644]
inc/modules/admin/action-rallye.php [new file with mode: 0644]
inc/modules/admin/action-repair.php [new file with mode: 0644]
inc/modules/admin/action-setup.php [new file with mode: 0644]
inc/modules/admin/action-sponsor.php [new file with mode: 0644]
inc/modules/admin/action-stats.php [new file with mode: 0644]
inc/modules/admin/action-surfbar.php [new file with mode: 0644]
inc/modules/admin/action-task.php [new file with mode: 0644]
inc/modules/admin/action-theme.php [new file with mode: 0644]
inc/modules/admin/action-transfer.php [new file with mode: 0644]
inc/modules/admin/action-user.php [new file with mode: 0644]
inc/modules/admin/action-wernis.php [new file with mode: 0644]
inc/modules/admin/admin-inc.php [new file with mode: 0644]
inc/modules/admin/overview-inc.php [new file with mode: 0644]
inc/modules/admin/what- [new file with mode: 0644]
inc/modules/admin/what-add_bank_package.php [new file with mode: 0644]
inc/modules/admin/what-add_guestnl_cat.php [new file with mode: 0644]
inc/modules/admin/what-add_points.php [new file with mode: 0644]
inc/modules/admin/what-add_rallye.php [new file with mode: 0644]
inc/modules/admin/what-add_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-add_surfbar_url.php [new file with mode: 0644]
inc/modules/admin/what-admin_add.php [new file with mode: 0644]
inc/modules/admin/what-adminedit.php [new file with mode: 0644]
inc/modules/admin/what-admins_add.php [new file with mode: 0644]
inc/modules/admin/what-admins_contct.php [new file with mode: 0644]
inc/modules/admin/what-admins_edit.php [new file with mode: 0644]
inc/modules/admin/what-admins_mails.php [new file with mode: 0644]
inc/modules/admin/what-autopurge.php [new file with mode: 0644]
inc/modules/admin/what-bonus.php [new file with mode: 0644]
inc/modules/admin/what-cache_stats.php [new file with mode: 0644]
inc/modules/admin/what-chk_regs.php [new file with mode: 0644]
inc/modules/admin/what-config_active.php [new file with mode: 0644]
inc/modules/admin/what-config_admin.php [new file with mode: 0644]
inc/modules/admin/what-config_admins.php [new file with mode: 0644]
inc/modules/admin/what-config_autopurge.php [new file with mode: 0644]
inc/modules/admin/what-config_beg.php [new file with mode: 0644]
inc/modules/admin/what-config_birthday.php [new file with mode: 0644]
inc/modules/admin/what-config_bonus.php [new file with mode: 0644]
inc/modules/admin/what-config_cache.php [new file with mode: 0644]
inc/modules/admin/what-config_cats.php [new file with mode: 0644]
inc/modules/admin/what-config_doubler.php [new file with mode: 0644]
inc/modules/admin/what-config_email.php [new file with mode: 0644]
inc/modules/admin/what-config_extensions.php [new file with mode: 0644]
inc/modules/admin/what-config_holiday.php [new file with mode: 0644]
inc/modules/admin/what-config_home.php [new file with mode: 0644]
inc/modules/admin/what-config_mediadata.php [new file with mode: 0644]
inc/modules/admin/what-config_mods.php [new file with mode: 0644]
inc/modules/admin/what-config_newsletter.php [new file with mode: 0644]
inc/modules/admin/what-config_nickname.php [new file with mode: 0644]
inc/modules/admin/what-config_order.php [new file with mode: 0644]
inc/modules/admin/what-config_other.php [new file with mode: 0644]
inc/modules/admin/what-config_payouts.php [new file with mode: 0644]
inc/modules/admin/what-config_points.php [new file with mode: 0644]
inc/modules/admin/what-config_primera.php [new file with mode: 0644]
inc/modules/admin/what-config_proxy.php [new file with mode: 0644]
inc/modules/admin/what-config_rallye_prices.php [new file with mode: 0644]
inc/modules/admin/what-config_refid.php [new file with mode: 0644]
inc/modules/admin/what-config_reg.php [new file with mode: 0644]
inc/modules/admin/what-config_register.php [new file with mode: 0644]
inc/modules/admin/what-config_register2.php [new file with mode: 0644]
inc/modules/admin/what-config_removeip.php [new file with mode: 0644]
inc/modules/admin/what-config_rewrite.php [new file with mode: 0644]
inc/modules/admin/what-config_secure.php [new file with mode: 0644]
inc/modules/admin/what-config_session.php [new file with mode: 0644]
inc/modules/admin/what-config_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-config_stats.php [new file with mode: 0644]
inc/modules/admin/what-config_surfbar.php [new file with mode: 0644]
inc/modules/admin/what-config_title.php [new file with mode: 0644]
inc/modules/admin/what-config_top10.php [new file with mode: 0644]
inc/modules/admin/what-config_transfer.php [new file with mode: 0644]
inc/modules/admin/what-config_user.php [new file with mode: 0644]
inc/modules/admin/what-config_wernis.php [new file with mode: 0644]
inc/modules/admin/what-del_email.php [new file with mode: 0644]
inc/modules/admin/what-del_holiday.php [new file with mode: 0644]
inc/modules/admin/what-del_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-del_task.php [new file with mode: 0644]
inc/modules/admin/what-del_transfer.php [new file with mode: 0644]
inc/modules/admin/what-del_user.php [new file with mode: 0644]
inc/modules/admin/what-edit_emails.php [new file with mode: 0644]
inc/modules/admin/what-edit_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-edit_user.php [new file with mode: 0644]
inc/modules/admin/what-email_archiv.php [new file with mode: 0644]
inc/modules/admin/what-email_details.php [new file with mode: 0644]
inc/modules/admin/what-email_stats.php [new file with mode: 0644]
inc/modules/admin/what-extensions.php [new file with mode: 0644]
inc/modules/admin/what-guest_add.php [new file with mode: 0644]
inc/modules/admin/what-guestedit.php [new file with mode: 0644]
inc/modules/admin/what-holiday_list.php [new file with mode: 0644]
inc/modules/admin/what-holiday_remove.php [new file with mode: 0644]
inc/modules/admin/what-list_autopurge.php [new file with mode: 0644]
inc/modules/admin/what-list_bank_package.php [new file with mode: 0644]
inc/modules/admin/what-list_beg.php [new file with mode: 0644]
inc/modules/admin/what-list_bonus.php [new file with mode: 0644]
inc/modules/admin/what-list_cats.php [new file with mode: 0644]
inc/modules/admin/what-list_country.php [new file with mode: 0644]
inc/modules/admin/what-list_doubler.php [new file with mode: 0644]
inc/modules/admin/what-list_holiday.php [new file with mode: 0644]
inc/modules/admin/what-list_links.php [new file with mode: 0644]
inc/modules/admin/what-list_newsletter.php [new file with mode: 0644]
inc/modules/admin/what-list_norefs.php [new file with mode: 0644]
inc/modules/admin/what-list_payouts.php [new file with mode: 0644]
inc/modules/admin/what-list_primera.php [new file with mode: 0644]
inc/modules/admin/what-list_rallyes.php [new file with mode: 0644]
inc/modules/admin/what-list_refs.php [new file with mode: 0644]
inc/modules/admin/what-list_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-list_sponsor_pay.php [new file with mode: 0644]
inc/modules/admin/what-list_sponsor_pays.php [new file with mode: 0644]
inc/modules/admin/what-list_surfbar_urls.php [new file with mode: 0644]
inc/modules/admin/what-list_task.php [new file with mode: 0644]
inc/modules/admin/what-list_transfer.php [new file with mode: 0644]
inc/modules/admin/what-list_unconfirmed.php [new file with mode: 0644]
inc/modules/admin/what-list_user.php [new file with mode: 0644]
inc/modules/admin/what-list_wernis.php [new file with mode: 0644]
inc/modules/admin/what-lock_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-lock_user.php [new file with mode: 0644]
inc/modules/admin/what-logs.php [new file with mode: 0644]
inc/modules/admin/what-maintenance.php [new file with mode: 0644]
inc/modules/admin/what-mem_add.php [new file with mode: 0644]
inc/modules/admin/what-memedit.php [new file with mode: 0644]
inc/modules/admin/what-optimize.php [new file with mode: 0644]
inc/modules/admin/what-overview.php [new file with mode: 0644]
inc/modules/admin/what-payments.php [new file with mode: 0644]
inc/modules/admin/what-refbanner.php [new file with mode: 0644]
inc/modules/admin/what-repair_amenu.php [new file with mode: 0644]
inc/modules/admin/what-repair_cats.php [new file with mode: 0644]
inc/modules/admin/what-repair_gmenu.php [new file with mode: 0644]
inc/modules/admin/what-repair_mmenu.php [new file with mode: 0644]
inc/modules/admin/what-send_bonus.php [new file with mode: 0644]
inc/modules/admin/what-send_newsletter.php [new file with mode: 0644]
inc/modules/admin/what-stats_mods.php [new file with mode: 0644]
inc/modules/admin/what-sub_points.php [new file with mode: 0644]
inc/modules/admin/what-surfbar_stats.php [new file with mode: 0644]
inc/modules/admin/what-theme_check.php [new file with mode: 0644]
inc/modules/admin/what-theme_edit.php [new file with mode: 0644]
inc/modules/admin/what-theme_import.php [new file with mode: 0644]
inc/modules/admin/what-unlock_emails.php [new file with mode: 0644]
inc/modules/admin/what-unlock_sponsor.php [new file with mode: 0644]
inc/modules/admin/what-unlock_surfbar_urls.php [new file with mode: 0644]
inc/modules/admin/what-updates.php [new file with mode: 0644]
inc/modules/admin/what-usage.php [new file with mode: 0644]
inc/modules/admin/what-user_contct.php [new file with mode: 0644]
inc/modules/admin/what-user_online.php [new file with mode: 0644]
inc/modules/admin/what-usr_online.php [new file with mode: 0644]
inc/modules/chk_login.php [new file with mode: 0644]
inc/modules/frametester.php [new file with mode: 0644]
inc/modules/guest/.htaccess [new file with mode: 0644]
inc/modules/guest/action- [new file with mode: 0644]
inc/modules/guest/action-admin.php [new file with mode: 0644]
inc/modules/guest/action-main.php [new file with mode: 0644]
inc/modules/guest/action-members.php [new file with mode: 0644]
inc/modules/guest/action-online.php [new file with mode: 0644]
inc/modules/guest/action-sponsor.php [new file with mode: 0644]
inc/modules/guest/action-themes.php [new file with mode: 0644]
inc/modules/guest/what- [new file with mode: 0644]
inc/modules/guest/what-active.php [new file with mode: 0644]
inc/modules/guest/what-admin.php [new file with mode: 0644]
inc/modules/guest/what-agb.php [new file with mode: 0644]
inc/modules/guest/what-beg.php [new file with mode: 0644]
inc/modules/guest/what-confirm.php [new file with mode: 0644]
inc/modules/guest/what-doubler.php [new file with mode: 0644]
inc/modules/guest/what-impressum.php [new file with mode: 0644]
inc/modules/guest/what-infos.php [new file with mode: 0644]
inc/modules/guest/what-login.php [new file with mode: 0644]
inc/modules/guest/what-mediadata.php [new file with mode: 0644]
inc/modules/guest/what-rallyes.php [new file with mode: 0644]
inc/modules/guest/what-register.php [new file with mode: 0644]
inc/modules/guest/what-sponsor_agb.php [new file with mode: 0644]
inc/modules/guest/what-sponsor_infos.php [new file with mode: 0644]
inc/modules/guest/what-sponsor_login.php [new file with mode: 0644]
inc/modules/guest/what-sponsor_reg.php [new file with mode: 0644]
inc/modules/guest/what-stats.php [new file with mode: 0644]
inc/modules/guest/what-top10.php [new file with mode: 0644]
inc/modules/guest/what-welcome.php [new file with mode: 0644]
inc/modules/guest/what-wernis_portal.php [new file with mode: 0644]
inc/modules/index.php [new file with mode: 0644]
inc/modules/loader.php [new file with mode: 0644]
inc/modules/login.php [new file with mode: 0644]
inc/modules/member/.htaccess [new file with mode: 0644]
inc/modules/member/action- [new file with mode: 0644]
inc/modules/member/action-account.php [new file with mode: 0644]
inc/modules/member/action-bank.php [new file with mode: 0644]
inc/modules/member/action-extras.php [new file with mode: 0644]
inc/modules/member/action-logout.php [new file with mode: 0644]
inc/modules/member/action-main.php [new file with mode: 0644]
inc/modules/member/action-order.php [new file with mode: 0644]
inc/modules/member/action-rals.php [new file with mode: 0644]
inc/modules/member/action-stats.php [new file with mode: 0644]
inc/modules/member/action-surfbar.php [new file with mode: 0644]
inc/modules/member/action-themes.php [new file with mode: 0644]
inc/modules/member/what- [new file with mode: 0644]
inc/modules/member/what-bank_create.php [new file with mode: 0644]
inc/modules/member/what-bank_deposit.php [new file with mode: 0644]
inc/modules/member/what-bank_infos.php [new file with mode: 0644]
inc/modules/member/what-bank_output.php [new file with mode: 0644]
inc/modules/member/what-bank_withdraw.php [new file with mode: 0644]
inc/modules/member/what-beg.php [new file with mode: 0644]
inc/modules/member/what-beg2.php [new file with mode: 0644]
inc/modules/member/what-bonus.php [new file with mode: 0644]
inc/modules/member/what-categories.php [new file with mode: 0644]
inc/modules/member/what-doubler.php [new file with mode: 0644]
inc/modules/member/what-guest.php [new file with mode: 0644]
inc/modules/member/what-holiday.php [new file with mode: 0644]
inc/modules/member/what-html_mail.php [new file with mode: 0644]
inc/modules/member/what-logout.php [new file with mode: 0644]
inc/modules/member/what-mydata.php [new file with mode: 0644]
inc/modules/member/what-newsletter.php [new file with mode: 0644]
inc/modules/member/what-nickname.php [new file with mode: 0644]
inc/modules/member/what-order.php [new file with mode: 0644]
inc/modules/member/what-payout.php [new file with mode: 0644]
inc/modules/member/what-points.php [new file with mode: 0644]
inc/modules/member/what-primera.php [new file with mode: 0644]
inc/modules/member/what-rallyes.php [new file with mode: 0644]
inc/modules/member/what-refback.php [new file with mode: 0644]
inc/modules/member/what-reflinks.php [new file with mode: 0644]
inc/modules/member/what-sponsor.php [new file with mode: 0644]
inc/modules/member/what-stats.php [new file with mode: 0644]
inc/modules/member/what-support.php [new file with mode: 0644]
inc/modules/member/what-surfbar_book.php [new file with mode: 0644]
inc/modules/member/what-surfbar_list.php [new file with mode: 0644]
inc/modules/member/what-surfbar_start.php [new file with mode: 0644]
inc/modules/member/what-surfbar_stats.php [new file with mode: 0644]
inc/modules/member/what-themes.php [new file with mode: 0644]
inc/modules/member/what-transfer.php [new file with mode: 0644]
inc/modules/member/what-unconfirmed.php [new file with mode: 0644]
inc/modules/member/what-welcome.php [new file with mode: 0644]
inc/modules/member/what-wernis.php [new file with mode: 0644]
inc/modules/order.php [new file with mode: 0644]
inc/modules/sponsor.php [new file with mode: 0644]
inc/modules/sponsor/.htaccess [new file with mode: 0644]
inc/modules/sponsor/.php [new file with mode: 0644]
inc/modules/sponsor/account.php [new file with mode: 0644]
inc/modules/sponsor/settings.php [new file with mode: 0644]
inc/modules/sponsor/welcome.php [new file with mode: 0644]
inc/modules/welcome.php [new file with mode: 0644]
inc/monthly/.htaccess [new file with mode: 0644]
inc/monthly/monthly_ [new file with mode: 0644]
inc/monthly/monthly_beg.php [new file with mode: 0644]
inc/monthly/monthly_bonus.php [new file with mode: 0644]
inc/monthly/monthly_newsletter.php [new file with mode: 0644]
inc/monthly/monthly_surfbar.php [new file with mode: 0644]
inc/mysql-connect.php [new file with mode: 0644]
inc/mysql-manager.php [new file with mode: 0644]
inc/patch-system.php [new file with mode: 0644]
inc/phpmailer/ChangeLog.txt [new file with mode: 0644]
inc/phpmailer/LICENSE [new file with mode: 0644]
inc/phpmailer/README [new file with mode: 0644]
inc/phpmailer/class.phpmailer.php [new file with mode: 0644]
inc/phpmailer/class.pop3.php [new file with mode: 0644]
inc/phpmailer/class.smtp.php [new file with mode: 0644]
inc/phpmailer/codeworxtech.html [new file with mode: 0644]
inc/phpmailer/docs/extending.html [new file with mode: 0644]
inc/phpmailer/docs/faq.html [new file with mode: 0644]
inc/phpmailer/docs/phpmailer_sm.gif [new file with mode: 0644]
inc/phpmailer/docs/pop3_article.txt [new file with mode: 0644]
inc/phpmailer/docs/use_gmail.txt [new file with mode: 0644]
inc/phpmailer/examples/contents.html [new file with mode: 0644]
inc/phpmailer/examples/images/bkgrnd.gif [new file with mode: 0644]
inc/phpmailer/examples/images/phpmailer.gif [new file with mode: 0644]
inc/phpmailer/examples/images/phpmailer.png [new file with mode: 0644]
inc/phpmailer/examples/images/phpmailer_mini.gif [new file with mode: 0644]
inc/phpmailer/examples/index.html [new file with mode: 0644]
inc/phpmailer/examples/pop3_before_smtp_test.php [new file with mode: 0644]
inc/phpmailer/examples/test1.php [new file with mode: 0644]
inc/phpmailer/examples/test_gmail.php [new file with mode: 0644]
inc/phpmailer/examples/test_mail.php [new file with mode: 0644]
inc/phpmailer/examples/test_sendmail.php [new file with mode: 0644]
inc/phpmailer/examples/test_smtp.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-br.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-ca.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-cz.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-de.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-dk.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-en.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-es.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-et.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-fi.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-fo.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-fr.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-hu.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-it.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-ja.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-nl.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-no.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-pl.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-ro.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-ru.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-se.php [new file with mode: 0644]
inc/phpmailer/language/phpmailer.lang-tr.php [new file with mode: 0644]
inc/phpmailer/phpdoc/PHPMailer/PHPMailer.html [new file with mode: 0644]
inc/phpmailer/phpdoc/PHPMailer/SMTP.html [new file with mode: 0644]
inc/phpmailer/phpdoc/PHPMailer/_class_phpmailer_php.html [new file with mode: 0644]
inc/phpmailer/phpdoc/PHPMailer/_class_smtp_php.html [new file with mode: 0644]
inc/phpmailer/phpdoc/blank.html [new file with mode: 0644]
inc/phpmailer/phpdoc/classtrees_PHPMailer.html [new file with mode: 0644]
inc/phpmailer/phpdoc/elementindex.html [new file with mode: 0644]
inc/phpmailer/phpdoc/elementindex_PHPMailer.html [new file with mode: 0644]
inc/phpmailer/phpdoc/errors.html [new file with mode: 0644]
inc/phpmailer/phpdoc/index.html [new file with mode: 0644]
inc/phpmailer/phpdoc/li_PHPMailer.html [new file with mode: 0644]
inc/phpmailer/phpdoc/media/banner.css [new file with mode: 0644]
inc/phpmailer/phpdoc/media/stylesheet.css [new file with mode: 0644]
inc/phpmailer/phpdoc/packages.html [new file with mode: 0644]
inc/phpmailer/test/phpmailer_test.php [new file with mode: 0644]
inc/phpmailer/test/phpunit.php [new file with mode: 0644]
inc/phpmailer/test/test.png [new file with mode: 0644]
inc/pool-update.php [new file with mode: 0644]
inc/profile-updte.php [new file with mode: 0644]
inc/rdf.class.php [new file with mode: 0644]
inc/reset/.htaccess [new file with mode: 0644]
inc/reset/reset_ [new file with mode: 0644]
inc/reset/reset_beg.php [new file with mode: 0644]
inc/reset/reset_bonus.php [new file with mode: 0644]
inc/reset/reset_daily.php [new file with mode: 0644]
inc/reset/reset_engine.php [new file with mode: 0644]
inc/reset/reset_holiday.php [new file with mode: 0644]
inc/reset/reset_surfbar.php [new file with mode: 0644]
inc/security.php [new file with mode: 0644]
inc/session.php [new file with mode: 0644]
inc/sql_error.php [new file with mode: 0644]
inc/stats_bonus.php [new file with mode: 0644]
inc/stylesheet.php [new file with mode: 0644]
inc/theme-manager.php [new file with mode: 0644]
inc/weekly/.htaccess [new file with mode: 0644]
inc/weekly/weekly_ [new file with mode: 0644]
inc/weekly/weekly_surfbar.php [new file with mode: 0644]

index fa8c5a115db37ca085da4f894d967bb134bf9e6f..ffa3832341f53b62fed7162e132f6d1dd78d76e8 100644 (file)
@@ -75,6 +75,509 @@ DOCS/validator.sh -text
 /css.php -text
 /doubler.php -text
 /img.php -text
 /css.php -text
 /doubler.php -text
 /img.php -text
+inc/.htaccess -text
+inc/autopurge.php -text
+inc/autopurge/.htaccess -text
+inc/autopurge/purge- -text
+inc/autopurge/purge-general.php -text
+inc/autopurge/purge-inact.php -text
+inc/autopurge/purge-mails.php -text
+inc/autopurge/purge-tsks.php -text
+inc/autopurge/purge-unconfirmed.php -text
+inc/cache/.htaccess -text
+inc/check-reset.php -text
+inc/databases.php -text
+inc/db/.htaccess -text
+inc/db/lib-mysql3.php -text
+inc/db/lib.php -text
+inc/doubler_send.php -text
+inc/extensions.php -text
+inc/extensions/.htaccess -text
+inc/extensions/ext- -text
+inc/extensions/ext-active.php -text
+inc/extensions/ext-admins.php -text
+inc/extensions/ext-admintheme1.php -text
+inc/extensions/ext-admintheme_default.php -text
+inc/extensions/ext-autopurge.php -text
+inc/extensions/ext-bank.php -text
+inc/extensions/ext-beg.php -text
+inc/extensions/ext-birthday.php -text
+inc/extensions/ext-bonus.php -text
+inc/extensions/ext-cache.php -text
+inc/extensions/ext-country.php -text
+inc/extensions/ext-demo.php -text
+inc/extensions/ext-doubler.php -text
+inc/extensions/ext-holiday.php -text
+inc/extensions/ext-html_mail.php -text
+inc/extensions/ext-mailid.php -text
+inc/extensions/ext-maintenance.php -text
+inc/extensions/ext-mediadata.php -text
+inc/extensions/ext-mods.php -text
+inc/extensions/ext-mydata.php -text
+inc/extensions/ext-newsletter.php -text
+inc/extensions/ext-nickname.php -text
+inc/extensions/ext-online.php -text
+inc/extensions/ext-optimize.php -text
+inc/extensions/ext-order.php -text
+inc/extensions/ext-other.php -text
+inc/extensions/ext-payout.php -text
+inc/extensions/ext-primera.php -text
+inc/extensions/ext-profile.php -text
+inc/extensions/ext-rallye.php -text
+inc/extensions/ext-refback.php -text
+inc/extensions/ext-register.php -text
+inc/extensions/ext-removeip.php -text
+inc/extensions/ext-repair.php -text
+inc/extensions/ext-rewrite.php -text
+inc/extensions/ext-safe.php -text
+inc/extensions/ext-sponsor.php -text
+inc/extensions/ext-sql_patches.php -text
+inc/extensions/ext-support.php -text
+inc/extensions/ext-surfbar.php -text
+inc/extensions/ext-task.php -text
+inc/extensions/ext-theme.php -text
+inc/extensions/ext-top10.php -text
+inc/extensions/ext-transfer.php -text
+inc/extensions/ext-user.php -text
+inc/extensions/ext-wernis.php -text
+inc/extensions/ext-yoomedia.php -text
+inc/fatal_errors.php -text
+inc/footer.php -text
+inc/functions.php -text
+inc/gen_mediadata.php -text
+inc/gen_refback.php -text
+inc/gen_sql_patches.php -text
+inc/header.php -text
+inc/install-inc.php -text
+inc/language.php -text
+inc/language/.htaccess -text
+inc/language/active_de.php -text
+inc/language/admins_de.php -text
+inc/language/autopurge_de.php -text
+inc/language/bank_de.php -text
+inc/language/beg_de.php -text
+inc/language/birthday_de.php -text
+inc/language/bonus_de.php -text
+inc/language/cache_de.php -text
+inc/language/country_de.php -text
+inc/language/de.php -text
+inc/language/doubler_de.php -text
+inc/language/en.ph -text
+inc/language/en.php -text
+inc/language/holiday_de.php -text
+inc/language/html_mail_de.php -text
+inc/language/install_de.php -text
+inc/language/mailid_de.php -text
+inc/language/maintenance_de.php -text
+inc/language/mediadata_de.php -text
+inc/language/mods_de.php -text
+inc/language/newsletter_de.php -text
+inc/language/nickname_de.php -text
+inc/language/online_de.php -text
+inc/language/optimize_de.php -text
+inc/language/order_de.php -text
+inc/language/other_de.php -text
+inc/language/payout_de.php -text
+inc/language/primera_de.php -text
+inc/language/rallye_de.php -text
+inc/language/refback_de.php -text
+inc/language/register_de.php -text
+inc/language/removeip_de.php -text
+inc/language/repair_de.php -text
+inc/language/rewrite_de.php -text
+inc/language/sponsor_de.php -text
+inc/language/support_de.php -text
+inc/language/surfbar_de.php -text
+inc/language/task_de.php -text
+inc/language/theme_de.php -text
+inc/language/top10_de.php -text
+inc/language/transfer_de.php -text
+inc/language/user_de.php -text
+inc/language/wernis_de.php -text
+inc/libs/.htaccess -text
+inc/libs/admins_functions.php -text
+inc/libs/autopurge_functions.php -text
+inc/libs/bonus_functions.php -text
+inc/libs/cache_functions.php -text
+inc/libs/country_functions.php -text
+inc/libs/doubler_functions.php -text
+inc/libs/holiday_functions.php -text
+inc/libs/html_mail_functions.php -text
+inc/libs/mediadata_functions.php -text
+inc/libs/newsletter_functions.php -text
+inc/libs/nickname_functions.php -text
+inc/libs/optimize_functions.php -text
+inc/libs/order_functions.php -text
+inc/libs/payout_functions.php -text
+inc/libs/primera_functions.php -text
+inc/libs/rallye_functions.php -text
+inc/libs/refback_functions.php -text
+inc/libs/register_functions.php -text
+inc/libs/removeip_functions.php -text
+inc/libs/rewrite_functions.php -text
+inc/libs/security_functions.php -text
+inc/libs/sponsor_functions.php -text
+inc/libs/surfbar_functions.php -text
+inc/libs/task_functions.php -text
+inc/libs/transfer_functions.php -text
+inc/libs/user_functions.php -text
+inc/libs/wernis_functions.php -text
+inc/load_cache.php -text
+inc/load_extensions.php -text
+inc/loader/.htaccess -text
+inc/loader/load_cache-admin.php -text
+inc/loader/load_cache-config.php -text
+inc/loader/load_cache-modreg.php -text
+inc/loader/load_cache-refdepths.php -text
+inc/loader/load_cache-refsystem.php -text
+inc/loader/load_cache-them.php -text
+inc/mails/.htaccess -text
+inc/mails/_mails.php -text
+inc/mails/beg_mails.php -text
+inc/mails/birthday_mails.php -text
+inc/mails/bonus_mails.php -text
+inc/modules/.htaccess -text
+inc/modules/admin.php -text
+inc/modules/admin/.htaccess -text
+inc/modules/admin/action- -text
+inc/modules/admin/action-admins.php -text
+inc/modules/admin/action-bank.php -text
+inc/modules/admin/action-country.php -text
+inc/modules/admin/action-doubler.php -text
+inc/modules/admin/action-email.php -text
+inc/modules/admin/action-holiday.php -text
+inc/modules/admin/action-login.php -text
+inc/modules/admin/action-logout.php -text
+inc/modules/admin/action-menu.php -text
+inc/modules/admin/action-misc.php -text
+inc/modules/admin/action-mods.php -text
+inc/modules/admin/action-newsletter.php -text
+inc/modules/admin/action-payouts.php -text
+inc/modules/admin/action-primera.php -text
+inc/modules/admin/action-rallye.php -text
+inc/modules/admin/action-repair.php -text
+inc/modules/admin/action-setup.php -text
+inc/modules/admin/action-sponsor.php -text
+inc/modules/admin/action-stats.php -text
+inc/modules/admin/action-surfbar.php -text
+inc/modules/admin/action-task.php -text
+inc/modules/admin/action-theme.php -text
+inc/modules/admin/action-transfer.php -text
+inc/modules/admin/action-user.php -text
+inc/modules/admin/action-wernis.php -text
+inc/modules/admin/admin-inc.php -text
+inc/modules/admin/overview-inc.php -text
+inc/modules/admin/what- -text
+inc/modules/admin/what-add_bank_package.php -text
+inc/modules/admin/what-add_guestnl_cat.php -text
+inc/modules/admin/what-add_points.php -text
+inc/modules/admin/what-add_rallye.php -text
+inc/modules/admin/what-add_sponsor.php -text
+inc/modules/admin/what-add_surfbar_url.php -text
+inc/modules/admin/what-admin_add.php -text
+inc/modules/admin/what-adminedit.php -text
+inc/modules/admin/what-admins_add.php -text
+inc/modules/admin/what-admins_contct.php -text
+inc/modules/admin/what-admins_edit.php -text
+inc/modules/admin/what-admins_mails.php -text
+inc/modules/admin/what-autopurge.php -text
+inc/modules/admin/what-bonus.php -text
+inc/modules/admin/what-cache_stats.php -text
+inc/modules/admin/what-chk_regs.php -text
+inc/modules/admin/what-config_active.php -text
+inc/modules/admin/what-config_admin.php -text
+inc/modules/admin/what-config_admins.php -text
+inc/modules/admin/what-config_autopurge.php -text
+inc/modules/admin/what-config_beg.php -text
+inc/modules/admin/what-config_birthday.php -text
+inc/modules/admin/what-config_bonus.php -text
+inc/modules/admin/what-config_cache.php -text
+inc/modules/admin/what-config_cats.php -text
+inc/modules/admin/what-config_doubler.php -text
+inc/modules/admin/what-config_email.php -text
+inc/modules/admin/what-config_extensions.php -text
+inc/modules/admin/what-config_holiday.php -text
+inc/modules/admin/what-config_home.php -text
+inc/modules/admin/what-config_mediadata.php -text
+inc/modules/admin/what-config_mods.php -text
+inc/modules/admin/what-config_newsletter.php -text
+inc/modules/admin/what-config_nickname.php -text
+inc/modules/admin/what-config_order.php -text
+inc/modules/admin/what-config_other.php -text
+inc/modules/admin/what-config_payouts.php -text
+inc/modules/admin/what-config_points.php -text
+inc/modules/admin/what-config_primera.php -text
+inc/modules/admin/what-config_proxy.php -text
+inc/modules/admin/what-config_rallye_prices.php -text
+inc/modules/admin/what-config_refid.php -text
+inc/modules/admin/what-config_reg.php -text
+inc/modules/admin/what-config_register.php -text
+inc/modules/admin/what-config_register2.php -text
+inc/modules/admin/what-config_removeip.php -text
+inc/modules/admin/what-config_rewrite.php -text
+inc/modules/admin/what-config_secure.php -text
+inc/modules/admin/what-config_session.php -text
+inc/modules/admin/what-config_sponsor.php -text
+inc/modules/admin/what-config_stats.php -text
+inc/modules/admin/what-config_surfbar.php -text
+inc/modules/admin/what-config_title.php -text
+inc/modules/admin/what-config_top10.php -text
+inc/modules/admin/what-config_transfer.php -text
+inc/modules/admin/what-config_user.php -text
+inc/modules/admin/what-config_wernis.php -text
+inc/modules/admin/what-del_email.php -text
+inc/modules/admin/what-del_holiday.php -text
+inc/modules/admin/what-del_sponsor.php -text
+inc/modules/admin/what-del_task.php -text
+inc/modules/admin/what-del_transfer.php -text
+inc/modules/admin/what-del_user.php -text
+inc/modules/admin/what-edit_emails.php -text
+inc/modules/admin/what-edit_sponsor.php -text
+inc/modules/admin/what-edit_user.php -text
+inc/modules/admin/what-email_archiv.php -text
+inc/modules/admin/what-email_details.php -text
+inc/modules/admin/what-email_stats.php -text
+inc/modules/admin/what-extensions.php -text
+inc/modules/admin/what-guest_add.php -text
+inc/modules/admin/what-guestedit.php -text
+inc/modules/admin/what-holiday_list.php -text
+inc/modules/admin/what-holiday_remove.php -text
+inc/modules/admin/what-list_autopurge.php -text
+inc/modules/admin/what-list_bank_package.php -text
+inc/modules/admin/what-list_beg.php -text
+inc/modules/admin/what-list_bonus.php -text
+inc/modules/admin/what-list_cats.php -text
+inc/modules/admin/what-list_country.php -text
+inc/modules/admin/what-list_doubler.php -text
+inc/modules/admin/what-list_holiday.php -text
+inc/modules/admin/what-list_links.php -text
+inc/modules/admin/what-list_newsletter.php -text
+inc/modules/admin/what-list_norefs.php -text
+inc/modules/admin/what-list_payouts.php -text
+inc/modules/admin/what-list_primera.php -text
+inc/modules/admin/what-list_rallyes.php -text
+inc/modules/admin/what-list_refs.php -text
+inc/modules/admin/what-list_sponsor.php -text
+inc/modules/admin/what-list_sponsor_pay.php -text
+inc/modules/admin/what-list_sponsor_pays.php -text
+inc/modules/admin/what-list_surfbar_urls.php -text
+inc/modules/admin/what-list_task.php -text
+inc/modules/admin/what-list_transfer.php -text
+inc/modules/admin/what-list_unconfirmed.php -text
+inc/modules/admin/what-list_user.php -text
+inc/modules/admin/what-list_wernis.php -text
+inc/modules/admin/what-lock_sponsor.php -text
+inc/modules/admin/what-lock_user.php -text
+inc/modules/admin/what-logs.php -text
+inc/modules/admin/what-maintenance.php -text
+inc/modules/admin/what-mem_add.php -text
+inc/modules/admin/what-memedit.php -text
+inc/modules/admin/what-optimize.php -text
+inc/modules/admin/what-overview.php -text
+inc/modules/admin/what-payments.php -text
+inc/modules/admin/what-refbanner.php -text
+inc/modules/admin/what-repair_amenu.php -text
+inc/modules/admin/what-repair_cats.php -text
+inc/modules/admin/what-repair_gmenu.php -text
+inc/modules/admin/what-repair_mmenu.php -text
+inc/modules/admin/what-send_bonus.php -text
+inc/modules/admin/what-send_newsletter.php -text
+inc/modules/admin/what-stats_mods.php -text
+inc/modules/admin/what-sub_points.php -text
+inc/modules/admin/what-surfbar_stats.php -text
+inc/modules/admin/what-theme_check.php -text
+inc/modules/admin/what-theme_edit.php -text
+inc/modules/admin/what-theme_import.php -text
+inc/modules/admin/what-unlock_emails.php -text
+inc/modules/admin/what-unlock_sponsor.php -text
+inc/modules/admin/what-unlock_surfbar_urls.php -text
+inc/modules/admin/what-updates.php -text
+inc/modules/admin/what-usage.php -text
+inc/modules/admin/what-user_contct.php -text
+inc/modules/admin/what-user_online.php -text
+inc/modules/admin/what-usr_online.php -text
+inc/modules/chk_login.php -text
+inc/modules/frametester.php -text
+inc/modules/guest/.htaccess -text
+inc/modules/guest/action- -text
+inc/modules/guest/action-admin.php -text
+inc/modules/guest/action-main.php -text
+inc/modules/guest/action-members.php -text
+inc/modules/guest/action-online.php -text
+inc/modules/guest/action-sponsor.php -text
+inc/modules/guest/action-themes.php -text
+inc/modules/guest/what- -text
+inc/modules/guest/what-active.php -text
+inc/modules/guest/what-admin.php -text
+inc/modules/guest/what-agb.php -text
+inc/modules/guest/what-beg.php -text
+inc/modules/guest/what-confirm.php -text
+inc/modules/guest/what-doubler.php -text
+inc/modules/guest/what-impressum.php -text
+inc/modules/guest/what-infos.php -text
+inc/modules/guest/what-login.php -text
+inc/modules/guest/what-mediadata.php -text
+inc/modules/guest/what-rallyes.php -text
+inc/modules/guest/what-register.php -text
+inc/modules/guest/what-sponsor_agb.php -text
+inc/modules/guest/what-sponsor_infos.php -text
+inc/modules/guest/what-sponsor_login.php -text
+inc/modules/guest/what-sponsor_reg.php -text
+inc/modules/guest/what-stats.php -text
+inc/modules/guest/what-top10.php -text
+inc/modules/guest/what-welcome.php -text
+inc/modules/guest/what-wernis_portal.php -text
+inc/modules/index.php -text
+inc/modules/loader.php -text
+inc/modules/login.php -text
+inc/modules/member/.htaccess -text
+inc/modules/member/action- -text
+inc/modules/member/action-account.php -text
+inc/modules/member/action-bank.php -text
+inc/modules/member/action-extras.php -text
+inc/modules/member/action-logout.php -text
+inc/modules/member/action-main.php -text
+inc/modules/member/action-order.php -text
+inc/modules/member/action-rals.php -text
+inc/modules/member/action-stats.php -text
+inc/modules/member/action-surfbar.php -text
+inc/modules/member/action-themes.php -text
+inc/modules/member/what- -text
+inc/modules/member/what-bank_create.php -text
+inc/modules/member/what-bank_deposit.php -text
+inc/modules/member/what-bank_infos.php -text
+inc/modules/member/what-bank_output.php -text
+inc/modules/member/what-bank_withdraw.php -text
+inc/modules/member/what-beg.php -text
+inc/modules/member/what-beg2.php -text
+inc/modules/member/what-bonus.php -text
+inc/modules/member/what-categories.php -text
+inc/modules/member/what-doubler.php -text
+inc/modules/member/what-guest.php -text
+inc/modules/member/what-holiday.php -text
+inc/modules/member/what-html_mail.php -text
+inc/modules/member/what-logout.php -text
+inc/modules/member/what-mydata.php -text
+inc/modules/member/what-newsletter.php -text
+inc/modules/member/what-nickname.php -text
+inc/modules/member/what-order.php -text
+inc/modules/member/what-payout.php -text
+inc/modules/member/what-points.php -text
+inc/modules/member/what-primera.php -text
+inc/modules/member/what-rallyes.php -text
+inc/modules/member/what-refback.php -text
+inc/modules/member/what-reflinks.php -text
+inc/modules/member/what-sponsor.php -text
+inc/modules/member/what-stats.php -text
+inc/modules/member/what-support.php -text
+inc/modules/member/what-surfbar_book.php -text
+inc/modules/member/what-surfbar_list.php -text
+inc/modules/member/what-surfbar_start.php -text
+inc/modules/member/what-surfbar_stats.php -text
+inc/modules/member/what-themes.php -text
+inc/modules/member/what-transfer.php -text
+inc/modules/member/what-unconfirmed.php -text
+inc/modules/member/what-welcome.php -text
+inc/modules/member/what-wernis.php -text
+inc/modules/order.php -text
+inc/modules/sponsor.php -text
+inc/modules/sponsor/.htaccess -text
+inc/modules/sponsor/.php -text
+inc/modules/sponsor/account.php -text
+inc/modules/sponsor/settings.php -text
+inc/modules/sponsor/welcome.php -text
+inc/modules/welcome.php -text
+inc/monthly/.htaccess -text
+inc/monthly/monthly_ -text
+inc/monthly/monthly_beg.php -text
+inc/monthly/monthly_bonus.php -text
+inc/monthly/monthly_newsletter.php -text
+inc/monthly/monthly_surfbar.php -text
+inc/mysql-connect.php -text
+inc/mysql-manager.php -text
+inc/patch-system.php -text
+inc/phpmailer/ChangeLog.txt -text
+inc/phpmailer/LICENSE -text
+inc/phpmailer/README -text
+inc/phpmailer/class.phpmailer.php -text
+inc/phpmailer/class.pop3.php -text
+inc/phpmailer/class.smtp.php -text
+inc/phpmailer/codeworxtech.html -text
+inc/phpmailer/docs/extending.html -text
+inc/phpmailer/docs/faq.html -text
+inc/phpmailer/docs/phpmailer_sm.gif -text
+inc/phpmailer/docs/pop3_article.txt -text
+inc/phpmailer/docs/use_gmail.txt -text
+inc/phpmailer/examples/contents.html -text
+inc/phpmailer/examples/images/bkgrnd.gif -text
+inc/phpmailer/examples/images/phpmailer.gif -text
+inc/phpmailer/examples/images/phpmailer.png -text
+inc/phpmailer/examples/images/phpmailer_mini.gif -text
+inc/phpmailer/examples/index.html -text
+inc/phpmailer/examples/pop3_before_smtp_test.php -text
+inc/phpmailer/examples/test1.php -text
+inc/phpmailer/examples/test_gmail.php -text
+inc/phpmailer/examples/test_mail.php -text
+inc/phpmailer/examples/test_sendmail.php -text
+inc/phpmailer/examples/test_smtp.php -text
+inc/phpmailer/language/phpmailer.lang-br.php -text
+inc/phpmailer/language/phpmailer.lang-ca.php -text
+inc/phpmailer/language/phpmailer.lang-cz.php -text
+inc/phpmailer/language/phpmailer.lang-de.php -text
+inc/phpmailer/language/phpmailer.lang-dk.php -text
+inc/phpmailer/language/phpmailer.lang-en.php -text
+inc/phpmailer/language/phpmailer.lang-es.php -text
+inc/phpmailer/language/phpmailer.lang-et.php -text
+inc/phpmailer/language/phpmailer.lang-fi.php -text
+inc/phpmailer/language/phpmailer.lang-fo.php -text
+inc/phpmailer/language/phpmailer.lang-fr.php -text
+inc/phpmailer/language/phpmailer.lang-hu.php -text
+inc/phpmailer/language/phpmailer.lang-it.php -text
+inc/phpmailer/language/phpmailer.lang-ja.php -text
+inc/phpmailer/language/phpmailer.lang-nl.php -text
+inc/phpmailer/language/phpmailer.lang-no.php -text
+inc/phpmailer/language/phpmailer.lang-pl.php -text
+inc/phpmailer/language/phpmailer.lang-ro.php -text
+inc/phpmailer/language/phpmailer.lang-ru.php -text
+inc/phpmailer/language/phpmailer.lang-se.php -text
+inc/phpmailer/language/phpmailer.lang-tr.php -text
+inc/phpmailer/phpdoc/PHPMailer/PHPMailer.html -text
+inc/phpmailer/phpdoc/PHPMailer/SMTP.html -text
+inc/phpmailer/phpdoc/PHPMailer/_class_phpmailer_php.html -text
+inc/phpmailer/phpdoc/PHPMailer/_class_smtp_php.html -text
+inc/phpmailer/phpdoc/blank.html -text
+inc/phpmailer/phpdoc/classtrees_PHPMailer.html -text
+inc/phpmailer/phpdoc/elementindex.html -text
+inc/phpmailer/phpdoc/elementindex_PHPMailer.html -text
+inc/phpmailer/phpdoc/errors.html -text
+inc/phpmailer/phpdoc/index.html -text
+inc/phpmailer/phpdoc/li_PHPMailer.html -text
+inc/phpmailer/phpdoc/media/banner.css -text
+inc/phpmailer/phpdoc/media/stylesheet.css -text
+inc/phpmailer/phpdoc/packages.html -text
+inc/phpmailer/test/phpmailer_test.php -text
+inc/phpmailer/test/phpunit.php -text
+inc/phpmailer/test/test.png -text
+inc/pool-update.php -text
+inc/profile-updte.php -text
+inc/rdf.class.php -text
+inc/reset/.htaccess -text
+inc/reset/reset_ -text
+inc/reset/reset_beg.php -text
+inc/reset/reset_bonus.php -text
+inc/reset/reset_daily.php -text
+inc/reset/reset_engine.php -text
+inc/reset/reset_holiday.php -text
+inc/reset/reset_surfbar.php -text
+inc/security.php -text
+inc/session.php -text
+inc/sql_error.php -text
+inc/stats_bonus.php -text
+inc/stylesheet.php -text
+inc/theme-manager.php -text
+inc/weekly/.htaccess -text
+inc/weekly/weekly_ -text
+inc/weekly/weekly_surfbar.php -text
 /index.php -text
 /install.php -text
 install/menu-de.sql -text
 /index.php -text
 /install.php -text
 install/menu-de.sql -text
diff --git a/inc/.htaccess b/inc/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/autopurge.php b/inc/autopurge.php
new file mode 100644 (file)
index 0000000..b312634
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/29/2004 *
+ * ===============                              Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : autopurge.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Automatical purging of outdated mail links       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von veralteten Mail-Links         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Load all includes
+$INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/autopurge/", "purge-");
+
+// Include them all
+foreach ($INC_POOL as $fqfn) {
+       // Load them only once
+       require_once($fqfn);
+} // END - foreach
+
+// Remove array
+unset($INC_POOL);
+
+if (EXT_IS_ACTIVE("rallye")) {
+       // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!)
+       require_once(PATH."inc/libs/rallye_functions.php");
+       RALLYE_DELETE_EXPIRED_RALLYES();
+}
+
+if (EXT_IS_ACTIVE("bonus")) {
+       // Check for expired turbo bonus lines
+       require_once(PATH."inc/libs/bonus_functions.php");
+       BONUS_PURGE_EXPIRED_TURBO_BONUS();
+}
+
+//
+?>
diff --git a/inc/autopurge/.htaccess b/inc/autopurge/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/autopurge/purge- b/inc/autopurge/purge-
new file mode 100644 (file)
index 0000000..ff9a9af
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/14/2008 *
+ * ===============                              Last change: 09/14/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : purge-                                           *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+} // END - if
+
+//
+?>
diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php
new file mode 100644 (file)
index 0000000..3ee1325
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/14/2008 *
+ * ===============                              Last change: 09/14/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : purge-general.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : General autopurging, nothing extension-specific  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine, nicht erweiterunsabhaengige Auto-    *
+ *                     Loeschung                                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+}
+
+if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0)) {
+       // First calculate the timestamp
+       if (function_exists('CREATE_TIME_SELECTIONS')) {
+               $PURGE = $_CONFIG['auto_purge'];
+       } else {
+               $PURGE = $_CONFIG['auto_purge'] * 24 * 60 * 60;
+       }
+
+       // Init variables
+       $admin_points = 0;
+
+       // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
+       $result = SQL_QUERY_ESC("SELECT s.id, s.userid, s.pool_id, t.price
+FROM "._MYSQL_PREFIX."_user_stats AS s
+LEFT JOIN "._MYSQL_PREFIX."_payments AS t
+ON s.payment_id=t.id
+WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
+        array(bigintval($PURGE)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0) {
+               // Start deleting procedure
+               $uid = 0; $points = 0;
+               while(list($mid, $sender, $pool, $price) = SQL_FETCHROW($result)) {
+                       // Check if confirmation links are purged or not
+                       $result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s LIMIT 1",
+                        array(bigintval($mid)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result_links) == 1) {
+                               // Free memory
+                               SQL_FREERESULT($result_links);
+
+                               // At least one link was found, enougth to pay back the points
+                               if (($uid != $sender) && ($uid > 0) && ($points > 0)) {
+                                       // Directly add points back to senders account
+                                       AUTOPURGE_ADD_POINTS($uid, $points);
+                                       $points = 0;
+                               } // END - if
+
+                               // Add points
+                               $uid = $sender; $points += $price; $admin_points += $price;
+
+                               // Remove confirmation links from queue
+                               $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s",
+                                array(bigintval($mid)), __FILE__, __LINE__);
+
+                               // Update status of order
+                               $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='DELETED' WHERE id=%s LIMIT 1",
+                                array(bigintval($pool)), __FILE__, __LINE__);
+                       } // END - if
+               } // END - while
+
+               // Add last points to last user account
+               if ($points > 0) AUTOPURGE_ADD_POINTS($uid, $points);
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Is the 'bonus' extension installed and activated?
+       if (EXT_IS_ACTIVE("bonus", true)) {
+               // Check for bonus campaigns
+               $result = SQL_QUERY_ESC("SELECT id, points FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND' AND timestamp <= %s ORDER BY id",
+                array(bigintval($PURGE)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0) {
+                       // Start deleting procedure
+                       $points = 0;
+                       while (list($bid, $price) = SQL_FETCHROW($result)) {
+                               // Check if confirmation links are purged or not
+                               $result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s",
+                                array(bigintval($bid)), __FILE__, __LINE__);
+                               if (SQL_NUMROWS($result_links) > 0) {
+                                       // At least one link was found, enougth to pay back the points
+                                       $points += $price * SQL_NUMROWS($result_links);
+
+                                       // Free memory
+                                       SQL_FREERESULT($result_links);
+
+                                       // Remove confirmation links from queue
+                                       $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s",
+                                        array(bigintval($bid)), __FILE__, __LINE__);
+
+                                       // Update status of order
+                                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='DELETED' WHERE id=%s LIMIT 1",
+                                        array(bigintval($bid)), __FILE__, __LINE__);
+                               } // END - if
+                       } // END - while
+
+                       // Add points to jackpot
+                       ADD_JACKPOT($points);
+
+                       // Add points for the admin
+                       $admin_points += $points;
+               } // END - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Add points from deleted accounts to jackpot, but here just add to notify mail
+       if ($admin_points > 0) {
+               // Send mail to admin
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_SUBJECT, "admin_autopurge_points", TRANSLATE_COMMA($points), "0");
+       } // END - if
+} // END - if
+
+//
+?>
diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php
new file mode 100644 (file)
index 0000000..b1d5bc9
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/14/2008 *
+ * ===============                              Last change: 09/14/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : purge-inactive.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Purge of inactive users                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von inaktiven Mitgliedern         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+} // END - if
+
+// Shall I look for inactive accounts and autopurge inactive accounts?
+if ($_CONFIG['autopurge_inactive'] == "Y") {
+       // Ok, let's have a look...
+       $since = bigintval($_CONFIG['ap_inactive_since']);
+       $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'];
+
+       // Check for more extensions
+       if (EXT_IS_ACTIVE("beg"))     $EXCLUDE_LIST .= " AND d.userid != c.beg_uid";
+       if (EXT_IS_ACTIVE("bonus"))   $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid";
+       if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid";
+
+       // Check for new holiday extension
+       if (GET_EXT_VERSION("holiday") >= "0.1.3") {
+               // Include only users with no active holiday
+               $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+       } // END - if
+
+       // Check for all accounts
+       $result_inactive = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.email, d.last_online
+FROM "._MYSQL_PREFIX."_user_data AS d
+WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
+".$EXCLUDE_LIST."
+ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result_inactive) > 0) {
+               // Prepare variables and constants...
+               $UIDs = "";
+               define('__INACTIVE_SINCE', ($_CONFIG['ap_inactive_since'] / 60 / 60));
+               define('__INACTIVE_TIME' , ($_CONFIG['ap_in_time']  / 60 / 60));
+
+               // Mark found accounts as inactive and send an email
+               while(list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) {
+                       // Remember userids for the admin
+                       $UIDs .= $uid.", ";
+
+                       // Get date/time from timestamp
+                       $last = MAKE_DATETIME($last, "0");
+
+                       // Load mail template
+                       $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_inactive", $last, bigintval($uid));
+                       SEND_EMAIL($email, AUTOPURGE_MEMBER_INACTIVE_SUBJECT, $msg);
+
+                       // Update this account
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET ap_notified=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+               } // END - while
+
+               // Remove last comma
+               $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
+
+               // Send mail notification to admin
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_INACTIVE_SUBJECT, "admin_autopurge_inactive", $UIDs, "");
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result_inactive);
+
+       // Now let's have a look for inactive accounts we want to delete we newly use the same exclude list
+       // here for e.g. excluding holiday users
+       $time = bigintval($_CONFIG['ap_in_time']);
+       $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
+FROM "._MYSQL_PREFIX."_user_data AS d
+WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
+".$EXCLUDE_LIST."
+ORDER BY userid",
+        array($since, $since, $time), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_inactive) > 0) {
+               // Prepare variable...
+               $UIDs = "";
+
+               // Delete inactive accounts
+               while (list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) {
+                       // Remember userids for the admin
+                       $UIDs .= $uid.", ";
+
+                       // Get date/time from timestamp
+                       $last = MAKE_DATETIME($last, "0");
+
+                       // Finnaly delete this inactive account
+                       DELETE_USER_ACCOUNT(bigintval($uid), LOAD_EMAIL_TEMPLATE("member_autopurge_delete", $last, ""));
+               } // END - while
+
+               // Remove last comma
+               $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
+
+               // Send mail notification to admin
+               if ($_CONFIG['ap_un_mail'] == "Y") {
+                       SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DELETE_SUBJECT, "admin_autopurge_delete", $UIDs, "");
+               } // END - if
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result_inactive);
+} // END - if
+
+//
+?>
diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php
new file mode 100644 (file)
index 0000000..6d49f08
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/29/2004 *
+ * ===============                              Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : autopurge.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Automatical purging of outdated mail links       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von veralteten Mail-Links         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+} // END - if
+
+// Search for mails from deleted members?
+if ($_CONFIG['ap_del_mails'] == "Y") {
+       // Okay, let's check for them...
+       $since = bigintval($_CONFIG['ap_dm_timeout']);
+       $result_mails = SQL_QUERY_ESC("SELECT sender\
+FROM "._MYSQL_PREFIX."_pool
+WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
+ORDER BY sender ASC",
+        array($since), __FILE__, __LINE__);
+
+       // Reset counter...
+       $DELETED = 0;
+
+       // Do we have "purged" mails?
+       if (SQL_NUMROWS($result_mails) > 0) {
+               // Okay, check for their sender's
+               while(list($sender) = SQL_FETCHROW($result_mails)) {
+                       // Check now...
+                       $fount = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                               array(bigintval($sender)), __FILE__, __LINE__));
+                       if ($found == 0) {
+                               // Okay we found some mails!
+                               $result_remove = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_pool WHERE sender=%s",
+                                       array(bigintval($sender)), __FILE__, __LINE__);
+                               $DELETED += SQL_AFFECTEDROWS();
+
+                               // Reset query (to prevent possible errors) ...
+                               $since = bigintval($_CONFIG['ap_dm_timeout']);
+                               $result_mails = SQL_QUERY_ESC("SELECT sender
+FROM "._MYSQL_PREFIX."_pool
+WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
+ORDER BY sender ASC",
+                                       array($since), __FILE__, __LINE__);
+                       }
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_mails);
+
+       // Now let's check for stats entries as well
+       $since = bigintval($_CONFIG['ap_dm_timeout']);
+       $result_mails = SQL_QUERY_ESC("SELECT sender
+FROM "._MYSQL_PREFIX."_user_stats
+WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
+ORDER BY sender ASC",
+               array($since), __FILE__, __LINE__);
+
+       // Do we have "purged" mails?
+       if (SQL_NUMROWS($result_mails) > 0) {
+               // Okay, check for their sender's
+               while(list($sender) = SQL_FETCHROW($result_mails)) {
+                       // Check now...
+                       $found = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($sender)), __FILE__, __LINE__));
+                       if ($found == 0) {
+                               // Okay we found some mails!
+                               $result_remove = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_stats WHERE sender=%s", array(bigintval($sender)), __FILE__, __LINE__);
+                               $DELETED += SQL_AFFECTEDROWS();
+
+                               // Reset query (to prevent possible errors) ...
+                               $since = bigintval($_CONFIG['ap_dm_timeout']);
+                               $result_mails = SQL_QUERY_ESC("SELECT sender
+FROM "._MYSQL_PREFIX."_user_stats
+WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
+ORDER BY sender ASC",
+                                       array($since), __FILE__, __LINE__);
+                       }
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_mails);
+
+       // Do we have deleted mails and the admin want's to receive a notification
+       if (($DELETED > 0) && ($_CONFIG['ap_dm_notify'] == "Y")) {
+               // Send out email to admin
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, "");
+       }
+}
+
+//
+?>
diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php
new file mode 100644 (file)
index 0000000..a2a9038
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/14/2008 *
+ * ===============                              Last change: 09/14/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : purge-tsks.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Automatical purging of outdated mail links       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von veralteten Mail-Links         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+} // END - if
+
+// Check version (must be > 0.0)
+if ((GET_EXT_VERSION("task") > "0.0") && ($_CONFIG['ap_tasks'] == "Y")) {
+       // Since when shall we purge?
+       $since = bigintval($_CONFIG['ap_tasks_time']);
+
+       // Purge deleted tasks (no notification to admin)
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY
+FROM "._MYSQL_PREFIX."_task_system
+WHERE status='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)",
+        array($since), __FILE__, __LINE__);
+       $DELETED = SQL_AFFECTEDROWS();
+
+       if (($DELETED > 0) && ($_CONFIG['ap_tasks_mail'] == "Y")) {
+               // Send out email to admin
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TASKS_SUBJECT, "admin_autopurge_tsks", $DELETED, "");
+       } // END - if
+} // END - if
+
+//
+?>
diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php
new file mode 100644 (file)
index 0000000..7e997f2
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/29/2004 *
+ * ===============                              Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : autopurge.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Automatical purging of outdated mail links       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von veralteten Mail-Links         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+       // Abort here
+       return false;
+} // END - if
+
+// Shall I auto-purge unconfirmed accounts?
+if ($_CONFIG['autopurge_unconfirmed'] == "Y") {
+       // Init variables and find unconfirmed accounts which I shall auto-purge
+       $time = bigintval($_CONFIG['ap_un_time']);
+       $result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined
+FROM "._MYSQL_PREFIX."_user_data
+WHERE status='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
+ORDER BY userid ASC",
+        array($time), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_uncon) > 0) {
+               // Prepare variable...
+               $UIDs = "";
+               define('__UNCONFIRMED_TIME' , ($_CONFIG['ap_un_time']  / 60 / 60));
+
+               // Delete inactive accounts
+               while (list($uid, $email, $joined) = SQL_FETCHROW($result_uncon)) {
+                       // Remember userids for the admin
+                       $UIDs .= $uid.", ";
+
+                       // Get date/time from timestamp
+                       $joined = MAKE_DATETIME($joined, "0");
+
+                       // Finnaly delete this inactive account
+                       DELETE_USER_ACCOUNT($uid, LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $joined, ""));
+               } // END - while
+
+               // Remove last comma
+               $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
+
+               // Send mail notification to admin
+               if ($_CONFIG['ap_un_mail'] == "Y") {
+                       SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, "");
+               } // END - if
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result_uncon);
+}
+
+//
+?>
diff --git a/inc/cache/.htaccess b/inc/cache/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/check-reset.php b/inc/check-reset.php
new file mode 100644 (file)
index 0000000..ec19cb8
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/12/2008 *
+ * ===============                              Last change: 09/12/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : check-reset.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Checks for if reset shall be executed            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Prueft ob Reset laufen soll                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// 01    2                            2        2         3321    1                         2                     21    1                        2                    21    1                        2                  21    1      2                 21    1         1    1                         2            210
+if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!defined('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1) && (!defined('DEBUG_MODE'))) {
+       // Do daily things in external PHP file but only when script is completely setup
+       // Daily reset was run!
+       define('__DAILY_RESET', true);
+
+       // Add more includes
+       $INC_POOL = RESET_ADD_INCLUDES();
+
+       // Is this not an array?
+       if (!is_array($INC_POOL)) {
+               // Log the error
+               DEBUG_LOG(basename(__FILE__).":INC_POOL is no array!");
+
+               // Skip further executions
+               return;
+       } // END - if
+
+       // Run the full reset scripts
+       foreach ($INC_POOL as $incFile) {
+               require_once($incFile);
+       } // END - foreach
+
+       // Remove array
+       unset($INC_POOL);
+} // END - if
+
+//
+?>
diff --git a/inc/databases.php b/inc/databases.php
new file mode 100644 (file)
index 0000000..99d0c01
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 05/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : databases.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Definitions and arrays (hard-coded databases)    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Definitionen und Datenfelder (hart-codertiert)   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// System-wide return codes
+define('CODE_WRONG_PASS'       ,  1);
+define('CODE_WRONG_ID'         ,  2);
+define('CODE_ID_LOCKED'        ,  3);
+define('CODE_ID_UNCONFIRMED'   ,  4);
+define('CODE_UNKNOWN_STATUS'   ,  5);
+define('CODE_NO_COOKIES'       ,  6);
+define('CODE_CNTR_FAILED'      ,  8);
+define('CODE_LOGOUT_DONE'      ,  8);
+define('CODE_LOGOUT_FAILED'    ,  9);
+define('CODE_URL_TLOCK'        , 10);
+define('CODE_URL_FOUND'        , 11);
+define('CODE_OVERLENGTH'       , 12);
+define('CODE_SUBJ_URL'         , 13);
+define('CODE_BLIST_URL'        , 14);
+define('CODE_NO_RECS_LEFT'     , 15);
+define('CODE_INVALID_TAGS'     , 16);
+define('CODE_MORE_POINTS'      , 18);
+define('CODE_COOKIES_DISABLED' , 18);
+define('CODE_DATA_INVALID'     , 19);
+define('CODE_POSSIBLE_INVALID' , 20);
+define('CODE_ACCOUNT_LOCKED'   , 21);
+define('CODE_USER_404'         , 22);
+define('CODE_STATS_404'        , 23);
+define('CODE_ALREADY_CONFIRMED', 24);
+define('CODE_ERROR_MAILID'     , 25);
+define('CODE_EXTENSION_PROBLEM', 26);
+define('CODE_MORE_RECEIVERS1'  , 28);
+define('CODE_MORE_RECEIVERS2'  , 28);
+define('CODE_MORE_RECEIVERS3'  , 29);
+define('CODE_INVALID_URL'      , 30);
+define('CODE_MENU_NOT_VALID'   , 31);
+define('CODE_LOGIN_FAILED'     , 32);
+
+// Full version string: /([0-9]){1}\.([0-9]){1}\.([0-9]){1}(-(alpha|beta|pre|rc([1-3]))([0-9]+))?/
+// If you understand regular expressions ^^^ you may know how I versionize... ;-)
+define('FULL_VERSION', "0.2.1-FINAL");
+
+// Replacement strings
+$REPLACER = array(
+       'userid'  => "%uid%",                   // User-ID
+       'surname' => "%vorname%",               // Surname
+       'family'  => "%nachname%",              // Family name
+       'gender'  => "%anrede%",                // Gender
+);
+
+// One day
+$_CONFIG['one_day'] = 60*60*24;
+
+//
+// Timestamp for yesterday, today ... all at 00:00 am
+define('START_YDAY', MAKE_TIME(0, 0, 0, time() - $_CONFIG['one_day']));
+define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
+
+$COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8);
+if ((strpos($COOKIES, "/") == "0") && (strpos(substr(URL, 8), "/") > 0)) {
+       // Script was installed into a sub directory
+       if (substr($COOKIES, -1) != "/") $COOKIES .= "/";
+} else {
+       // No more sub directories added to URL
+       $COOKIES = "/";
+}
+
+// Cookie-Path ( for lame servers... ;-) )
+define('COOKIE_PATH', $COOKIES);
+
+// Base directory for access logfiles
+define('LOGS_BASE', "logs");
+
+// Base directory for usage statistics
+define('USAGE_BASE', "usage");
+
+// Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
+define('SERVER_URL', "http://www.mxchange.org");
+
+// This current patch level
+define('CURR_SVN_REVISION', "435");
+
+// Take a prime number which is long (if you know a longer one please try it out!)
+define('_PRIME', 591623);
+
+// Calculate "entropy" with the prime number (for code generation)
+define('_ADD', (_PRIME * _PRIME / (pi() * $_CONFIG['code_length'] + 1)));
+
+// Random number for e.g. "cache-buster" used in OpenX script
+define('CACHE_BUSTER', mt_rand(1000000, 9999999));
+
+// Extra title is empty by default
+$EXTRA_TITLE = "";
+
+//
+?>
diff --git a/inc/db/.htaccess b/inc/db/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
new file mode 100644 (file)
index 0000000..fe033ae
--- /dev/null
@@ -0,0 +1,332 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/29/2004 *
+ * ===============                              Last change: 08/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : lib-mysql3.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Database layer for MySQL +3.x server             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Datenbankschicht fuer MySQL +3.x Server          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// SQL queries
+function SQL_QUERY($sql_string, $F, $L) {
+       global $link, $CSS, $_CONFIG, $OK;
+
+       // Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
+       $sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
+
+       // Starting time
+       $querytimeBefore = array_sum(explode(' ', microtime()));
+
+       // Run SQL command
+       //* DEBUG: */ echo $sql_string."<br />\n";
+       $result = @mysql_query($sql_string, $link)
+        or ADD_FATAL($F." (".$L."):".mysql_error()."<br />
+".MYSQL_QUERY_STRING."<br />
+".$sql_string);
+
+       // Save last successfull query
+       $_CONFIG['db_last_query'] = $sql_string;
+
+       // Ending time
+       $querytimeAfter = array_sum(explode(' ', microtime()));
+
+       // Calculate query time
+       $queryTime = $querytimeAfter - $querytimeBefore;
+
+       // Count this query
+       if (!isset($_CONFIG['sql_count'])) $_CONFIG['sql_count'] = 0;
+       $_CONFIG['sql_count']++;
+
+       // Debug output
+       //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<b>".SQL_AFFECTEDROWS()."</b>, numrows=<b>".SQL_NUMROWS($result)."</b><br />\n";
+
+       if (($CSS != "1") && ($CSS != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
+               //
+               // Debugging stuff...
+               //
+               $fp = @fopen(PATH."inc/cache/mysql.log", 'a') or mxchange_die("Cannot write mysql.log!");
+               if (!isset($OK)) {
+                       // Write first entry
+                       fwrite($fp, "Module=".$GLOBALS['module']."\n");
+                       $OK = true;
+               } // END - if
+               fwrite($fp, $F."(LINE=".$L."|NUM=".SQL_NUMROWS($result)."|AFFECTED=".SQL_AFFECTEDROWS()."|QUERYTIME:".$queryTime."): ".str_replace('\r', "", str_replace('\n', " ", $sql_string))."\n");
+               fclose($fp);
+       } // END - if
+
+       // Count DB hits
+       if (!isset($_CONFIG['db_hits_run'])) {
+               // Count in dummy variable
+               $_CONFIG['db_hits_run'] = 1;
+       } else {
+               // Count to config array
+               $_CONFIG['db_hits_run']++;
+       }
+
+       // Return the result
+       return $result;
+}
+
+// SQL num rows
+function SQL_NUMROWS($result) {
+       // Is the result a valid resource?
+       if (is_resource($result)) {
+               // Get the count of rows from database
+               $lines = @mysql_num_rows($result);
+
+               // Is the result empty? Then we have an error!
+               if (empty($lines)) $lines = 0;
+       } else {
+               // No resource given, no lines found!
+               $lines = 0;
+       }
+       return $lines;
+}
+
+// SQL affected rows
+function SQL_AFFECTEDROWS() {
+       global $link;
+
+       // Valid link resource?
+       if (!is_resource($link)) return false;
+
+       // Get affected rows
+       $lines = @mysql_affected_rows($link);
+
+       // Return it
+       return $lines;
+}
+
+// SQL fetch row
+function SQL_FETCHROW($result) {
+       // Init data
+       $DATA = array();
+
+       // Is a result resource set?
+       if (!is_resource($result)) return false;
+
+       $DATA = @mysql_fetch_row($result);
+       return $DATA;
+}
+
+// SQL fetch array
+function SQL_FETCHARRAY($res, $nr=0, $remove_numerical=true) {
+       // Is a result resource set?
+       if (!is_resource($res)) return false;
+
+       // Initialize array
+       $row = array();
+
+       // Load row from database
+       $row = @mysql_fetch_array($res);
+
+       // Return only arrays here
+       if (is_array($row)) {
+               // Shall we remove numerical data here automatically?
+               if ($remove_numerical) {
+                                // So let's remove all numerical elements to save memory!
+                       $max = count($row);
+                       for ($idx = 0; $idx < ($max / 2); $idx++) {
+                               // Remove entry
+                               unset($row[$idx]);
+                       }
+               }
+
+               // Return row
+               return $row;
+       } else {
+               // Return a false here...
+               return false;
+       }
+}
+
+// SQL result
+function SQL_RESULT($res, $row, $field) {
+       $result = @mysql_result($res, $row, $field);
+       return $result;
+}
+// SQL connect
+function SQL_CONNECT($host, $login, $password, $F, $L) {
+       $connect = @mysql_connect($host, $login, $password) or ADD_FATAL($F." (".$L."):".mysql_error());
+       return $connect;
+}
+// SQL select database
+function SQL_SELECT_DB($dbName, $link, $F, $L) {
+       $select = false;
+       if (is_resource($link)) {
+               $select = @mysql_select_db($dbName, $link) or ADD_FATAL($F." (".$L."):".mysql_error());
+       }
+       return $select;
+}
+// SQL close link
+function SQL_CLOSE(&$link, $F, $L) {
+       global $_CONFIG, $cacheInstance, $cacheArray;
+
+       // Is there still a valid link?
+       if (!is_resource($link)) {
+               // Skip double close
+               return false;
+       } // END - if
+
+       // Add new hits
+       $_CONFIG['db_hits'] += $_CONFIG['db_hits_run'];
+       //* DEBUG: */ echo "DB=".$_CONFIG['db_hits'].",CACHE=".$_CONFIG['cache_hits']."<br />\n";
+       if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance))) {
+               // Update counter for db/cache
+               UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])));
+       } // END - if
+
+       // Close database link and forget the link
+       $close = @mysql_close($link) or ADD_FATAL($F." (".$L."):".mysql_error());
+       $link = null;
+       return $close;
+}
+// SQL free result
+function SQL_FREERESULT($result) {
+       if (!is_resource($result)) {
+               // Abort here
+               return false;
+       } // END - if
+
+       $res = @mysql_free_result($result);
+       return $res;
+}
+// SQL string escaping
+function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true) {
+       global $link;
+
+       if ($strip) {
+               $strip = "true";
+       } else {
+               $strip = "false";
+       }
+
+       $query = "";
+       $eval = "\$query = sprintf(\"".$qstring."\"";
+       foreach ($data as $var) {
+               if ((!empty($var)) || ($var === 0)) {
+                       $eval .= ", SQL_ESCAPE(\"".$var."\",true,".$strip.")";
+               } else {
+                       $eval .= ", ''";
+               }
+       }
+       $eval .= ");";
+       //
+       // Debugging
+       //
+       //$fp = fopen(PATH."inc/cache/escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
+       //fwrite($fp, $file."(".$line."): ".str_replace("\r", "", str_replace("\n", " ", $eval))."\n");
+       //fclose($fp);
+       @eval($eval);
+       // Was the eval() command fine?
+       if (empty($query)) {
+               // Something went wrong?
+               print "eval=".htmlentities($eval)."<pre>";
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
+       if ($run) {
+               // Run SQL query (default)
+               return SQL_QUERY($query, $file, $line);
+       } else {
+               // Return secured string
+               return $query;
+       }
+}
+// Get ID from last INSERT command
+function SQL_INSERTID() {
+       return @mysql_insert_id();
+}
+// Escape a string for the database
+function SQL_ESCAPE($str, $secureString=true,$strip=true) {
+       global $link;
+
+       // Secure string first? (which is the default behaviour!)
+       if ($secureString) {
+               // Then do it here
+               $str = secureString($str, $strip);
+       } // END - if
+
+       if (!is_resource($link)) {
+               // Fall-back to addslashes() when there is no link
+               return addslashes($str);
+       } // END - if
+
+       if (function_exists('mysql_real_escape_string')) {
+               // The new and improved version
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />\n";
+               return mysql_real_escape_string($str, $link);
+       } elseif (function_exists('mysql_escape_string')) {
+               // The obsulete function
+               return mysql_escape_string($str, $link);
+       } else {
+               // If nothing else works
+               return addslashes($str);
+       }
+}
+// SELECT query string from table, columns and so on... ;-)
+function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
+       // Prepare the SQL statement
+       $SQL = "SELECT ".implode(", ", $columns)." FROM "._MYSQL_PREFIX."_".$table." WHERE ".$idRow."=%s LIMIT 1";
+
+       // Return the result
+       return SQL_QUERY_ESC($SQL, array(bigintval($id)), $F, $L);
+}
+// ALTER TABLE wrapper function
+function SQL_ALTER_TABLE($sql, $F, $L) {
+       // Shall we add?
+       if (eregi("ADD", $sql) > 0) {
+               // Extract table name
+               $tableArray = explode(" ", $sql);
+               $tableName = str_replace("`", "", $tableArray[2]);
+
+               // And column name as well
+               $columnName = str_replace("`", "", $tableArray[4]);
+
+               // Get column information
+               $result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
+                       array($tableName, $columnName), $F, $L);
+
+               // Do we have no entry?
+               if (SQL_NUMROWS($result) == 0) {
+                       // Do the query
+                       return SQL_QUERY($sql, $F, $L, false);
+               } // END - if
+       } else {
+               // Send it to the SQL_QUERY() function
+               return SQL_QUERY($sql, $F, $L, false);
+       }
+}
+//
+?>
diff --git a/inc/db/lib.php b/inc/db/lib.php
new file mode 100644 (file)
index 0000000..7578d60
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/31/2004 *
+ * ===============                              Last change: 08/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : lib.php                                          *
+ * -------------------------------------------------------------------- *
+ * Short description : SQL abstraction layer                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : SQL-Typ auswaehlen                               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Select MySQL 3 as default database type
+if (_DB_TYPE == "_DB_TYPE") define('_DB_TYPE', "mysql3");
+
+// Create include file name
+$INC = sprintf("%sinc/db/lib-%s.php", PATH, _DB_TYPE);
+
+if ((file_exists($INC)) && (is_readable($INC))) {
+       // Include abstraction layer
+       require_once($INC);
+} else {
+       // Bye, bye...
+       die("Cannot load database abstraction layer! R.I.P.");
+}
+
+//
+?>
diff --git a/inc/doubler_send.php b/inc/doubler_send.php
new file mode 100644 (file)
index 0000000..f3084e2
--- /dev/null
@@ -0,0 +1,175 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/16/2005 *
+ * ===============                              Last change: 01/21/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : doubler_send.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Send's out mails for doubled points              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sendet Mails bei vergueteter Verdoppelung aus    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Initialize variables
+$jackpot = 0; $user = 0;
+
+// Get total points of the doubler itself
+$DOUBLER_POINTS = DOUBLER_GET_TOTAL_POINTS_LEFT();
+if ($DOUBLER_POINTS == 0) {
+       // Exit here to prevent some SQL errors (SQL_QUERY_ESC doen't insert zeros! We need to fix this...)
+       return;
+}
+
+// If not currently doubled set it to zero
+unset($_GET['DOUBLER_UID']);
+unset($_POST['DOUBLER_UID']);
+set_session('DOUBLER_UID', "");
+if (empty($DOUBLER_UID)) $DOUBLER_UID = 0;
+
+// Check for doubles which we can pay out
+$min = bigintval($_CONFIG['doubler_min'] * 2);
+$result_total = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark
+FROM "._MYSQL_PREFIX."_doubler AS d
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS u
+ON d.userid=u.userid
+WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
+ORDER BY d.timemark", array($DOUBLER_POINTS, $min), __FILE__, __LINE__);
+
+// Check for accounts with limitation
+$result_main = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark
+FROM "._MYSQL_PREFIX."_doubler AS d
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS u
+ON d.userid=u.userid
+WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
+ORDER BY d.timemark
+LIMIT %d", array($DOUBLER_POINTS, $min, $_CONFIG['doubler_max_sent']), __FILE__, __LINE__);
+
+if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) || ((SQL_NUMROWS($result_main) == $_CONFIG['doubler_group_sent']) && ($_CONFIG['doubler_sent_all'] == "N")))
+{
+       // Switch to matching SQL resource
+       $result_load = $result_main;
+       if ((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) $result_load = $result_total;
+
+       // At least one account was found
+       while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load))
+       {
+               // Only double when points are enougth!
+               if ($DOUBLER_POINTS >= $points)
+               {
+                       // Check for his ref points
+                       $result_ref = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_doubler WHERE refid=%s AND completed='N' AND is_ref='Y'",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+                       list($ref) = SQL_FETCHROW($result_ref);
+
+                       // Free memory
+                       SQL_FREERESULT($result_ref);
+
+                       // Zero refid when empty (might be helpful!)
+                       if (empty($ref)) $ref = 0;
+                       if (($ref > 0) && ($DOUBLER_UID == $uid) && (!empty($ref)))
+                       {
+                               // Referral points found so add them and set line(s) to completed='Y'
+                               $points += $ref;
+                               $result_ref = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_doubler SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'",
+                                array(bigintval($uid)), __FILE__, __LINE__);
+                       }
+                        else
+                       {
+                               // No referral points found
+                               $ref = 0;
+                       }
+
+                       // Exclude webmaster from doubling...
+                       if ($uid != $_CONFIG['doubler_uid']) {
+                               // Add points
+                               ADD_POINTS_REFSYSTEM($uid, $points, false, "0", false, "direct");
+                       } // END - if
+
+                       // Set entry as "payed"
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_doubler SET completed='Y' WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+
+                       $OK = false;
+                       // Check for jackpot inclusion in doubling process
+                       if (($jackpot > 0) && ($jackpot >= $points) && ($_CONFIG['doubler_jackpot'] == "Y"))
+                       {
+                               // Subtract points from jackpot
+                               SUB_JACKPOT($points);
+                               $jackpot -= $points;
+
+                               // Okay, done!
+                               $OK = true;
+                       }
+
+                       // Exclude also webmaster's ID in taking points from webmaster's account
+                       if (($user > 0) && ($user >= $points) && (!$OK) && ($_CONFIG['doubler_uid'] > 0) && ($uid != $_CONFIG['doubler_uid']))
+                       {
+                               // Add points to used points
+                               SUB_POINTS($_CONFIG['doubler_uid'], $points);
+
+                               // Okay, done!
+                               $OK = true;
+                       }
+
+                       // Update doubler's account only when others are not updated
+                       if (!$OK) {
+                               // Add points to used doubler points
+                               UPDATE_CONFIG("doubler_used", $points, "+");
+                       }
+
+                       // Update variables to prevent errors
+                       $_CONFIG['doubler_used'] += $points;
+                       $DOUBLER_POINTS -= $points;
+
+                       // Prepare array
+                       $content = array(
+                               // Doubler transmission ID
+                               'id'     => $id,
+                               // Doubled points
+                               'points' => TRANSLATE_COMMA($points),
+                               // Timemark
+                               'when'   => MAKE_DATETIME($time, "2"),
+                               // IP number when the member submitted the doubling form
+                               'ip'     => $ip,
+                       );
+
+                       // Load mail template and send mail away...
+                       $msg = LOAD_EMAIL_TEMPLATE("member_doubler", $content, $uid);
+                       SEND_EMAIL($uid, DOUBLER_MEMBER_SUBJECT, $msg);
+               }
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result_total);
+SQL_FREERESULT($result_main);
+
+//
+?>
diff --git a/inc/extensions.php b/inc/extensions.php
new file mode 100644 (file)
index 0000000..0b75f56
--- /dev/null
@@ -0,0 +1,643 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/25/2004 *
+ * ===============                              Last change: 09/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : extensions.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Extension management                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweiterungen-Management                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
+{
+       global $NOTES, $_CONFIG, $INC_POOL, $cacheInstance;
+       // We want to register an extension and registration status is by default "failed" (= false)
+       $EXT_LOAD_MODE = "register"; $ret = false; $SQLs = array();
+       $INC_POOL = array();
+
+       // This shall never do a non-admin user!
+       if (!IS_ADMIN()) return false;
+
+       // Is this extension already installed?
+       if (EXT_IS_ACTIVE($ext_name)) return false;
+
+       // Generate file name
+       $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+
+       // Does this extension exists?
+       if (FILE_READABLE($file)) {
+               // Extension was found so we can load it in registration mode
+               $EXT_ALWAYS_ACTIVE = "N";
+               require($file);
+
+               // And run possible updates
+               $EXT_LOAD_MODE = "update"; $EXT_UPDATE_DEPENDS = "";
+               foreach ($EXT_VER_HISTORY as $EXT_VER) {
+                       // Load extension in update mode
+                       require($file);
+
+                       // Do we have an update?
+                       if (((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+                               if (!empty($UPDATE_NOTES)) {
+                                       // Update notes found
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".$UPDATE_NOTES."<br /><br />\n";
+                                       $UPDATE_NOTES = "";
+                               } elseif (($EXT_VER == "0.0") || ($EXT_VER == "0.0.0")) {
+                                       // Initial release
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".INITIAL_RELEASE."<br /><br />\n";
+                               } else {
+                                       // No update notes found!
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br /><I>".NO_UPDATE_NOTES."</I><br /><br />\n";
+                               }
+                       } // END - if
+               } // END - foreach
+
+               // Does this extension depends on an outstanding update of another update?
+               if (!empty($EXT_UPDATE_DEPENDS)) {
+                       // Backup SQL commands and clear current
+                       $SQLs2 = $SQLs;
+                       $SQLs  = array();
+                       $test  = false;
+
+                       // Backup language as well
+                       $LANG_BCK = $EXT_LANG_PREFIX;
+                       $EXT_ALWAYS_ACTIVE = "N";
+
+                       // Load required extension also in update mode
+                       $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $EXT_UPDATE_DEPENDS);
+
+                       // Check for required file
+                       if (FILE_READABLE($file)) {
+                               // File exists so let's load it
+                               $VER_BACKUP = $EXT_VERSION;
+                               $EXT_ALWAYS_ACTIVE = "N";
+                               require($file);
+                               $EXT_VERSION = $VER_BACKUP;
+
+                               // If versions mismatch update extension first
+                               $ext_ver = GET_EXT_VERSION($EXT_UPDATE_DEPENDS);
+
+                               // Extension version set?
+                               if (empty($ext_ver)) {
+                                       // Extension not registered so far so first load task's ID...
+                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE task_type='EXTENSION' AND subject LIKE '[%s:]%%' LIMIT 1",
+                                        array($EXT_UPDATE_DEPENDS), __FILE__, __LINE__);
+
+                                       // Entry found?
+                                       if (SQL_NUMROWS($result) == 1) {
+                                               // Task found so load task's ID and register extension...
+                                               list($task) = SQL_FETCHROW($result);
+
+                                               // Try to register the extension
+                                               $test = EXTENSION_REGISTER($EXT_UPDATE_DEPENDS, $task, $dry_run);
+                                       } // END - if
+
+                                       // Free result
+                                       SQL_FREERESULT($result);
+                               } elseif ($ext_ver != $EXT_VERSION) {
+                                       // Ok, update this extension now
+                                       EXTENSION_UPDATE(basename($file), $EXT_UPDATE_DEPENDS, $ext_ver, $dry_run);
+
+                                       // All okay!
+                                       $test = true;
+                               } else {
+                                       // Nothing to register / update before...
+                                       $test = true;
+                               }
+                       } else {
+                               // Required file for update does not exists!
+                               $test = true;
+                               // But this is fine for the first time...
+                       }
+
+                       // Finally restore previous SQLs
+                       $SQLs = $SQLs2; unset($SQLs2);
+                       $EXT_LANG_PREFIX = $LANG_BCK;
+               } else {
+                       // Does not depend on an other extension
+                       $test = true;
+               }
+
+               // Switch back to register mode
+               $EXT_LOAD_MODE = "register";
+
+               // Does everthing before wents ok?
+               if ($test) {
+                       // "Dry-run-mode" activated?
+                       if (!$dry_run) {
+                               // Run all SQLs
+                               foreach ($SQLs as $sql) {
+                                       // Trim spaces away which we don't need
+                                       $sql = trim($sql);
+
+                                       // Is there still an SQL query?
+                                       if (!empty($sql)) {
+                                               // Do we have an "ALTER TABLE" command?
+                                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                                       // Analyse the alteration command
+                                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                                               } else {
+                                                       // Run regular SQL command
+                                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               }
+                                       } // END - if
+                               } // END - foreach
+
+                               // Remove cache file(s) if extension is active
+                               if ((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) {
+                                       //* DEBUG: */ echo __LINE__.": DESTROY!<br />\n";
+                                       // Remove cache files
+                                       if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("mod_reg", true))    $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("config", true))     $cacheInstance->cache_destroy();
+                               } // END - if
+
+                               // Check for added include files
+                               if (count($INC_POOL > 0)) {
+                                       // Loads every include file
+                                       foreach ($INC_POOL as $inc) {
+                                               require_once($inc);
+                                       } // END - foreach
+
+                                       // Remove array
+                                       unset($INC_POOL);
+                               } // END - if
+
+                               // Register extension
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_extensions (ext_name, ext_lang_file, ext_active, ext_version) VALUES ('%s','%s','%s','%s')",
+                                array($ext_name, $EXT_LANG_PREFIX, $EXT_ALWAYS_ACTIVE, $EXT_VERSION), __FILE__, __LINE__);
+
+                               // Update task management
+                               ADMIN_SOLVE_TASK($id);
+
+                               // @TODO This causes the whole (!) menu cache being purged
+                               CACHE_PURGE_ADMIN_MENU();
+
+                               // In normal mode return a true on success
+                               $ret = true;
+
+                               // Remove SQLs
+                               unset($SQLs);
+                       } else {
+                               // Rewrite SQL command to keep { and } inside
+                               foreach ($SQLs as $key => $sql) {
+                                       $sql = str_replace('{', "&#123;", str_replace('}', "&#125;", $sql));
+                                       $SQLs[$key] = $sql;
+                               } // END - foreach
+
+                               // In  "dry-run" mode return array with all SQL commands
+                               $ret = $SQLs;
+
+                               // Remove all SQL commands
+                               unset($SQLs);
+                       }
+               } else {
+                       // No, an error occurs while registering extension :-(
+                       $ret = false;
+               }
+       } elseif (($id > 0) && (!empty($ext_name))) {
+               // Remove task from system when id and extension's name is valid
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE id=%s AND status='NEW' LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+       }
+
+       // Is this the sql_patches?
+       //* DEBUG: */ echo __LINE__.":{$ext_name}/{$EXT_LOAD_MODE}<br />\n";
+       if (($ext_name == "sql_patches") && (($EXT_LOAD_MODE == "register") || ($EXT_LOAD_MODE == "remove")) && (!$dry_run) && ($test)) {
+               // Then redirect to logout
+               //* DEBUG: */ echo __LINE__.": LOAD!<br />\n";
+               LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
+       } // END - if
+
+       // Return status code
+       return $ret;
+}
+//
+function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
+       global $cacheInstance, $_CONFIG;
+       $SQLs = array();
+
+       // Extensions are never active by default
+       $EXT_ALWAYS_ACTIVE = "N";
+
+       // By default no SQL has been executed
+       $sqlRan = false;
+
+       // This shall never do a non-admin user!
+       if (!IS_ADMIN()) return false;
+
+       // Get extension's name
+       $ext_name = GET_EXT_NAME($id);
+       if (empty($ext_name)) return false;
+
+       // Load extension in detected mode
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ext_name[{$id}]={$ext_name}<br />\n";
+       $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+       if (FILE_READABLE($file)) {
+               // Load the include
+               require($file);
+       } // END - if
+
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):SQLs::count=".count($SQLs)."<br />\n";
+       if ((is_array($SQLs) && (sizeof($SQLs) > 0))) {
+               // Run SQL commands...
+               foreach ($SQLs as $sql) {
+                       // Trim spaces away which we don't need
+                       $sql = trim($sql);
+
+                       // Is there still an SQL query?
+                       if (!empty($sql)) {
+                               // Do we have an "ALTER TABLE" command?
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):SQL={$SQL}<br />\n";
+                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                       // Analyse the alteration command
+                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                               } else {
+                                       // Run regular SQL command
+                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                               }
+
+                               // An SQL has been executed
+                               $sqlRan = true;
+                       } // END - if
+               } // END - foreach
+
+               // Removal mode?
+               if ($EXT_LOAD_MODE == "remove") {
+                       // Delete this extension (remember to remove it from your server *before* you click on welcome!
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
+                        array($id), __FILE__, __LINE__);
+               } // END - if
+
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mode={$EXT_LOAD_MODE}<br />\n";
+
+               // Is this the sql_patches?
+               //* DEBUG: */ echo __LINE__.": {$id}/{$ext_name}/{$EXT_LOAD_MODE}<br />\n";
+               if (($ext_name == "sql_patches") && (($EXT_LOAD_MODE == "register") || ($EXT_LOAD_MODE == "remove"))) {
+                       // Then redirect to logout
+                       //* DEBUG: */ echo __LINE__.": LOAD!<br />\n";
+                       LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
+               } // END - if
+       } // END - if
+
+       // Remove cache file(s) if extension is active
+       if (((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) && (((SQL_AFFECTEDROWS() == 1)) || ($sqlRan === true) || ($EXT_LOAD_MODE == "activate") || ($EXT_LOAD_MODE == "deactivate"))) {
+               //* DEBUG: */ echo __LINE__.": DESTROY!<br />\n";
+               // Remove cache files
+               if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("mod_reg", true))    $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("config", true))     $cacheInstance->cache_destroy();
+
+               // @TODO This causes the whole (!) menu cache being purged
+               CACHE_PURGE_ADMIN_MENU();
+       } // END - if
+}
+// Check if given extension is active
+function EXT_IS_ACTIVE ($ext_name) {
+       global $cacheArray, $_CONFIG;
+
+       // Extensions are all inactive during installation
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
+
+       // Not active is the default
+       $active = "N";
+
+       // Check cache
+       if (!empty($cacheArray['extensions']['ext_active'][$ext_name])) {
+               // Load from cache
+               //* DEBUG: */ echo "CACHE! ext_name={$ext_name}<br />\n";
+               $active = $cacheArray['extensions']['ext_active'][$ext_name];
+
+               // Count cache hits
+               if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++;
+       } elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) {
+               //* DEBUG: */ echo "DB! ext_name={$ext_name}<br />\n";
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT ext_active FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                array($ext_name), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 0) {
+                       // Extension was not found!
+                       return false;
+               }
+
+               // Load entry
+               list($active) = SQL_FETCHROW($result);
+
+               // Free result
+               SQL_FREERESULT($result);
+
+
+               // Write cache array
+               //* DEBUG: */ echo $ext_name."[DB]: {$active}<br />\n";
+               $cacheArray['extensions']['ext_active'][$ext_name] = $active;
+       } else {
+               // Extension not active!
+               //* DEBUG: */ echo $ext_name.": Not active!<br />\n";
+               $cacheArray['extensions']['ext_active'][$ext_name] = "N";
+       }
+
+       // Debug message
+       //DEBUG_LOG(__FUNCTION__.": ext_name={$ext_name},active={$active}");
+
+       // Is this extension activated? (For admins we always have active extensions...)
+       return ($active == "Y");
+}
+// Get version from extensions
+function GET_EXT_VERSION ($ext_name) {
+       global $cacheArray, $_CONFIG, $cacheInstance;
+       $ret = false;
+
+       // Extensions are all inactive during installation
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$ext_name}<br />\n";
+
+       // Is the cache written?
+       if (!empty($cacheArray['extensions']['ext_version'][$ext_name])) {
+               // Load data from cache
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): CACHE!<br />\n";
+               $ret = $cacheArray['extensions']['ext_version'][$ext_name];
+
+               // Count cache hits
+               if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
+       } elseif (!is_object($cacheInstance)) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                array($ext_name), __FILE__, __LINE__);
+               list($ret) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Set cache
+               $cacheArray['extensions']['ext_version'][$ext_name] = $ret;
+       }
+
+       // Return result
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ret={$ret}<br />\n";
+       return $ret;
+}
+//
+function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
+{
+       // This shall never do a non-admin user!
+       global $cacheInstance, $_CONFIG, $NOTES;
+
+       // Init arrays
+       $SQLs = array(); $INC_POOL = array();
+
+       // Only admins are allowed to update extensions
+       if ((!IS_ADMIN()) || (empty($ext))) return false;
+
+       // Load extension in update mode
+       $EXT_LOAD_MODE = "update"; $EXT_UPDATE_DEPENDS = ""; $NOTES = "";
+
+       // Load extension file
+       include(sprintf("%sinc/extensions/%s", PATH, $file));
+
+       if (!empty($EXT_UPDATE_DEPENDS)) {
+               // Update another extension first!
+               $test = EXTENSION_UPDATE(("ext-".$EXT_UPDATE_DEPENDS.".php"), $EXT_UPDATE_DEPENDS, GET_EXT_VERSION($EXT_UPDATE_DEPENDS), $dry_run);
+       }
+
+       // Check if version is updated
+       if ((($EXT_VERSION != $EXT_VER) || ($dry_run)) && (is_array($EXT_VER_HISTORY)))
+       {
+               // Search for starting point
+               $start = array_search($EXT_VER, $EXT_VER_HISTORY);
+               $NOTES = "";
+
+               // And load SQL queries in order of version history
+               for ($idx = ($start + 1); $idx < sizeof($EXT_VER_HISTORY); $idx++)
+               {
+                       // Remove old SQLs array to prevent possible bugs
+                       if (!$dry_run) { unset($SQLs); $SQLs = array(); }
+
+                       // Set version
+                       $EXT_VER = $EXT_VER_HISTORY[$idx];
+
+                       // Include again...
+                       include(PATH."inc/extensions/".$file);
+
+                       // Add notes
+                       if ($_CONFIG['verbose_sql'] == "Y")
+                       {
+                               $EXT_VER = $EXT_VER_HISTORY[$idx];
+                               if (!empty($UPDATE_NOTES))
+                               {
+                                       // Update notes found
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".$UPDATE_NOTES."<br /><br />\n";
+                                       $UPDATE_NOTES = "";
+                               }
+                                elseif ($EXT_VER == "0.0")
+                               {
+                                       // Initial release
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br />".INITIAL_RELEASE."<br /><br />\n";
+                               }
+                                else
+                               {
+                                       $NOTES .= "<STRONG>v".$EXT_VER.":</STRONG><br /><I>".NO_UPDATE_NOTES."</I><br /><br />\n";
+                               }
+                       }
+
+                       // In real-mode execute any existing includes
+                       if ((!$dry_run) && (count($INC_POOL) > 0)) {
+                               // Include all files
+                               foreach ($INC_POOL as $fqfn) {
+                                       require_once($fqfn);
+                               } // END - foreach
+                       } // END - if
+
+                       // Run SQLs
+                       if ((is_array($SQLs)) && (!$dry_run)) {
+                               // Run SQL commands
+                               foreach ($SQLs as $sql)
+                               {
+                                       $sql = trim($sql);
+                                       if (!empty($sql))
+                                       {
+                                               // Do we have an "ALTER TABLE" command?
+                                               if (substr(strtolower($sql), 0, 11) == "alter table") {
+                                                       // Analyse the alteration command
+                                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
+                                               } else {
+                                                       // Run regular SQL command
+                                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
+                                               }
+                                       }
+                               }
+                       } elseif (GET_EXT_VERSION("sql_patches") == "") {
+                               // Remove SQLs if extension is not installed
+                               $SQLs = array();
+                       }
+               }
+
+               if (!$dry_run)
+               {
+                       // In normal mode insert task and update extension's version...
+                       $ext_subj = "[UPDATE-".$ext."-".$EXT_VERSION.":] ".ADMIN_UPDATE_EXT_SUBJ;
+
+                       // Create task
+                       CREATE_EXTENSION_UPDATE_TASK(GET_ADMIN_ID(get_session('admin_login')), $ext_subj, addslashes($NOTES));
+
+                       // Update extension's version
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_version='%s' WHERE ext_name='%s' LIMIT 1",
+                        array($EXT_VERSION, $ext), __FILE__, __LINE__);
+
+                       // Update cache
+                       if (EXT_IS_ACTIVE("cache")) {
+                               if ($cacheInstance->cache_file("extensions", true) == true) $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("config", true) == true)     $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("mod_reg", true) == true)    $cacheInstance->cache_destroy();
+                       } // END - if
+
+                       // Remove array
+                       unset($SQLs);
+               } else {
+                       // In "dry-run" mode return array with SQL commands
+                       return $SQLs;
+               }
+       }
+}
+//
+function EXTENSION_VERBOSE_TABLE($SQLs, $title = ADMIN_SQLS_EXECUTED_ON_REMOVAL, $dashed = "", $switch = false, $WIDTH = "480") {
+       global $_CONFIG;
+
+       $S = false; $SW = 2; $i = 1;
+       $OUT = "";
+       if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+               $OUT  = "<DIV align=\"center\">
+<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$WIDTH."\" align=\"center\"".$dashed.">
+<TR>
+  <TD colspan=\"2\" align=\"center\" class=\"admin_title bottom2\" height=\"24\">
+    <STRONG>".$title.":</STRONG>
+  </TD>
+</TR>\n";
+               foreach ($SQLs as $idx => $sql) {
+                       $sql = trim($sql);
+                       if (!empty($sql)) {
+                               $S = true;
+                               $OUT .= "<TR>
+  <TD class=\"switch_sw".(3 - $SW)." bottom2\" style=\"padding-left: 2px\" width=\"30\">".$i.".</TD>
+  <TD class=\"switch_sw".(3 - $SW)." bottom2\" style=\"padding-left: 5px; padding-right: 5px\">
+    ".$sql."
+  </TD>
+</TR>\n";
+                               if ($switch) $SW = 3 - $SW;
+                               $i++;
+                       }
+               }
+       }
+
+       if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+               // No addional SQL commands to run
+               $OUT .= "<TR>
+  <TD colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
+    <FONT class=\"admin_note\">".ADMIN_NO_ADDIONAL_SQLS."</FONT>
+  </TD>
+</TR>\n";
+       }
+
+       if (!empty($OUT)) {
+               // Add missing close-table tag
+               $OUT .= "</TABLE>
+</DIV>\n";
+       }
+
+       // Return output
+       return $OUT;
+}
+// Get extension name from id
+function GET_EXT_NAME ($id) {
+       $ret = "";
+       global $cacheArray, $_CONFIG;
+       if (!empty($cacheArray['extensions']['ext_name'][$id])) {
+               // Load from cache
+               $ret = $cacheArray['extensions']['ext_name'][$id];
+
+               // Count cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($ret) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+       }
+       return $ret;
+}
+// Get extension id from name
+function GET_EXT_ID($name) {
+       $ret = 0;
+       global $cacheArray, $_CONFIG;
+       if (isset($cacheArray['extensions']['ext_id'][$name])) {
+               // Load from cache
+               $ret = $cacheArray['extensions']['ext_id'][$name];
+
+               // Count cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                array($name), __FILE__, __LINE__);
+               list($ret) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+       }
+
+       // Return value
+       return $ret;
+}
+// Activate given extension
+function ACTIVATE_EXTENSION($ext_name) {
+       // Activate the extension
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='Y' WHERE ext_name='%s' LIMIT 1",
+               array($ext_name), __FILE__, __LINE__);
+
+       // Extension has been activated?
+       if (SQL_AFFECTEDROWS() == 1) {
+               // Then run all queries
+               EXTENSION_RUN_SQLS(GET_EXT_ID($ext_name), "activate");
+       } // END - if
+}
+// Checks wether the extension is older than given
+function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
+       // Get current extension version
+       $currVersion = GET_EXT_VERSION($ext_name);
+
+       // Remove all dots from both versions
+       $currVersion = str_replace(".", "", $currVersion);
+       $ext_ver = str_replace(".", "", $ext_ver);
+
+       // Now compare both and return the result
+       return ($currVersion < $ext_ver);
+}
+
+//
+?>
diff --git a/inc/extensions/.htaccess b/inc/extensions/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/extensions/ext- b/inc/extensions/ext-
new file mode 100644 (file)
index 0000000..d5f3294
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/25/2004 *
+ * ================                             Last change: 09/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-                                             *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+
+       // Load CSS file?
+       $EXT_CSS = 'Y';
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "xxx";
+
+//
+?>
diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php
new file mode 100644 (file)
index 0000000..d3d013a
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/03/2004 *
+ * ================                             Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-active.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : "Last active users"                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : "Zuletzt aktiv gewesenen Mitglieder              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.8";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','active','Heute Online', 10, 'N','Y')";
+
+       // Load CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='active' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_active' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='N', locked='N' WHERE what='active' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='N', locked='Y' WHERE what='active' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD active_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_active','Aktiv-Liste','Einstellungen an der Aktiv-Liste (<STRONG>Heute Online</STRONG> im Gastbereich) vornehmen.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Aktiven-Liste im Gastbereich ist nun einschr&auml;nkbar.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "active";
+
+//
+?>
diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php
new file mode 100644 (file)
index 0000000..8b389d0
--- /dev/null
@@ -0,0 +1,296 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ================                             Last change: 10/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-admins.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Administrator management                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin-Accountsverwaltung                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version of this extension
+$EXT_VERSION = "0.7.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.3", "0.3.1", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='admins' LIMIT 1";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins', NULL, 'Admin-Management','Administratoren anlegen, l&ouml;schen oder Passwort/E-Mail Adresse &auml;ndern.','1')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_add','Admin hinzuf&uuml;gen','Neuen Admin-Account anlegen','0')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_edit','Admin-Account &auml;ndern','Bestehende Admin-Accounts bearbeiten: E-Mail-Adresse, Passwort und/oder Login-Name &auml;ndern.','1')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='admins' LIMIT 5";
+       $SQLs[] = "DROP TABLE "._MYSQL_PREFIX."_admins_acls";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP default_acl";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.2": // SQL queries for v0.2
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_contact','Admin kontaktieren','Kontaktiert einen Admin per Mail oder Nachricht (nur wenn messaging-Erweiterung installiert ist).','2')";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "F&uuml;gt den Men&uuml;punkt &quot;Admin kontaktieren&quot; hinzu.";
+               break;
+
+       case "0.3": // SQL queries for v0.3
+               // Add admin menu
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','config_admins','ACL einstellen','Richten Sie Zugriffskontrollzeilen f&uuml;r jeden Admin individuell ein, um ihm nur bestimmte Bereiche des Admin-Bereiches zug&auml;nglich zu machen oder zu sperren.','4')";
+
+               // Which is the default setting when you create a new admin login?
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admins_default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'";
+
+               // Default is deny everything
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'";
+
+               // But allow current admin everything (THIS SHALL BE YOU!)
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admins SET default_acl='allow' WHERE login='".get_session('admin_login')."' LIMIT 1";
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admins_acls";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admins_acls (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+action_menu VARCHAR(255) NOT NULL DEFAULT '',
+what_menu VARCHAR(255) NOT NULL DEFAULT '',
+access_mode ENUM('deny','allow') NOT NULL DEFAULT 'deny',
+KEY (admin_id),
+PRIMARY KEY (id)
+) TYPE=MyISAM";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sogn. ACLs werden hinzugef&uuml;gt: <STRONG>A</STRONG>ccess <STRONG>C</STRONG>ontrol <STRONG>L</STRONG>ines sind zu deutsch Zugriffkontrollzeilen, mit denen Sie einstellen k&ouml;nnen, was welcher Admin machen darf oder nicht.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins_acls MODIFY id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admins_mails";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admins_mails (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+mail_template VARCHAR(255) NOT NULL,
+KEY (admin_id),
+PRIMARY KEY (id)
+) TYPE=MyISAM";
+               $SQLs[] = "INSERT INTO  "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_mails','Admin-Mails','Stellen Sie hier ein, welcher Admin welche Mail erhalten soll. Sie k&ouml;nnen dies (derzeit) jedoch erst, wenn einmal die Mail versendet wurde!','5')";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Kontrollieren Sie, welche Mails welcher Admin oder alle (admin_id=0) bekommen soll oder im UserLog (admin_id=-1) verzeichnet werden soll. Standartm&auml;ssig wird weiter an alle versendet.";
+               break;
+
+       case "0.4.1": // SQL queries for v0.4.1
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template LIKE '% %'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Admins-Mails-Tabelle geleert.";
+
+       case "0.4.4": // SQL queries for v0.4.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "&amp;admin= in &amp;amp;admin= umgewandelt.";
+               break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitet auf Cache-System";
+               break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit cache-Erweiterung gefixt. Der Admin-Bereich war permanent gesperrt.";
+               break;
+
+       case "0.4.7": // SQL queries for v0.4.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es wurde die Zeitmarke der Cache-Datei admins.cache mit ber&uuml;cksichtigt.";
+               break;
+
+       case "0.4.8": // SQL queries for v0.4.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.4.9": // SQL queries for v0.4.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.5.0": // SQL queries for v0.5.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.5.1": // SQL queries for v0.5.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Cache wird endlich gel&oumlscht, wenn Admin entfernt wird.";
+               break;
+
+       case "0.5.2": // SQL queries for v0.5.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "L&ouml;schen von Admin-Accounts repariert und HTML-Code ausgelagert in Templates.";
+               break;
+
+       case "0.5.3": // SQL queries for v0.5.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.5.4": // SQL queries for v0.5.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.5.5": // SQL queries for v0.5.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkt Admin-Mails korregiert: SQL-Anweisung war fehlerhaft; und HTML-Code in Templates ausgelagert.";
+               break;
+
+       case "0.5.6": // SQL queries for v0.5.6
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='admins_contct' WHERE what='admins_contact' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>.";
+               break;
+
+       case "0.5.7": // SQL queries for v0.5.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Links wegen <STRONG>what=admins_contct</STRONG> ge&auml;ndert.";
+               break;
+
+       case "0.5.8": // SQL queries for v0.5.8
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='admins_contct' WHERE what='admins_contact' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ein Punkt in der Versionsnummernliste verhinderte das 0.5.6-Update.";
+               break;
+
+       case "0.5.9": // SQL queries for v0.5.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.6.0": // SQL queries for v0.6.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link in &quot;ACL Einstellen&quot; zum Admin-Kontaktformular korregiert.";
+               break;
+
+       case "0.6.1": // SQL queries for v0.6.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Speichern von Admin-Accounts klappt wieder.";
+               break;
+
+       case "0.6.2": // SQL queries for v0.6.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte verschieben Sie die admins-Templates (Ordner: ".PATH."/templates/de/emails/) in den neuen Order admins!";
+               break;
+
+       case "0.6.3": // SQL queries for v0.6.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.6.4": // SQL queries for v0.6.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit der Rechtevererbung beseitigt: Geben Sie nun ein Hauptmen&uuml; frei (Allow), dann kann der Admin auch die Untermen&uuml;s erreichen. Zudem k&ouml;nnen Sie gezielte Untermen&uuml;s im freigegeben Hauptmen&uuml; dennoch sperren.";
+               break;
+
+       case "0.6.5": // SQL queries for v0.6.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.6.6": // SQL queries for v0.5.6
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='admins_contct' WHERE what='admins_contact' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>.";
+               break;
+
+       case "0.6.7": // SQL queries for v0.6.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD la_mode ENUM('global','OLD','NEW') NOT NULL DEFAULT 'global'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>. Beseitigung eines Fehlers <STRONG>HTTP_POSR_VARS</STRONG> beim &Auml;ndern von Administratoren.";
+               break;
+
+       case "0.6.8": // SQL queries for v0.6.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+               break;
+
+       case "0.6.9": // SQL queries for v0.6.9
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Admin-Management' WHERE action = 'admins' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verwaltung nach Management umbenannt.";
+               break;
+
+       case "0.7.0": // SQL queries for v0.7.0
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgez&auml;hlt und der letzte vermerkt.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "admins";
+
+//
+?>
diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php
new file mode 100644 (file)
index 0000000..4780f01
--- /dev/null
@@ -0,0 +1,91 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/13/2004 *
+ * ================                             Last change: 12/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-admintheme1.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Admin menu thmeme #1                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Adminmenue - Theme #1                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // Remove all other themes
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name LIKE 'admintheme%'";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='stats' WHERE what='usr_online' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='stats' WHERE what='email_stats' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='misc' WHERE what='maintenance' LIMIT 1";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+// Language file prefix
+$EXT_LANG_PREFIX = "admintheme";
+
+//
+?>
diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php
new file mode 100644 (file)
index 0000000..6e3c8be
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/13/2004 *
+ * ================                             Last change: 12/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-admintheme_default.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Default menu theme in admin area                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Standart-Menuesystem (Adminbereich)              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // Remove all other menu themes
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name LIKE 'admintheme%'";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='misc' WHERE what='usr_online' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='stats' WHERE what='email' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='setup' WHERE what='maintenance' LIMIT 1";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "admintheme";
+
+//
+?>
diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php
new file mode 100644 (file)
index 0000000..bda8915
--- /dev/null
@@ -0,0 +1,269 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/29/2004 *
+ * ================                             Last change: 01/07/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-autopurge.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Automatical purging of outdated mail links       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auto-Loeschung von veralteten Mail-Links         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.4.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE','DELETED') NOT NULL DEFAULT 'TEMP'";
+       if (EXT_IS_ACTIVE("bonus"))
+       {
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus MODIFY data_type ENUM('NEW','QUEUE','SEND','DELETED') NOT NULL DEFAULT 'NEW'";
+       }
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'";
+       if (EXT_IS_ACTIVE("bonus"))
+       {
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'";
+       }
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what IN('config_autopurge','list_autopurge') LIMIT 2";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP ap_notified";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD autopurge_inactive ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD autopurge_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_inactive_since BIGINT(20) UNSIGNED NOT NULL DEFAULT '2592000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_inactive_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '25200'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_unconfirmed_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '432000'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_autopurge','Auto-L&ouml;schung','Automatisch inaktive oder nicht best&auml;tigte Accounts l&ouml;schen.','12')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_autopurge','Inaktive finden','Lassen Sie sich vor dem t&auml;glichen Reset anzeigen, welche Mitglieder als inaktiv erkannt werden und welche gel&ouml;scht werden.','10')";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD ap_notified BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Automatisches L&ouml:schen von inaktiven bzw. nicht best&auml;tigten Accounts hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Automatisches L&ouml;schen von als zu l&ouml;schen markierte Tasks hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <FONT class=\"admin_failed\">Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227</FONT> behoben.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+
+               $UPDATE_NOTES = "Anstelle von <STRONG>ref_depth</STRONG> wurde <STRONG>level</STRONG> programmiert.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD autopurge_tasks ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*60*24*7)."'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bereinigung von zu l&ouml;schenden Aufgaben klappt wieder. Zeitlimit f&uuml;r genanntes kann eingestellt werden (Default = 7 Tage).<br /><br /><U>Bitte aktualisieren Sie auch die Admin-Templates!</U>";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_in_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_un_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_tasks_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mail wird bei L&ouml;schung von Aufgaben ausgesendet.<br /><br /><U>Bitte aktualisieren Sie auch die Admin-Templates!</U>";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Diverse angebundene Erweiterungen gefixt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Betreffzeile f&uuml;r gel&ouml;schte Aufgaben korregiert.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Auto-L&ouml;schung von Best&auml;tigungslinks kann unter &quot;Sonstige Einstellungen&quot; abgeschaltet werden (0 setzen!)";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Jackpot beseitigt ({!POINTS!} wurden nicht gutgeschrieben.)";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mailbetreffs korregiert.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Template <u>admin_config_autopurge_pro.tpl</u> ist &uuml;berfl&uuml;ssig geworden. Bitte l&ouml;schen Sie dies!";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datumsformat festgelegt auf ausf&uuml;hrlich.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_del_mails ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_dm_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_dm_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Von bereits gel&ouml;schten Mitgliedern die Mails l&ouml;schen integriert.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler mit <STRONG>timestamp_send</STRONG> (Zeile 308) beseitigt.";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler mit <STRONG>ap_del_emails</STRONG> (Einstellungen im Admin-Bereich) beseitigt.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Accounts der Standart-Referral-ID, der Bonus-ID, Bettellink-ID und der Verdoppler-ID werden nun nicht mehr gel&ouml;scht und tauchen auch unterhalb der Inaktiven-Liste nicht mehr auf.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt. Unter <STRONG>Auto-L&ouml;schung</STRONG> finden Sie nun auch die Einstellungen zu Mailbest&auml;tigungs wieder. Zudem werden keine Urlauber (neue Urlaubsschaltung beachtet) mehr als inaktiv erkannt.";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Template-Problem beseitigt. Dies verhinderte das Abspeichern der Einstellungen.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Do we have a daily-reset-run?
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
+       {
+               // Yes, we have. So let's auto-purge some campaigns, inactive users and unconfirmed accounts
+               $INC_POOL[] = sprintf("%sinc/autopurge.php", PATH);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "autopurge";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php
new file mode 100644 (file)
index 0000000..12f02fa
--- /dev/null
@@ -0,0 +1,195 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/28/2007 *
+ * ================                             Last change: 05/31/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-bank.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : A little bank account                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ein einfaches Bankaccount                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_accounts";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bank_accounts (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+account_created BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+account_locked BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+locked_reason TINYTEXT,
+status ENUM('NEW','ACTIVE','LOCKED') NOT NULL DEFAULT 'NEW',
+account_balance DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+output_mode ENUM('LOGIN','EMAIL','DISABLED'),
+pin VARCHAR(50) NOT NULL DEFAULT '',
+tan_mode ENUM('NORMAL','INDEXED'),
+tan_list_status ENUM('PENDING','ACTIVE','INVALID','LOCKED') NOT NULL DEFAULT 'PENDING',
+tan_key VARCHAR(50) NOT NULL DEFAULT '',
+month_transfered BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+last_tan VARCHAR(5) NOT NULL DEFAULT '00000',
+last_tan_stamp BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+last_tan_purpose TINYTEXT,
+account_type ENUM('CHECK','SAVING') NOT NULL DEFAULT 'CHECK',
+overdraft_credit DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+PRIMARY KEY (id),
+UNIQUE KEY (pin),
+INDEX `uid_type` (uid, account_type),
+INDEX (account_created),
+INDEX (account_locked),
+INDEX (last_tan_stamp)
+) TYPE=MyISAM";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_transfers";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bank_transfers (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+to_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+from_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points_amount DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+day_bookkeeping CHAR(4) NOT NULL DEFAULT '0000',
+day_available CHAR(4) NOT NULL DEFAULT '0000',
+transfer_purpose TINYTEXT,
+PRIMARY KEY (id),
+INDEX (to_account_id, from_account_id),
+INDEX (day_bookkeeping, day_available)
+) TYPE=MyISAM";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_packages";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bank_packages (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+title VARCHAR(255) NOT NULL DEFAULT '',
+description TINYTEXT,
+account_fee DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+free_transfers INT(7) UNSIGNED NOT NULL DEFAULT '0',
+transfer_fee DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+available TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+output_system_mode ENUM('LOGIN','EMAIL','DISABLED'),
+package_active ENUM('Y','N') NOT NULL DEFAULT 'N',
+free_months_no_fee TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+interest_plus FLOAT(7,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+interest_minus FLOAT(7,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+first_payment DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+free_account_income DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+free_account_stuff TINYTEXT null,
+tan_lock TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+PRIMARY KEY (id)
+) TYPE=MyISAM";
+       // free_account_stuff will be a list of columns of the table _bank_packages
+       // what the member shall get for the specified income. output_system_mode
+       // must be extended with the mode you get for free: output_system_mode:LOGIN
+       // should be fine. More than one entry and not DISABLED ;) are not supported.
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_tanlist";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bank_tanlist (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+idx TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+tan VARCHAR(50) NOT NULL DEFAULT '',
+used ENUM('Y','N') NOT NULL DEFAULT 'N',
+PRIMARY KEY (id),
+UNIQUE (account_id, tan)
+) TYPE=MyISAM";
+
+       // Admin menu queries
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank', NULL, 'Bank-Accounts','Verwalten Sie hier alle Bank-Accounts Ihrer Mitglieder, sowie Angebotspakete und &Uuml;berweisungen.', 6)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_package','Angebotspaket hinzuf&uuml;gen','Neues Angebotspaket erstellen.', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_package','Angebotspakete auflisten','Listet alle erstellten Angebotspakete auf.', 2)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_package','Angebotspaket &auml;ndern','Nach Auswahl eines Angebotspaketes k&ouml;nnen Sie dieses hier ver&auml;ndern. Bitte beachten Sie, dass Ihre Mitglieder keine Mail dabei erhalten!', 3)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_package','Angebotspaket ent-/sperren','Nehmen Sie Angebotspakete zur tempor&auml;ren &Uuml;berarbeitung zuvor heraus, dann k&ouml;nnen Sie in Ruhe dr&uuml;ber nachdenken und Berechnungen anstellen. Freigabe ist hier auch m&ouml;glich.', 4)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_package','Angebotspaket l&ouml;schen','Nach Auswahl eines Angebotspaketes k&ouml;nnen Sie mit abschliessender Best&auml;tigung Angebotspakete ganz l&ouml;schen. Bitte beachten Sie, dass dies nur m&ouml;glich ist, wenn auch alle Accounts dieses nicht mehr nutzen!', 5)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_account','Konto anlegen','Legen Sie hier Konten f&uuml;r die Mitglieder an (falls Ihre Mitglieder nicht zurecht kommen).', 6)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_account','Konten auflisten','Auflistung aller Konto oder eines ausw&auuml;hlbaren Mitglieds.', 7)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_account','Konto &auml;ndern','&Auml;ndern Sie hier bestehende Konten, z.B. den Dispositionskredit usw. PINs und TANs sind hier nicht &auml;nderbar! Best&auml;tigungsmails sind optional versendbar.', 8)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_account','Konto ent-/sperren','Sperren Sie hier Konten bei Bedarf. Auch das Freischalten ist hier m&ouml;glich. Eine Benachrichtigung per Mail wird dann an das Mitglied ausgesendet.', 9)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_account','Konto l&ouml;schen','L&ouml;schen von Konten mit Best&auml;tigungsmail. Wenn Sie ein Mitglieder-Account l&ouml;schen, so m&uuml;ssen Sie derzeit seine angelegten Konten auch l&ouml;schen!', 10)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','send_bank_tanlist','TAN-Liste aussenden','Listet zuerst Anfragen von Mitgliedern auf, die eine neue (i)TAN-Liste ben&ouml;tigen, anschliessend kann die Liste dann ausgesendet werden.', 11)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_tanlist','TAN-Liste ent-/sperren','Bestehende TAN-Listen k&ouml;nnen auf Kundenwunsch hin gesperrt und wieder entsperrt werden. Dies passiert auch, wenn der Kunde x-mal (siehe Angebotspakete) eine verkehrte TAN eingegeben hat. Einzelne TANs sind nicht ent-/sperrbar.', 12)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_trans','&Uuml;berweisungen auflisten','Nach Auswahl eines Mitgliedes und einem Konto (ben&ouml;tgt JavaScript!) k&ouml;nnen Sie seitenweise die &Uuml;berweisungen durchschauen.', 13)";
+
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank', NULL, 'Bank-Account','N','Y', 3)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_infos','Angebotspakete','N','Y', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_create','Konto anlegen','N','Y', 2)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_deposit','Einzahlen','N','Y', 3)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_withdraw','Auszahlen','N','Y', 4)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_output','Kontoauszug','N','Y', 5)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_change','Paket wechseln','N','Y', 6)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_remove','K&uuml;ndigen','N','Y', 7)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_accounts";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_transfers";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_packages";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bank_tanlist";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='bank' LIMIT 14";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='bank' LIMIT 8";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='bank' LIMIT 8";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE action='bank' LIMIT 8";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "bank";
+
+//
+?>
diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php
new file mode 100644 (file)
index 0000000..3b1daa7
--- /dev/null
@@ -0,0 +1,275 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/25/2004 *
+ * ================                             Last change: 09/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-beg.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Begging link                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bettel-Link                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.2.5";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_beg','Bettel-Link','IP-Sperre, {!POINTS!}-Verg&uuml;tung usw. k&ouml;nnen Sie hier einstellen.', 10)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','{!POINTS!} erbetteln!',4,'Y','Y')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','Ihr Bettel-Link',6,'Y','Y')";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '600'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_uid_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '1800'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00100'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD beg_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_beg_ips";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_beg_ips (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+remote_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+timeout VARCHAR(10) NOT NULL DEFAULT '',
+KEY (userid),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+       // Load CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_beg' OR what='list_beg' LIMIT 2";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='beg' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='beg' OR what='beg2' LIMIT 2";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_beg_ips";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE what='beg' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='beg' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='beg' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE what='beg' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='beg' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='beg' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_points_max DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.10000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Maximale Obergrenze an {!POINTS!} einstellbar (Standart: 0,1 {!POINTS!})";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "&Uuml;berlange Kommastellen bei Punktangaben aus Bettellink und Gastbereich entfernt und Admin-Templates repariert (&quot;Unbekannte Spalte <U>beg_points_ma</U>&quot;).";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Im Mitgliedsmen&uuml; wurde die Beschreibung aus dem Gastmen&uuml; verwendet.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ein Mitgliedsaccount (empfehlenswert ist Ihr eigenes!) kann zum Abbuchen der {!POINTS!} verwendet werden. Template <U>admin_config_beg.tpl</U> (und pro!) nicht vergessen, zu aktualisieren.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_ip_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '1800'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Zeitsperre gegen die selbe IP-Nummer hinzugef&uuml;gt.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte verschieben Sie die beg-Templates (Ordner: ".PATH."/templates/".GET_LANGUAGE()."/html/) in den neuen Order beg!";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.1.2":
+               // SQL queries for v0.1.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'REF'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_active ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_rallye ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD beg_points DOUBLE(21,5) NOT NULL DEFAULT '0.00000'";
+               $VIS = "N"; $LOCKED = "Y";
+               if (EXT_IS_ACTIVE("beg")) { $VIS = "Y"; $LOCKED = "N"; }
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','beg2','Bettel-Rallye','".$VIS."','".$LOCKED."','7')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12')";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Optionale Bettel-Rallye m&ouml;glich. Und die erbettelten {!POINTS!} k&ouml;nnen entweder nur dem bettelndem Mitglied direkt oder auch seinem Werber gutgeschrieben werden k&ouml;nnen.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erbettelte {!POINTS!} werden nach Deaktivierung der Bettel-Rallye gel&ouml;scht.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Rechtlichen Hinweis im Mitgliedsbereich vergessen (<STRONG>member_list_beg.tpl</STRONG>); Template <STRONG>member_beg_404.tpl</STRONG> fehlte!";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Bettellink/-rallye', descr='IP-Sperre, {!POINTS!}-Verg&uuml;tung und auch die Bettel-Rallye k&ouml;nnen Sie hier einstellen.' WHERE what='config_beg' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlendes Template im Admin-Bereich hinzugef&uuml;gt. Im Admin-Bereich Hinweis hinzugef&uuml;gt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php l&ouml;schen!";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es wurden immer dem ersten bettelndem Mitglied die {!POINTS!} gutgeschrieben.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_ral_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_ral_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_notify_bonus  DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD beg_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD beg_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD beg_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Mitglieder k&ouml;nnen nun optional automatisch &uuml;ber eine aktivierte und/oder deaktivierte Bettel-Rallye informiert werden. Beide Benachrichtigungen k&ouml;nnen Sie unter <STRONG>Einstellungen --&gt; Bettel-Link/-rallye</STRONG> seperat ein- und ausschalten! Zudem ist eine Sperre gegen eingeloggte Mitglieder eingebaut, die das Klicken auf den eigenen Bettel-Link etwas erschweren soll.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler im t&auml;glichen Reset beseitigt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei ".POINTS."-Gleichstand wird als n&auml;chstes nach wer als letztes Online war umsortiert.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <STRONG>unknown column &#39;uid&#39;</STRONG> beseitigt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD beg_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Eigene User-ID von Bettel-Rallye ausschliessbar.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abfrage des Account-Status eingebaut. Es k&ouml;nnen nur best&auml;tigte Accounts betteln.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='1' WHERE what='beg' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='rals', sort='3', title='Bettel-Rallye' WHERE what='beg2' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Remove old entries
+       $OLD = $_CONFIG['beg_timeout'];
+       if ($_CONFIG['beg_uid_timeout'] > $OLD) $OLD = $_CONFIG['beg_uid_timeout'];
+       $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_beg_ips WHERE timeout < (UNIX_TIMESTAMP() -".($OLD - 60*60).")", __FILE__, __LINE__);
+
+       // Check for beg rallye is active and send mails out
+       if (($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_new_mem_notify'] == "Y")) {
+               // Include file for sending out mails
+               $INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", PATH);
+       }
+
+       // Return code for the URL
+       define('CODE_BEG_SAME_AS_OWN', 100);
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "beg";
+
+//
+?>
diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php
new file mode 100644 (file)
index 0000000..17d5386
--- /dev/null
@@ -0,0 +1,205 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/23/2004 *
+ * ================                             Last change: 06/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-birthday.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out happy-birthday mails                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Versendet Geburtstagsmails an die Mitglieder     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.3.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT '0'";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP birthday_sent";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_birthday' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wenn t&auml;glicher Reset war, wird eine ben&ouml;tigte Include-Datei nicht mehr von daily-reset.php eingebunden, sondern von der Erweiterungsdatei selber.";
+               break;
+
+       case "0.2": // SQL queries for v0.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_birthday (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+chk_value VARCHAR(255) NOT NULL DEFAULT '',
+KEY(userid),
+PRIMARY KEY(id)
+) Type=MyISAM";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_birthday','Geburtstagsmails','Stellen Sie hier ein, ob die Mitglieder {!POINTS!} (nicht automatisch) gutgeschrieben kommen sollen oder nicht.', 9)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es kann nun eine Gutschrift an die Geburtstagmail angeh&auml;ngt werden. Diese wird erst beim Klick auf einen Best&auml;tigungslink gutgeschrieben.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erh&ouml;ht.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Laden der birthday_mails.php &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate am Script <U>birtday_confirm.php</U> durchgef&uuml;hrt.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vergessenes _OB_CACHING gesetzt.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabe des generierten HTML-Codes nach <U>inc/footer.php</U> verlagert.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wort <STRONG>Punkte</STRONG> dynamisiert.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte verschieben Sie die birthday-Templates (Ordner: ".PATH."/templates/".GET_LANGUAGE()."/html/) in den neuen Order birthday!";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_active ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verg&uuml;tungsmodus des Geburtstagsbonus einstellbar.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Im Script <STRONG>inc/birthday_mails.php</STRONG> hat sich ein Zeichen mit dem Code 160 eingeschlichen, welches einen <STRONG>Parser Error</STRONG> verursachte, aber wie eine gew&ouml;hnliche Leerstelle aussah.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
+CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
+CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT '1970'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0)) {
+               // Daily reset was run and we shall pay points so we start checking for members who
+               // has a birthday for today
+               $INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "birthday";
+
+//
+?>
diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php
new file mode 100644 (file)
index 0000000..9e22079
--- /dev/null
@@ -0,0 +1,562 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ================                             Last change: 06/13/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-bonus.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Bonus pages                                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bonus-Seiten                                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version of this extension
+$EXT_VERSION = "0.8.6";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1.6", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.8", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.8.6");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu VALUES (NULL,'email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie k&ouml;nnen hier immer senden.')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu VALUES (NULL,'main','bonus','Bonuspunkte',7,'Y','Y','', 0)";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bonus (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+cat_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+subject VARCHAR(255) NOT NULL DEFAULT '',
+text LONGBLOB NOT NULL,
+receivers LONGBLOB NOT NULL,
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+time TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW',
+timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+url VARCHAR(255) NOT NULL DEFAULT '',
+target_send BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+mails_sent BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+KEY(cat_id),
+PRIMARY KEY  (id)
+)TYPE=MyISAM";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_links MODIFY link_type ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_links ADD bonus_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_links ADD INDEX (bonus_id)";
+
+       // Run this SQL when html or html_mail extension is installed
+       if (EXT_IS_ACTIVE("html_mail")) $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus add html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus') LIMIT 4";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='bonus' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='bonus' LIMIT 1";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_links MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_links DROP bonus_id";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_urls";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_customer";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_turbo";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='bonus' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE action='bonus' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='show_bonus' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='bonus' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE action='bonus' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='show_bonus' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Paid-Links wurden verschoben in die Erweiterung <STRONG>paidlinks</STRONG>.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_bonus SET target_send=mails_sent WHERE target_send='0' AND mails_sent>0 AND receivers != ''";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Behebt ein Versand-Problem mit den Bonus-Mails. Es wurde die Spalte target_send nicht beim Einf&uuml;gen der Buchung gessetzt. Bitte laden Sie sich dazu - wenn nicht bereits geschehen - alle Patches bis mindestens Patch 240 unter <A href=\"".URL."/modules.php?module=admin&amp;what=updates\">Updates pr&uuml;fen</A> herunter.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_bonus' LIMIT 1";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu VALUES (NULL,'setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x&#39;ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zus&auml;tzlich bekommen, als der 10. Klick.')";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD login_bonus DOUBLE(20,3) NOT NULL DEFAULT '10.000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD turbo_bonus DOUBLE(20,3) NOT NULL DEFAULT '100.000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+               // Use actual month for this update
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_bonus DOUBLE(20,3) NOT NULL DEFAULT '0.000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD turbo_bonus DOUBLE(20,3) NOT NULL DEFAULT '0.000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Login-Bonus und Turbo-Klick-Bonus intergriert.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_turbo";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bonus_turbo (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+mail_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+bonus_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+level BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points DOUBLE(20,3) NOT NULL DEFAULT '0.000',
+timemark VARCHAR(32) NOT NULL DEFAULT '0',
+PRIMARY KEY(id),
+KEY mail_id (mail_id),
+KEY bonus_id (bonus_id),
+KEY userid (userid)
+) TYPE=MyISAM";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Turbo-Bonus wird in Tabelle gez&auml;hlt f&uuml;r Anzeige, wer alles bereits geklickt hat und welchen Platz er gemacht hat.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='bonus' LIMIT 1";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu VALUES (NULL,'main','bonus','Aktiv-Rallye',7,'Y','Y','', 0)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Aktiv-Rallye mit Klick-Verg&uuml;tung hinzugef&uuml;gt.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_urls";
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus_customer";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Tabellen <U>"._MYSQL_PREFIX."_bonus_urls</U> und <U>"._MYSQL_PREFIX."_bonus_customer</U> entfernt, da dies bald von der Erweiterung <U>paidlinks</U> erledigt wird.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Turbo-Bonus klappt wieder (dies sind {!POINTS!} die an die schnellsten Klicker verg&uuml;tet werden!)";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_bonus SET timestamp='0' WHERE timestamp='0000000000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus_turbo CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE turbo_bonus turbo_bonus DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE login_bonus login_bonus DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE turbo_bonus turbo_bonus DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE login_bonus login_bonus DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate am Script <U>show_bonus.php</U> durchgef&uuml;hrt.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_bonus','Aktiv-Rallye-Teilnehmer','Listet alle Mitglieder auf, die einen Aktiv-Bonus haben und zeigt die derzeit m&ouml;glichen Gewinner an.', 10)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link <U>Aktiv-Rallye-Teilnehmer</U> hinzugef&uuml;gt, inklusive manuelle Vorbereitung der Verg&uuml;tung.";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_mode ENUM('UID','JACKPOT','ADD') NOT NULL DEFAULT 'ADD'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Der Login-Bonus Aktiv-Bonus (= Klick-Bonus) k&ouml;nnen nun zuerst von einem Mitgliederaccount (das sollte Ihres sein!), vom Jackpot abgezogen oder einfach dazuadiert werden.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "In der Admin-Liste werden nur aktive Mitglieder gelistet und zudem die sp&auml;teste Zeitmarke f&uuml;r die Auswertung angezeigt.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitglieder-Account auw&auml;hlbar, von dem die {!POINTS!} f&uuml;r den Aktiv- und Login-Bonus abgebucht werden.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabe des generierten HTML-Codes nach <U>inc/footer.php</U> verlagert.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Variablen gefixt.";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Automatisches L&ouml;schen von Turbo-Bonus-Zeilen ("._MYSQL_PREFIX."_bonus_turbo) und begrenzte Anzahl von Eintr&auml;gen hinzugef&uuml;gt.";
+               break;
+
+       case "0.4.1": // SQL queries for v0.4.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verg&uuml;tung des Aktiv-Bonus repariert.";
+               break;
+
+       case "0.4.2": // SQL queries for v0.4.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Admin-Bereich / Aktiv-Teilnehmer auflisten: Problem mit Konstante __AUTOPURGE_TIMEOUT und das Template <U>admin_list_bonus.tpl</U> korregiert.";
+               break;
+
+       case "0.4.3": // SQL queries for v0.4.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verbesserung des Versandes von  HTML-Bonus-Mails.";
+               break;
+
+       case "0.4.4": // SQL queries for v0.4.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_order DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '15.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_ref DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '100.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_stats DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '5.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_active ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_order DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_ref DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_stats DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD is_stats ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bonus-{!POINTS!} f&uuml;r: Mailbestellung, Referral-Werbung (bei Best. der EMail-Adresse) und wenn 100% Klickrate jeder Mailbuchung erreicht wurde.<br />Template <u>admin_config_bonus_pro.tpl</u> ist &uuml;berfl&uuml;ssig geworden. Bitte l&ouml;schen Sie dies!<br />Eingestellte Bonus-{!POINTS!} f&uuml;r Rank 2 war um eins verschoben.";
+               break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abzug vom Bonus-Account integriert.";
+               break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Rank 2 bekommt nun auch seine {!POINTS!} gutgeschrieben.";
+               break;
+
+       case "0.4.7": // SQL queries for v0.4.7
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET login_bonus=0, turbo_bonus=0,bonus_ref=0,bonus_order=0,bonus_stats=0";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Aktiv-Rallye wurde nicht auf 0 {!POINTS!} gesetzt. Dieser Fehler ist nun behoben. Allerdings ist mit diesem Update auch die Aktiv-Rallye zur&uuml;ckgesetzt worden.";
+               break;
+
+       case "0.4.8": // SQL queries for v0.4.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "In <U>inc/monthly_bonus.php</U> fehlte ein Punkt; Fehler besseitigt.";
+               break;
+
+       case "0.4.9": // SQL queries for v0.4.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Login-Bonus wird mit angezeigt.";
+               break;
+
+       case "0.5.0": // SQL queries for v0.5.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit <STRONG>is_hundred</STRONG> beim t&auml;glichen Reset beseitigt.";
+               break;
+
+       case "0.5.1": // SQL queries for v0.5.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit <STRONG>bonus_stats / Zeile 31</STRONG> beim t&auml;glichen Reset beseitigt.";
+               break;
+
+       case "0.5.2": // SQL queries for v0.5.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.5.3": // SQL queries for v0.5.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Speichern der Aktiv-{!POINTS!} f&uuml;r Platz 2 bis <STRONG>x</STRONG> korregiert.";
+               break;
+
+       case "0.5.4": // SQL queries for v0.5.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Variablenfehler in <STRONG>inc/monthly_bonus.php</STRONG> behoben.";
+               break;
+
+       case "0.5.5": // SQL queries for v0.5.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weitere Variablenfehler in <STRONG>inc/monthly_bonus.php</STRONG> haben daf&uuml;r gesorgt, dass die monatliche Aktiv-Rallye nicht ausgesch&uuml;ttet wurde. Mit diesem Update wurde die Aussch&uuml;ttung initialisiert. Ihre Mitglieder bekommen voraussichtlicht nichts doppelt verg&uuml;tet.";
+               break;
+
+       case "0.5.6": // SQL queries for v0.5.6
+               // Get current month
+               $curr = date("m", time());
+               if (strlen($curr) == 1) $curr = "0".$curr;
+               if ($curr == "00") $curr = "12";
+
+               // Generate timemark...
+               $mark = mktime(0, 0, 0, $curr, 1, date('Y', time()));
+
+               // Update accounts which are not active last months
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data
+SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0
+WHERE last_online < ".$mark." ORDER BY userid";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ein weiterer Scriptfehler hat nur die Gewinner aus der Aktiv-Rallye genommen. Die anderen Mitglieder sind somit &quot;nach oben gerutsch&quot;.";
+               break;
+
+       case "0.5.7": // SQL queries for v0.5.7
+               break;
+
+       case "0.5.8": // SQL queries for v0.5.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit <STRONG>is_hundred</STRONG> beim t&auml;glichen Reset endlich beseitigt.";
+               break;
+
+       case "0.5.9": // SQL queries for v0.5.9
+               $UPDATE_NOTES = "Fehlermeldung <STRONG>/home/verzeichnis/html/inc/stats_bonus.php (42):You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' WHERE userid='59' LIMIT 1' at line 1</STRONG> beseitigt.";
+               break;
+
+       case "0.6.0": // SQL queries for v0.6.0
+               $UPDATE_NOTES = "SQL-Fehlermeldung in <STRONG>inc/monthly_bonus.php</STRONG> beseitigt.";
+               break;
+
+       case "0.6.1": // SQL queries for v0.6.1
+               $UPDATE_NOTES = "Versand von Bonus-Mails repariert.";
+               break;
+
+       case "0.6.2": // SQL queries for v0.6.2
+               $UPDATE_NOTES = "L&ouml;schen von bereits gel&ouml;schten Mails wird nun abgelehnt.";
+               break;
+
+       case "0.6.3": // SQL queries for v0.6.3
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.6.4": // SQL queries for v0.6.4
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Aktiv-Rallye' WHERE what='config_bonus' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Der Men&uuml;punkt &quot;Bonus-{!POINTS!}&quot; unter Einstellungen wird nach &quot;Aktiv-Rallye umbenannt. Und die Aktiv-Rallye konnte aufgrund eines Template-Fehlers nicht gespeichert werden.";
+               break;
+
+       case "0.6.5": // SQL queries for v0.6.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_stats ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler mit bonus_stats beseitigt.";
+               break;
+
+       case "0.6.6": // SQL queries for v0.6.6
+               $UPDATE_NOTES = "Template-Fehler beseitigt im Admin-Bereich.";
+               break;
+
+       case "0.6.7": // SQL queries for v0.6.7
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.6.8": // SQL queries for v0.6.8
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_bonus SET data_type='SEND' WHERE data_type != 'SEND' AND data_type != 'DELETED' AND receivers='' AND target_send='0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Eingegebene Anzahl auszusendener Bonus-Mails wurde bei der Empf&auml;nderauswahl nicht ber&uuml;cksichtigt. Zudem wird jetzt das eingestellte Auswahlverfahren mitber&uuml;cksichtigt.";
+               break;
+
+       case "0.6.9": // SQL queries for v0.6.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_order_yn ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_ref_yn ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_stats_yn ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_login_yn ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_click_yn ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es k&ouml;nnen nun auch die folgenden Verg&uuml;tungen bei der Auswertung der monatlichen Aktiv-Rallye mit ber&uuml;cksichtigt werden: Mailbest&auml;tigung (war vorher schon), Login-, Mailbuchung, Referral und Statistik-Bonus (100% Klickrate erreicht).";
+               break;
+
+       case "0.7.0": // SQL queries for v0.7.0
+               $UPDATE_NOTES = "Zuschaltung von weiteren Bonis wird jetzt auch bei der Auflistung der mitmachenden Mitglieder im Mitgliedsbereich beachtet.";
+               break;
+
+       case "0.7.1": // SQL queries for v0.7.1
+               $UPDATE_NOTES = "Im Adminbereich wird nun ebenfalls die Zuschaltung von weiteren Bonis ber&uuml;cksichtigt. Zudem wird der Gesamtbonus an alle Mitglieder errechnet und auch angezeigt.";
+               break;
+
+       case "0.7.2": // SQL queries for v0.7.2
+               $UPDATE_NOTES = "Die Verg&uuml;tung der erreichten 100%-Klickrate war noch wegen Programmierungen am Script auskommentiert. Sorry!";
+               break;
+
+       case "0.7.3": // SQL queries for v0.7.3
+               $UPDATE_NOTES = "Gutgeschriebene Bonus-{!POINTS!} werden nach Deaktivierung der Aktiv-Rallye gel&ouml;scht.";
+               break;
+
+       case "0.7.4": // SQL queries for v0.7.4
+               $UPDATE_NOTES = "Rechtlichen Hinweis im Mitgliedsbereich vergessen. (<STRONG>member_bonus.tpl</STRONG>)";
+               break;
+
+       case "0.7.5": // SQL queries for v0.7.5
+               $UPDATE_NOTES = "Im Admin-Bereich Hinweis hinzugef&uuml;gt, wenn Aktiv-Rallye inaktiv ist. Bitte Script inc/monthly_bonus.php l&ouml;schen!";
+               break;
+
+       case "0.7.6": // SQL queries for v0.7.6
+               $UPDATE_NOTES = "Auswahlmechanismus der Gewinner repariert. Trotz Hinzuschalten von weiteren zu ber&uuml;cksichtigen Boni wurden diese bei der Sortierung der User-IDs nicht ber&uuml;cksichtig.";
+               break;
+
+       case "0.7.7": // SQL queries for v0.7.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_notify_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD bonus_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Optionale automatische Benachrichtigung &uuml;ber aktivierte und/oder deaktivierte Aktiv-Rallye einstellbar.";
+               break;
+
+       case "0.7.8": // SQL queries for v0.7.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler im t&auml;glichen Reset beseitigt.";
+               break;
+
+       case "0.7.9": // SQL queries for v0.7.9
+               $UPDATE_NOTES = "Dollarzeichen fehlte in <STRONG>inc/reset/reset_bonus.php</STRONG>, Zeile 39";
+               break;
+
+       case "0.8.0": // SQL queries for v0.8.0
+               $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.";
+               break;
+
+       case "0.8.1": // SQL queries for v0.8.1
+               $UPDATE_NOTES = "Bei ".POINTS."-Gleichstand wird als n&auml;chstes nach wer als letztes Online war umsortiert.";
+               break;
+
+       case "0.8.2": // SQL queries for v0.8.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus ADD is_notify ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Eigene User-ID von Aktiv-Rallye ausschliessbar. Benachrichtigungsmails sind von Aktiv-Rallye ausgeschlossen.";
+               break;
+
+       case "0.8.3": // SQL queries for v0.8.3
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='rals', sort='2', title='Aktiv-Rallye' WHERE what='bonus' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.8.4": // SQL queries for v0.8.4
+               $UPDATE_NOTES = "Ladeproblem bei nicht installierter Erweiterung <strong>cache</strong> gefixt.";
+               break;
+
+       case "0.8.5": // SQL queries for v0.8.5
+               $UPDATE_NOTES = "CSS-Klassenname gefixt in Templates.";
+               break;
+
+       case "0.8.6": // SQL queries for v0.8.6
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
+       {
+               // Daily reset was run so let's check if active rallye is activated
+               if ($_CONFIG['bonus_active'] == "Y")
+               {
+                       // Run active rallye
+                       if($_CONFIG['bonus_stats'] > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH);
+                       $INC_POOL[] = sprintf("%sinc/monthly/monthly_bonus.php", PATH);
+               }
+                else
+               {
+                       // Reset points
+                       $INC_POOL[] = sprintf("%sinc/reset/reset_bonus.php", PATH);
+               }
+       }
+
+       // Check for bonus rallye is active and send mails out
+       if (($_CONFIG['bonus_active'] == "Y") && ($_CONFIG['bonus_new_mem_notify'] == "Y"))
+       {
+               // Include file for sending out mails
+               $INC_POOL[] = sprintf("%sinc/mails/bonus_mails.php", PATH);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "bonus";
+
+//
+?>
diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php
new file mode 100644 (file)
index 0000000..f1db9c8
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2004 *
+ * ================                             Last change: 10/11/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-cache.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Caching system for SQL tables on hard disc       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Caching-System zum Auslagern von SQL-Tabellen    *
+ *                     auf der Festplatte des Servers                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_update BIGINT(20) UNSIGNED NOT NULL DEFAULT '3600'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_path VARCHAR(255) NOT NULL DEFAULT 'cache/'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_tested tinyint(1) NOT NULL DEFAULT '0'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_cache','Cache-Einstellungen','Update-Interval des Caches usw. k&ouml;nnen Sie hier &auml;ndern.', 9)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_cache' OR what='cache_stats' LIMIT 2";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es wurde die Zeitmarke der Cache-Datei extensions.cache mit ber&uuml;cksichtigt. Dies hatte die Folge, dass wenn bei einem Gast die Datei aktualisiert wurde, nur aktivierte und nicht die deaktivierten mit geladen wurden. Folglich fiehlen einfach ein paar Erweiterungen aus.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Cache-Update repariert.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               if (EXT_IS_ACTIVE("cache"))
+               {
+                       // Check for cache when extension is already installed
+                       if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+               }
+               $UPDATE_NOTES = "Spalte &quot;keep_active&quot; ist hinzugef&uuml;gt. Cache wurde reinitialisiert.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Registrierung der Cache-Erweiterung repariert";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Validierung der Cache-Datei admins.cache integriert.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD db_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','cache_stats','DB-Cache','Auf Cache und gesamte Datenbank registrierte Anfragen anzeigen.', 4)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hits auf den Cache werden gez&auml;hlt.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Das Umschreiben der Cache-Daten hat eine Fehlermeldung <STRONG>Falsches Passwort!</STRONG> im Admin-Bereich verursacht.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Interne Datenfeld-Management korregiert und Cache-Statistiken korregiert.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit fehlender admins-Erweiterung beseitigt.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <STRONG>Division durch 0</STRONG> repariert in den DB-Cache Statistiken.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Tabelen <STRONG>"._MYSQL_PREFIX."_config</STRONG>, <STRONG>"._MYSQL_PREFIX."_refsystem</STRONG>, <STRONG>"._MYSQL_PREFIX."_refdepths</STRONG> und <STRONG>"._MYSQL_PREFIX."_mod_reg</STRONG> werden nun auch ausgelagert.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_admins ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_acls ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_exts ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_config ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_modreg ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_refdepth ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_refsys ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Alle cache-baren Tabellen sind nun einzelnt ein- bzw. ausschaltbar. Falls die eine oder andere ausgelagerte Tabelle also Fehler verursachen sollte, so k&ouml;nnen Sie diese hier abschalten. Beachten Sie aber bitte, dass dann mehr Abfragen an die Datenbank gestellt wird und dies bedeutend mehr Zeit braucht, als nur die Daten aus einem Datenfeld zu laden, das sich im Speicher aufh&auml;lt.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <STRONG>Division durch 0</STRONG> repariert in <STRONG>inc/load_cache.php</STRONG>.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weitere Fehler im System beseitigt.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Probleme w&auuml;hrend des Installationsvorganges beseitigt.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Klassenname gefixt in Templates.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_themes ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Daten von installierten Themes werden nun gecacht.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_admin_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Administratormen&uuml; experimentell gecacht.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Create instance on class
+       if ($cacheMode != "init") {
+               // Initialize cache system only when it's needed
+               $cacheInstance = new mxchange_cache($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']);
+               if ($cacheInstance->getStatus() != "done") {
+                       // Failed to initialize cache sustem
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
+               }
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "cache";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php
new file mode 100644 (file)
index 0000000..c1bfb2b
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/30/2005 *
+ * ================                             Last change: 04/30/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-country.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Country code management                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Laendercode-Management                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.4";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_countries";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_countries (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+code CHAR(2) NOT NULL DEFAULT 'DE',
+descr VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
+is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
+KEY(code),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active) VALUES ('DE','Deutschland','Y')";
+
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('country', NULL, 'L&auml;ndercodes verwalten','Stellen Sie hier L&auml;ndercodes ein, damit auch internationale Mitglieder sich zu Ihrem ".MT_WORD." anmelden k&ouml;nnen.', 8)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('country','list_country','Verwalten','Hinzuf&uuml;gen, &Auml;ndern und L&ouml;schen von L&auml;ndercodes.', 1)";
+
+       // Add entry to user table
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT '1'";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_countries";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='country' LIMIT 2";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "SQL-Dateien hinzugef&uuml;gt, die Sie mit z.B. phpMyAdmin einspielen k&ouml;nnen. (DOCS/country/README.de lesen!)";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "country";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-demo.php b/inc/extensions/ext-demo.php
new file mode 100644 (file)
index 0000000..220a5e2
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/16/2004 *
+ * ================                             Last change: 07/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-demo.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Demo mode extension                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Demo-Modus Erweiterung                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.1";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "demo";
+
+//
+?>
diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php
new file mode 100644 (file)
index 0000000..edd3ee3
--- /dev/null
@@ -0,0 +1,249 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/03/2005 *
+ * ================                             Last change: 02/03/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-doubler.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Double points                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punkte verdoppeln                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.6";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // Doubler table
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_doubler";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_doubler (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+remote_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+timemark VARCHAR(10) NOT NULL DEFAULT '',
+completed ENUM('Y','N') NOT NULL DEFAULT 'N',
+is_ref ENUM('Y','N') NOT NULL DEFAULT 'N',
+KEY(refid),
+KEY(userid),
+PRIMARY KEY(id)
+)TYPE=MYISAM";
+
+       //
+       // --- SETTINGS ---
+       //
+       // Minimum points to double
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_min DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '100.00000'";
+       // Maximum points to double
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_max DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '10000.00000'";
+       // Points left on users account after doubling
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_left BIGINT(20) UNSIGNED NOT NULL DEFAULT '1000'";
+       // Charge for doubling points which goes to the webmaster (shreddered in fact!)
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_charge FLOAT(7,5) UNSIGNED NOT NULL DEFAULT '0.030'";
+       // Referral percents
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_ref FLOAT(7,5) UNSIGNED NOT NULL DEFAULT '0.020'";
+       // Shall I use the jackpot to take points from? (Y/N, default=Y)
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_jackpot ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       // A user account to take points from (default: 0->none)
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+       // Total payed out points from your doublers
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+       // Sending mode of mails (immediately/daily reset)
+       // --> This also means who fast the doubled points will be payed out!
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'";
+       // Timeout for entries to be purged (default: one week)
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*60*24*7)."'";
+       // Number of newest entries to display
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_display_new TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+       // Number of entries which will be payed out soon
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_display_pay TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+       // Number of entries which are already payed out
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_display_old TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+       // Points used by every member
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD doubler_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+       // Counter for usage of the doubler
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_counter BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+       //
+       // --- MENU SYSTEMS ---
+       //
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler', NULL, '{!POINTS!}-Verdoppler','Einstellungen und Eintr&auml;ge auflisten.', 4)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','list_doubler','Auflisten','Eintr&auml;ge aus der Verdiensttabelle auflisten', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','config_doubler','Einstellungen','Prozentuale Geb&uuml;hr usw. einstellen.', 2)";
+
+       // Guest menu (informations / default doubler link)
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','doubler','Verdoppeln!',3,'Y','Y')";
+
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','doubler','Verdoppeln!','Y','Y',7)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_doubler";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='doubler' LIMIT 3";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='doubler' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='doubler' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='doubler' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE what='doubler' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='doubler' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='doubler' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE what='doubler' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='doubler' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit User-ID behoben!";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Total used points
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_used DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Geb&uuml;hr wird vom Verdoppler-Pott abgezogen.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Drei SQL-Fehler beseitigt.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Shall I use the doubler's account to take points from? (Y/N, default=Y)
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_own ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = POINTS."-Guthaben des Verdopplers kann optional nicht mit einbezogen werden.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Counter-Stand und noch zum Verdoppeln &uuml;brige {!POINTS!} in Templates eingebunden. Auflistung in Admin-Bereich komplettiert.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_max_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT '1'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_group_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT '1'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD doubler_sent_all ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Geb&uuml;hrenabzug wird beim Einzahlen abgezogen (wurde von Auszahlung abgezogen) und maximal bei Auszahlung zu kontrollierende Accounts einstellbar.<br />Template <u>admin_config_doubler_pro.tpl</u> ist &uuml;berfl&uuml;ssig geworden. Bitte l&ouml;schen Sie dies!";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.<br /><br />Minus-Guthaben des Verdoppler-Accounts repariert und Mitgliedsmail erweitert mit Transaktionsummer und IP-Nummer.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte verschieben Sie die doubler-Templates (Ordner: ".PATH."/templates/".GET_LANGUAGE()."/html/) in den neuen Order doubler!";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Zwei SQL-Fehler in <STRONG>inc/doubler_send.php</STRONG> beseitigt.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='4' WHERE what='doubler' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['doubler_send_mode'] == "RESET")) {
+               // So let's check for points
+               $INC_POOL[] = sprintf("%sinc/doubler_send.php", PATH);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "doubler";
+
+//
+?>
diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php
new file mode 100644 (file)
index 0000000..1d6a318
--- /dev/null
@@ -0,0 +1,233 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/17/2004 *
+ * ================                             Last change: 01/13/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-holiday.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Holiday requests from members                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ferienantraege von Mitgliedern                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.2.1";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // Create database
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_holidays";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_holidays (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+holiday_start VARCHAR(10) NOT NULL DEFAULT '0',
+holiday_end VARCHAR(10) NOT NULL DEFAULT '0',
+comments LONGBLOB NOT NULL,
+KEY (userid),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+       // Add default values to config
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'";
+
+       // Add member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','holiday','Urlaubsschaltung','4','Y','Y')";
+
+       // Add admin menus
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday', NULL, 'Urlaubsmanagement','4','Hier k&ouml;nnen Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday','list_holiday','Auflisten','1','Alle Urlaubsschaltungen auflisten.')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday','del_holiday','Urlaub beenden','2','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur &quot;Verstoss gegen unsere AGBs&quot; ein!')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday','config_holiday','Einstellungen','3','Maximale Tage f&uuml;r Urlaub usw. einstellen.')";
+
+       // Remove 0 max mails per day
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_holidays";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='holiday' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='holiday' LIMIT 4";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_max_receive (value, comment) VALUES('0','Urlaub')";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='holiday' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='holiday' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern der Urlaubsanfrage korregiert.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*60*24*2)."'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf <STRONG>Urlaub</STRONG> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie &quot;freigegeben&quot; sind!";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Urlaubsschaltung wird erst Abends um 00:00 Uhr aktiv und nicht durch die Beantragung. Dies kann nun auch auf direkte Umstellung eingestellt werden.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_activated BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Tabellenspalte hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'list_holiday')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'del_holiday')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('config', NULL, 'config_holiday')";
+
+               // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung in's neue Men&uuml;system integriert.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='account', sort='2', title='In Urlaub' WHERE what='holiday' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "holiday";
+
+//
+?>
diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php
new file mode 100644 (file)
index 0000000..9c223e3
--- /dev/null
@@ -0,0 +1,171 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 05/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-html_mail.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : HTML mails with default mail() routine           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : HTML-Mails mit Standart mail()-Routine           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.5";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.51", "0.0.52", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD html ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','html_mail','HTML-Empfang','3','Y','Y')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP html";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus DROP html_msg";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP html_msg";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='html_mail' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='html_mail' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='html_mail' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Der erstellte HTML-Code wird noch kompiliert (eigene HTML-Codes umgewandelt).";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+
+       // Define all arrary variables as global!
+       global $HTML_TAGS, $URL_ENDS, $VALID_EMAI_CHARS;
+
+       // Valid HTML tags (only simple and no attributes!)
+       $HTML_TAGS = array(
+               "b",
+               "i",
+               "u",
+               "ol",
+               "ul",
+               "li",
+               "strong",
+               "center",
+               "left",
+               "right",
+               "br",
+       );
+
+       // URL ends which are used to indentify the end of an URL or email link
+       // Don't use these chars in links... ;-)
+       //
+       $URL_ENDS = array(
+               " ",
+               "\n",
+               "\r",
+               ")",
+       );
+
+       // Valid email chars (without @, or do you want to have another @ inside your email addy?)
+       $VALID_EMAIL_CHARS = array(
+               'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
+               't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
+               'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1',
+               '2','3','4','5','6','7','8','9'
+       );
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "html_mail";
+
+//
+?>
diff --git a/inc/extensions/ext-mailid.php b/inc/extensions/ext-mailid.php
new file mode 100644 (file)
index 0000000..be23ece
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 07/08/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-mailid.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Mail confirmation link                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mailbestaetigungslink                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.3.3";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='mailid' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='mailid' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_lang_file='mailid' WHERE ext_name='mailid' AND ext_lang_file != 'mailid' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sprachdatei auf mailid gesetzt.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Turbo-Bonus interegiert, nur wenn bonus-Erweiterung v0.2.2 oder h&ouml;her ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Absicherung der Variablen <I>uid</I>, <I>mailid</I> und <I>bonusid</I> durch die eigene Funktion <I>bigintval()</I> in den beiden Dateien <I>mailid.php</I> und <I>mailid_top.php</I>.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weisse Seite im Mozilla bzw. <I>Seite nicht gefunden</I> unter dem IE behoben.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "register_globals-Problem behoben";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mailbest&auml;tigung klappt wieder.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Probe-Fix wegen falschen Best&auml;tigungcodes bei Druck auf Return-Taste. Bitte aktualisieren Sie auch das Template <U>mailid_confirm_buttom.tpl</U>, damit die Best&auml;tigung ohne Code auch klappt!";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate an den Scripten <U>mailid.php</U> und <STRONG>mailid_top.php</STRONG> durchgef&uuml;hrt.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sende-Pool wird nicht mehr ben&ouml;tigt, um die Best&auml;tigung durchzuf&uuml;hren.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Template <U>mailid_frameset.tpl</U> nach <U>mailid_frames.tpl</U> umbenannt.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabe des generierten HTML-Codes nach <U>inc/footer.php</U> verlagert.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Variablen gefixt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Gesamt-{!POINTS!} werden nun nach Best&auml;tigung angezeigt. Bitte aktualisieren Sie die Templates <U>mailid_points_done.tpl</U>, <U>mailid_points_done2.tpl</U> und <U>mailid_frames.tpl</U> !";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Variablen abgesichert (Diverse Warnhinweise des Webservers sind damit unterbunden).";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Parser-Fehler beseitigt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler wegen fehlende Datenfeldelementen behoben.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Modul <STRONG>mailid</STRONG> war nicht gesetzt. Dadurch wurden die URLs (loader z.B.) umgeschrieben und f&uuml;hrten somit zu Fehlern.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Den Punkte in der Gesamt-{!POINTS!}-Anzahl in ein Komma umgewandelt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wenn die ".POINTS." dem <STRONG>noch auf Auszahlung wartendem Guthaben</STRONG> aufaddiert wird, wird eine entsprechende Nachricht ausgegeben (neue Templates <STRONG>mailid_points_locked</STRONG> und <STRONG>mailid_points_locked2</STRONG> sind hinzugekommen!)";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bonus- und Standart-Referral-ID ausblendbar aus Aktiv-Rallye und bekommt kein Aktiv-Guthaben.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>Code wiederholen</STRONG> nach <STRONG>Code eingeben</STRONG> hin ge&auml;ndert.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Templates hinzugef&uuml;gt.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "mailid.php und mailid_top.php k&ouml;nnen erst bei aktivierter Erweiterung <strong>mailid</strong> benutzt werden. Solange gibt es fatale Fehlermeldungen.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte das Template <em><strong>".PATH."/templates/de/html/mailid/mailid_points_lcoked2.tpl</strong></em> l&ouml;schen. Noices fixed.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Variablen-Handling skriptglobal ge&auml;ndert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "mailid";
+
+//
+?>
diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php
new file mode 100644 (file)
index 0000000..e3e299e
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/13/2004 *
+ * ================                             Last change: 08/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-maintenance.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Maintenance mode                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wartungsmodus                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.6";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD maintenance ENUM('Y','N') NOT NULL DEFAULT 'N';";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','maintenance','Wartungsmodus','Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben k&ouml;nnen.','10')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='maintenance' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "maintenance";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php
new file mode 100644 (file)
index 0000000..2b13616
--- /dev/null
@@ -0,0 +1,150 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/05/2005 *
+ * ================                             Last change: 03/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-mediadata.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : More details media data                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr detailiertere Mediendaten                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.8";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_mediadata";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_mediadata' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Berechnung der Gesamt-{!POINTS!} korregiert.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Daten des Scriptes mit eingebunden.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // SQL commands to run
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_mediadata";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_mediadata (
+media_key VARCHAR(255) NOT NULL DEFAULT '',
+media_value VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY(media_key)
+) TYPE=MyISAM";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Teile der Mediendaten werden in seperater Tabelle gesichert. Bitte beachten Sie, dass dieses Update nur Daten des <STRONG>aktuellen</STRONG> Zustandes ber&uuml;cksichtigen kann und <STRONG>nicht</STRONG> bereits gel&ouml;schter Mitglieder.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mediendaten mussten komplett regeneriert werden.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_start BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_stage BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Start des ".MT_WORD2." und Anzahl Anmeldungen aufgenommen. (Task #13)<br />
+Bitte stellen Sie diesen derzeit manuell unter <A href=\"".URL."/modules.php?module=admin&amp;what=config_mediadata\">Einstellungen-Medidata</A> selber einstellen.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+if ((isset($dry_run)) && (isset($EXT_LOAD_MODE)))
+{
+       if ((!$dry_run) && ($EXT_LOAD_MODE == "update") && ($EXT_VER == "0.0.4"))
+       {
+               // Add auto-check file
+               $INC_POOL[] = sprintf("%sinc/gen_mediadata.php", PATH);
+       }
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "mediadata";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php
new file mode 100644 (file)
index 0000000..01f5954
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/17/2004 *
+ * ================                             Last change: 07/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-mods.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Module management (mod_reg table)                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Modul-Management (Tabelle mod_reg)               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.8";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods', NULL, 'Modul-Management','Verwalten Sie die Basis-Module index, login, admin usw.', 4)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','config_mods','Module &auml;ndern','&Auml;ndern Sie hier die Zugtiffsrechte auf die Module. Was dennoch nicht geht: Mitglied- oder Gastzugriffsrtechte auf Admin-Module bzw. Gastzugriffsrechte auf Mitglieder-Module. Diese sind extra abgesichert.', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','stats_mods','Modul-Statistiken','Sehen Sie sich hier die Statistiken der Module und die damit verkn&uuml;pften action- und what-Dateien an. Bei einigen Modulen gibt es allerdings keine verkn&uuml;pften Dateien und somit keine Extra-Statistik.', 2)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='mods' LIMIT 3";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dummy-Release im Internet???";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Modul-Management' WHERE action = 'mods' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verwaltung auf Management umgestellt.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "mods";
+
+//
+?>
diff --git a/inc/extensions/ext-mydata.php b/inc/extensions/ext-mydata.php
new file mode 100644 (file)
index 0000000..32b1f1e
--- /dev/null
@@ -0,0 +1,173 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/17/2004 *
+ * ================                             Last change: 07/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-mydata.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Swapped out "My profile data"                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes "Profildaten aendern"              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.8";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sperrung des Mitgliederprofiles nach &Auml;nderung kann unter &quot;Sonstige Einstellungen&quot; abgeschaltet werden (0 setzen!)";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datumsformat festgelegt auf ausf&uuml;hrlich.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Email-Adresse wird vor dem Speichern auf G&uml;tigkeit hin getestet.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Einbindung der Erweiterung <STRONG>country</STRONG>, die Sie sich noch optional von <A href=\"".URL."/modules.php?module=admin&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</A> m&uuml;ssen.<br />
+<br />
+<STRONG>Wichtig: Laden Sie noch die Template member_mydata_overview und member_mydata_edit (beide zu finden unter templates/".GET_LANGUAGE()."/html/member/ !) mit hoch!</STRONG>";
+
+               // Depends on 'country'!
+               $EXT_UPDATE_DEPENDS = "country";
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "SQL-Anweisungen mit SQL_QUERY_ESC() abgesichert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Einstellungen k&ouml;nnen nun auch ohne der Erweiterung <STRONG>country</STRONG> abgespeichert werden.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "mydata";
+
+//
+?>
diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php
new file mode 100644 (file)
index 0000000..648cdb1
--- /dev/null
@@ -0,0 +1,179 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/26/2005 *
+ * ================                             Last change: 02/26/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-newsletter.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Extension for sending newsletters                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweiterung zum Versenden von Newslettern        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.2";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='newsletter' AND what != 'send_newsletter' LIMIT 3";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='newsletter' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET locked='N', visible='Y' WHERE what='newsletter' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET locked='Y', visible='N' WHERE what='newsletter' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','list_newsletter','Abbestellungen','Alle Abbestellungen auflisten und bearbeiten.', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Geb&uuml;hr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='newsletter', what='send_newsletter', title='Versenden', sort='1' WHERE what='newsletter' LIMIT 1";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nl_charge FLOAT(10,2) UNSIGNED NOT NULL DEFAULT '5.00'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_receive ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_until VARCHAR(10) NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_timespan VARCHAR(10) NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vor der eigentlichen Freigabe dieser Erweiterungen habe ich sie versehendlich im Archiv mit auf den Server hochgeladen. Diese Version f&uuml;gt die bereits angek&uuml;ndigte Funktionalit&auml;ten, wie zum Beispiel das Einstellen der Abschaltgeb&uuml;hr.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "URL im Versendeformular und Option <I>Immer aktiv</I> f&uuml;r diese Erweiterung deaktiviert.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bitte Script inc/monthly_newsletter.php l&ouml;schen!";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Script <STRONG>inc/monthly/monthly_newsletter.php</STRONG> wird nicht mehr ausgef&uuml;hrt, wenn die Erweiterung nicht aktiviert ist.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Nur bei installierter Erweiterung <STRONG>html_mail</STRONG> k&ouml;nnen Sie auch HTML-Mails versenden.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Nur bei installierter Erweiterung <STRONG>html_mail</STRONG> k&ouml;nnen Sie auch HTML-Mails versenden.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&auml;hrung auf die Erweiterung <A href=\"#\"><STRONG>ext-other.zip</STRONG></A> verlagert. Bitte auch diese aktualisieren.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // URL ends which are used to indentify the end of an URL or email link
+       // Don't use these chars in links... ;-)
+       //
+       $URL_ENDS = array(
+               " ",
+               "\n",
+               "\r",
+               ")",
+       );
+
+       // Valid email chars (without @, or do you want to have another @ inside your email addy?)
+       $VALID_EMAIL_CHARS = array(
+               'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
+               't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
+               'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1',
+               '2','3','4','5','6','7','8','9'
+       );
+
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
+       {
+               // Daily reset was run so let's check out for expired newsletter orders
+               $INC_POOL[] = sprintf("%sinc/monthly/monthly_newsletter.php", PATH);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "newsletter";
+
+//
+?>
diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php
new file mode 100644 (file)
index 0000000..3ef849f
--- /dev/null
@@ -0,0 +1,214 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/17/2004 *
+ * ================                             Last change: 06/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-nickname.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Nickname login and display in register form      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Nickname-Login und Anzeige im Anmeldeformular    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nickname VARCHAR(255) NOT NULL DEFAULT ''";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nick_uid ENUM ('nick','uid') NOT NULL DEFAULT 'uid'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','nickname','Nicknamen','5','Y','Y')";
+
+       // Load CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='nickname' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what IN ('config_nickname','list_nickname') LIMIT 2";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_nickname_history";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='nickname' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='nickname' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='nickname' AND ext_has_css='N' LIMIT 1";
+
+               // This update depends on sql_patches update!
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei kann per Adminbereich ein- und ausgeschaltet werden.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nickname_len TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nickname_pattern VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nickname_chars VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenl&auml;nge, sowie erlaubte Zeichen hier ein.', 12)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Minimale L&auml;nge, sowie erlaubte Zeichen sind per Adminbereich &auml;nderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP nick_uid";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Auswahlf&uuml;r Mitglied ob mit Nickname oder User-ID einloggen entfernt.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Zum Zusenden eines neuen Passwortes kann jetzt entweder der Nickname / User-ID <U>ODER</U> die angemeldete EMail-Adresse eingegeben werden.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei in general.css verschmolzen (Patch 435!)";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='2' WHERE what='nickname' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitglieder ohne Nickname sollten kein <strong>*failed*</strong> mehr sehen.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12)";
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_nickname_history";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_nickname_history (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+nickname VARCHAR(255) NOT NULL DEFAULT '',
+added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+last_used TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+INDEX userid (userid),
+INDEX (last_used DESC),
+PRIMARY KEY(id)
+) TYPE=MyISAM COMMENT='History of used nicknames'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Historie eingegebener Nicknames hinzugef&uuml;gt. Mitglied kann auf bereits verwendeter zur&uuml;ckgreifen und Liste selbst l&ouml;schen.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // @TODO|@DEPRECATED Please rewrite these constants, LOAD_CONFIG() is no more needed in extensions
+       $dummy = LOAD_CONFIG();
+       define('__NICKNAME_LANG_CHARS', $dummy['nickname_chars']);
+       define('__NICKNAME_LENGTH'    , $dummy['nickname_len']);
+       define('__NICKNAME_PATTERN'   , $dummy['nickname_pattern']);
+       unset($dummy);
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "nickname";
+
+//
+?>
diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php
new file mode 100644 (file)
index 0000000..6b1fa94
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/14/2005 *
+ * ================                             Last change: 01/14/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-online.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is where online?                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wer befindet sich wo gerade Online?              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.4";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_online";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_online (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sid VARCHAR(32) NOT NULL DEFAULT '',
+ip VARCHAR(15) NOT NULL DEFAULT '',
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+module VARCHAR(255) NOT NULL DEFAULT '',
+action VARCHAR(255) NOT NULL DEFAULT '',
+what VARCHAR(255) NOT NULL DEFAULT '',
+is_admin ENUM('Y','N') NOT NULL DEFAULT 'N',
+is_member ENUM('Y','N') NOT NULL DEFAULT 'N',
+timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+PRIMARY KEY(id),
+KEY(userid),
+KEY(refid)
+) TYPE=MyISAM";
+       $SQLs[]="INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('misc','usr_online','Online-Statistik','Eine Liste von derzeit &quot;Online&quot; Usern. Doppelte Eintr&auml;ge k&ouml;nnte auf mangelnden Cookie-Support des Browsers oder auf einen Spider hindeuten.', 1)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_online";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='usr_online' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE action='online' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE action='online' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <U>Unknown column 'visibled' in 'field list'</U> behoben.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erstellung der Datenbanktabelle "._MYSQL_PREFIX."_online in diese Erweiterung ausgelagert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "online";
+
+//
+?>
diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php
new file mode 100644 (file)
index 0000000..695c60b
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 06/28/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-optimize.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Database optimization functions                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Datenbank-Optimierungsfunktionen                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.6";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_optimize_gain(
+  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+  gain decimal(10,3) NOT NULL DEFAULT '0.000',
+  PRIMARY KEY(id)
+) TYPE=MyISAM";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','optimize','DB optimieren','F&uuml;hren Sie dies ab und an aus, damit &uuml;berfl&uuml;ssige Daten aus der Datenbank entfernt werden.','5')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_optimize_gain";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='optimize' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "optimize";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php
new file mode 100644 (file)
index 0000000..5a7d2a9
--- /dev/null
@@ -0,0 +1,318 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/29/2004 *
+ * ================                             Last change: 11/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-order.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Swapped out order system for PRO version         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes Buchungssytem fuer PRO-Version     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.4.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='order' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='order' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='order' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Maximale Mailbuchungen sind nun vom maximalen Empfang abh&auml;gig.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Maximale Mailbuchung vervollst&auml;ndigt (Admin-Bereich und im Buchungsformular selber).";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Maximale Mailbuchungen repariert (werden nun hochgez&auml;hlt und bei t&auml;glichem Reset auf 0 gesetzt).";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dummy-Datenfeld wird wieder gel&ouml;scht, um Probleme zu vermeiden. Fehlende Spalte <I>mail_order</I> korregiert auf <I>mail_orders</I>.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Templates <U>member_frameset-back.tpl</U> und <U>member_frameset-send.tpl</U> nach <U>member_order_back.tpl</U> und <U>member_order_send.tpl</U> umbenannt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es wird nun &uuml;berpr&uuml;ft ob auch gen&uuml;gend Empf&auml;nger eingegeben worden sind und ob auch gen&uuml;gend empfangsbereit sind.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Minimum an Empf&auml;nger pro Mailbuchung einstellbar. Standart: 10 Empf&auml;nger";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anzahl mindestens einszustellende Empf&auml;nger wird nun auch angezeigt.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Speicherung der Einstellungen klappt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler in Mailbuchung behoben: Es wurde beim Ermitteln der n&ouml;tigen {!POINTS!} die maximale Anzahl von Usern in der Kategorie gew&auml;hlt und
+nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User h&auml;tte nicht gen&uuml;gend {!POINTS!} auf dem Konto. Ein Rechenbeispiel:
+<OL>
+  <LI>Das Mitglied w&auml;hlt eine Kategorie XYZ mit maximal 15 Empf&auml;ngern aus.</LI>
+  <LI>Es stellt die Mailart <U>&quot;3 {!POINTS!} Kosten / Mail&quot;</U> ein.</LI>
+  <LI>Es hat aber nur {!POINTS!} f&uuml;r 10 Empf&auml;nger und gibt 10 ein.</LI>
+  <LI>Das Script hatte bis zu dieser Version 3 {!POINTS!} * <U>15</U> = 45 {!POINTS!} gerechnet, hat das Mitglied mehr oder gleich 45 {!POINTS!}, fiehl dieser Fehler nicht
+  auf.</LI>
+  <LI>Hatte es aber, wie hier im Beispiel 31 {!POINTS!}, konnte es nicht mehr buchen.</LI>
+  <LI>Jetzt ist der Fehler endlich weg! Machen Sie dies bitte Ihren Mitgliedern bekannt.</LI>
+</OL>";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler mit <U>__MIN_VALUE</U> behoben.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Konstantenproblem beseitigt.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit nicht funktionierenden Mailbuchungen beseitigt.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Basis-Modul <STRONG>order.php</STRONG> abgesichert, wenn Erweiterung nicht aktiviert ist.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_select VARCHAR(255) NOT NULL DEFAULT 'userid'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_mode ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Beworbene URL wird nun getestet.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datumsformat festgelegt auf ausf&uuml;hrlich.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Unter <STRONG>Einstellungen - Mailbuchungsseite</STRONG> war immer die Tabellenspalte <STRONG>Mitgliedsnummer</STRONG> ausgew&auml;hlt.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dateiamenskonflikt zwischen den Erweiterungen <STRONG>support</STRONG> und <STRONG>order</STRONG> behoben.";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Das Mitglied konnte geziehlt die Anzahl Mailbuchungen durch Abspeichern seines Profiles beeinflussen. Der Fehler war eine falsche Tabellenspalte. Dies war <STRONG>max_mails</STRONG>, die durch das Mitglieder ver&auml;nderbar ist und zur Festellung der Maximalen Mailbuchungen herangezogen wurde.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Im Modul order (<STRONG>inc/modules/order.php</STRONG>) wurde fehlerhafterweise die Erweiterung <STRONG>beg</STRONG> getestet.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "SQL-Anweisungen mit SQL_QUERY_ESC() abgesichert.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mailbuchungsseite korregiert.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erneuten Fehler in Mailbuchungsseite behoben.";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = POINTS."-Abzug klappt wieder. Danke an Andreman!";
+               break;
+
+       case "0.4.1": // SQL queries for v0.4.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.4.2": // SQL queries for v0.4.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.4.3": // SQL queries for v0.4.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Neue Urlaubsschaltung mit integriert.";
+               break;
+
+       case "0.4.4": // SQL queries for v0.4.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ein <STRONG>WHERE ext_active='Y'</STRONG> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.";
+               break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.";
+               break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='order', sort='1', title='Klick-Mails' WHERE what='order' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.4.7": // SQL queries for v0.4.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+
+       case "0.4.8": // SQL queries for v0.4.8
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailbuchung' WHERE what='config_order' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkt &quot;Mailbuchungsseite&quot; nach &quot;Mailbuchung&quot; umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.";
+               break;
+
+       case "0.4.9": // SQL queries for v0.4.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei L&ouml;schung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen ".POINTS." wieder gutgeschrieben werden sollen oder in den Jackpot landen.";
+               break;
+
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Do daily reset only when installed and extension version is at least 0.1.1
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "0.1.1"))
+       {
+               // Reset mail order values
+               $result_ext = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "order";
+
+//
+?>
diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php
new file mode 100644 (file)
index 0000000..c365f2c
--- /dev/null
@@ -0,0 +1,204 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/19/2004 *
+ * ================                             Last change: 10/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-other.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Other administrative settings                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Weitere administrative Einstellungen             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.2.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <FONT class=\"admin_failed\">Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227</FONT> behoben.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Speichern der Einstellungen vereinfacht. Es wird dazu die Funktion ADMIN_SAVE_SETTINGS() verwendet.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT '3'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Angezeigte Kommastellen k&ouml;nnen zwischen 0 und 5 eingestellt werden.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen endlich beseitigt.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabemodus der CSS-Dateien hinzugef&uuml;gt. Bitte auch das Admin-Template aktualisieren!";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern der Einstellungen repariert.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Folgende Einstellungen k&ouml;nnen auf 0 gesetzt werden:
+<OL>
+<LI>Selbe beworbene URL nicht mehr bewerbar (0 = URL kann sofort wieder gebucht werden)</LI>
+<LI>G&uuml;tigkeitsdauer der Best&auml;tigungslinks (0 = Best&auml;tigungslinks laufen nie ab)</LI>
+<LI>Sperrzeit des Mitgliedprofiles nach &Auml;nderung (0 = Mitglied kann sein Account immer und sofort &auml;ndern)</LI>
+<LI>Profilaktualisierungsinterval (0 = Es wird keine Mail zum Profilaktualisierunng durch das Mitglied ausgesendet(</LI>
+<LI>Erneute Aussendung der Mail (0 = Siehe oben)</LI>
+</OL>";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Gast- und Mitgliedsmen&uuml;s lassen sich voneinander getrentt ein- und auschalten.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wort &quot;Baustelle&quot; vom Auto-Versand entfernt, da dieser nun klappt.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD reject_url VARCHAR(255) NOT NULL DEFAULT '".URL."'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei Ablehnung der URL wird jetzt endlich eine Standart-URL eingesetzt, die konfigurierbar ist. Fehler beim Laden der Konfiguration gefunden.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD currency VARCHAR(255) NOT NULL DEFAULT '&euro;'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Standart-W&auml;hrung der Geb&uuml;hren f&uuml;r alle Erweiterungen geltend hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die sonstigen Einstellungen lassen sich nun nur noch &auml;ndern, wenn die Erweiterung <strong>other</strong> auch installiert ist. Anderfalls gibt es einen SQL-Fehler beim Speichern und GROSS_GESCHRIEBENE Worte im Formular.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mailid_error_redirect ENUM('index','reject') NOT NULL DEFAULT 'index'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei fehlerhafter Mail w&auml;hrend der Best&auml;tigung kann wahlweise zur Hauptseite weitergeleitet oder auf die eingestellte Ablehnungsseite umgeleitet werden.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` CHANGE `mailid_error_redirect` `mailid_error_redirect` ENUM('INDEX','REJECT') NOT NULL DEFAULT 'INDEX'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei fehlerhafter Mail w&auml;hrend der Best&auml;tigung kann wahlweise zur Hauptseite weitergeleitet oder auf die eingestellte Ablehnungsseite umgeleitet werden.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "other";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php
new file mode 100644 (file)
index 0000000..be3ef40
--- /dev/null
@@ -0,0 +1,249 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ================                             Last change: 11/15/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-payout.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Payout extension                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version of this extension
+$EXT_VERSION = "0.3.8";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_payouts";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_payouts (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+payout_total DOUBLE(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+target_account VARCHAR(255) NOT NULL DEFAULT '',
+target_bank VARCHAR(255) NOT NULL DEFAULT '',
+payout_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+payout_timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+status ENUM('NEW','ACCEPTED','REJECTED') NOT NULL DEFAULT 'NEW',
+KEY(userid),
+KEY(payout_id),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_payout_types";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_payout_types (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+type VARCHAR(255) NOT NULL DEFAULT '',
+rate DOUBLE(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+min_points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_payouts','Auszahlungen','Auszahlungsarten einstellen, neu anlegen oder l&ouml;schen.','15')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('payouts','list_payouts','Anfragen auflisten','Listet alle Auszahlungsanfragen Ihrer Mitglieder auf.','16')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('main','payout','Auszahlungen','N','N','11')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_payouts";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_payout_types";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='payouts'";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='payout' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='payout' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='payout' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1.2": // SQL queries for v0.1.2
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.','8')";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='payouts', title='Einstellungen' WHERE action='setup' AND what='config_payouts' LIMIT 1";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD from_account VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD from_pass VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD engine_url VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD engine_ret_ok VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD engine_ret_failed VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD pass_enc ENUM('md5','base64','none') NOT NULL DEFAULT 'md5'";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts ADD password VARCHAR(255) NOT NULL DEFAULT ''";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts ADD target_url LONGBLOB NOT NULL";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts ADD banner_url LONGBLOB NOT NULL";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts ADD link_text VARCHAR(30) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types ADD allow_url ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types CHANGE pass_enc pass_enc ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Auflistung der Auszahlungen ausgelagert in Template <I>member_payout.tpl</I>.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts CHANGE payout_total payout_total DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types CHANGE rate rate DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Buttons aus Aufgabenauflisten ausgelagert";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabe der Auszahlungsm&ouml;glichkeiten im Mitgliedsbereich repariert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Work-Arount-L&ouml;sung zu tempor&auml;ren Problemen mit der Task-ID eingebaut.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Nachricht an Admin bei Auszahlungsanfrage wird endlich versendet.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler in Auszahlungsfunktion beseitigt, wenn Umrechnungsrate ungleich 1 eingestellt ist.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anzahl zu &uuml;berweisende {!POINTS!} m&uuml;ssen immer gr&ouml;sser 0 sein, ansonsten bricht das Script mit einer Fehlermeldung an das Mitglied ab.";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verwaltung nach Management umgestellt.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "payout";
+
+//
+?>
diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php
new file mode 100644 (file)
index 0000000..11ea3b3
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-primera.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Payout extension                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
+ * -------------------------------------------------------------------- *
+ * Modified payout extension! See: http://www.mxchange.org for details  *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version of this extension
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_primera";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_primera (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+primera_account VARCHAR(255) NOT NULL DEFAULT '',
+primera_amount DOUBLE(22,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+primera_timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+primera_type ENUM('IN','OUT','FAILED') NOT NULL DEFAULT 'FAILED',
+primera_api_message TINYTEXT,
+primera_api_status VARCHAR(255) NULL DEFAULT NULL,
+KEY(userid),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+       // Confiuration
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD primera_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD primera_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD primera_api_name VARCHAR(255) NOT NULL DEFAULT ''";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD primera_api_md5 VARCHAR(32) NOT NULL DEFAULT ''";
+
+       // User data
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD primera_userid VARCHAR(255) NOT NULL DEFAULT ''";
+
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('primera', NULL, 'Primera-Management','Konfiguration zur Primera-API einstellen, Auszahlungen auflisten usw..', 15)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('primera','config_primera','Primera-API-Einstellungen','Konfiguration zur Primera-API einstellen.', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('primera','list_primera','Primera-Anfragen auflisten','Listet alle Primera-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)";
+
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('main','primera','Primera-Ein-/Auszahlungen','N','N','11')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_primera";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='primera'";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='primera' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='primera' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='primera' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "primera";
+
+// Init array
+global $primera;
+$primera = array();
+
+//
+?>
diff --git a/inc/extensions/ext-profile.php b/inc/extensions/ext-profile.php
new file mode 100644 (file)
index 0000000..c8da120
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/01/2004 *
+ * ================                             Last change: 12/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-profile.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Profile update notificatios                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Profilaktualisierungserinnerungen                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Benachrichtungsmails werden nur beim t&auml;gichen Reset ausgesendet";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dummy-Release im Intranet??? Hmmm...";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Profilaktualisierungsmails werden nur dann ausgesendet, wenn <U>profile_update</U> und <U>prof_reupdate</U> &gt; 0 sind.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datumsformat festgelegt auf ausf&uuml;hrlich.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Namenskonflikt gel&ouml;sst mit Erweiterung <STRONG>update</STRONG> (kommt noch raus!)";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Do we have a daily-reset-run?
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
+       {
+               // So let's check for profiles which needs an update
+               $INC_POOL[] = sprintf("%sinc/profile-updte.php", PATH);
+       }
+       break;
+}
+// Language file prefix
+$EXT_LANG_PREFIX = "profile";
+
+//
+?>
diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php
new file mode 100644 (file)
index 0000000..cdacbea
--- /dev/null
@@ -0,0 +1,351 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/19/2004 *
+ * ================                             Last change: 12/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-rallye.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Referal rallye                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Rallyes starten                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.3.4";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_data";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_prices";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_users";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_rallye_data (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+title VARCHAR(255) NOT NULL DEFAULT '',
+descr LONGBLOB NOT NULL,
+template VARCHAR(255) NOT NULL DEFAULT '',
+start_time VARCHAR(10) NOT NULL DEFAULT '0',
+end_time VARCHAR(10) NOT NULL DEFAULT '0',
+auto_add_new_user ENUM('Y','N') NOT NULL DEFAULT 'Y',
+is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
+send_notify ENUM('Y','N') NOT NULL DEFAULT 'Y',
+notified ENUM('Y','N') NOT NULL DEFAULT 'N',
+KEY (admin_id),
+PRIMARY KEY (id)
+) TYPE=MyISAM";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_rallye_prices (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+rallye_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+price_level BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+info LONGBLOB NOT NULL,
+KEY (rallye_id),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_rallye_users (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+rallye_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+refs BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+KEY (rallye_id),
+KEY (userid),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('rallye', NULL, 'Rallye-Management','Richten Sie neue Ref-Rallyes ein, die zeitgesteuert anfangen und aufh&ouml;hren. Dabei wird alles weitere automatisch geregelt.','9')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('rallye','add_rallye','Neue Rallye hinzuf&uuml;gen','Neue Ref-Rallye hinzuf&uuml;gen.','1')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('rallye','config_rallye_prices','Preise einrichten','Richten Sie Preise zu den Rallyes ein.','2')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('rallye','list_rallyes','Rallyes verwalten','Alle bestehenden Ref-Rallyes auflisten, bearbeiten, stoppen, l&ouml;schen usw.','3')";
+       // Guest menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','rallyes','Ref-Rallyes','Y','Y','9')";
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('main','rallyes','Ref-Rallyes','Y','Y','9')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_data";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_prices";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_users";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='rallye' LIMIT 4";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='rallye' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='rallye' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE what='rallyes' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='rallyes' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE what='rallyes' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='rallyes' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_rallye_data ADD expired ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ablaufen der Rallyes intergriert.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_rallye_users ADD curr_points DOUBLE(23,3) NOT NULL DEFAULT '0.000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Aktueller {!POINTS!}-Stand wird beachtet.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <I>Unknown column 'd.useid' in 'on clause'</I> behoben.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <U>Template nicht gefunden</U> behoben und Admin-Formulare ausgelagert";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist. Und der vorherige Fehler <U>Template nicht gefunden</U> ist endlich beseitigt.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_rallye_users CHANGE curr_points curr_points DOUBLE(23,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anzeigefehler im Gast-/Mitgliedsbereich behoben.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Admin-Mails korregiert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Aktivierte bzw. abgelaufene Rallyes werden nur ausserhalb des CSS-Modus geladen (wenn also nicht css.php aufgerufen wurde)";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weitere Templates vom Admin-Bereich ausgelagert und Referral-Anazahl in der Mail zur Rallye-Ank&uuml;ndigung repariert.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Funktion ADMIN_USER_PROFILE_LINK() mit Verlinkung auf Referral-Liste implementiert.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_rallye_data ADD min_users BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_rallye_data ADD min_prices BIGINT(20) UNSIGNED NOT NULL DEFAULT '3'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ablaufen der Rallyes intergriert. Bauen Sie in Ihr Template <STRONG>templates/de/emails/member/member_rallye_notifty.tpl</STRONG> folgende zwei Zeilen ein:<br />
+<UL>
+  <LI>&#36;DATA&#91;min_users&#93;</LI>
+  <LI>&#36;DATA&#91;min_prices&#93;</LI>
+</UL>
+Zudem sollten Sie mindestens folgende Templates (in <STRONG>templates/".GET_LANGUAGE()."/html/guest/</STRONG> !) aktualisieren:<br />
+<UL>
+  <LI><STRONG>guest_rallye_footer.tpl</STRONG></LI>
+  <LI><STRONG>guest_rallye_header.tpl</STRONG></LI>
+</UL>";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Links wegen <STRONG>what=admins_contct</STRONG> ge&auml;ndert.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkt &quot;Rallyes verwalten&quot; repariert.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Automatisches Starten von Referral-Rallyes repariert.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fatalen Fehler beseitigt.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung f&uuml;r automatisch generierte Admin-Kontaktlinks ge&auml;ndert.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='rals', sort='1', title='Referral-Rallye' WHERE what='rallyes' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Rallyes werden nun nur dann automatisch beseitigt, wenn die Erweiterung <strong>autopurge</strong> installiert und aktiviert ist.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // Do stuff only when not in CSS mode
+       if (($CSS != "1") && ($CSS != "-1") && ($cacheMode != "init")) {
+               // Get total member count
+               $TOTAL = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+
+               // Add more data on higher versions
+               $ADD1 = ""; $ADD2 = ""; $OR = "";
+               if (GET_EXT_VERSION("rallye") >= "0.2.0") {
+                       $ADD1 = ", min_users, min_prices";
+                       $ADD2 = ", d.min_users, d.min_prices";
+                       $OR   = " OR (d.min_users <= ".$TOTAL." AND d.min_users > 0)";
+               } // END  - if
+
+               // Check for new started but not notified rallyes
+               $result = SQL_QUERY("SELECT SQL_SMALL_RESULT id, title, start_time, end_time, send_notify".$ADD1."
+FROM "._MYSQL_PREFIX."_rallye_data
+WHERE is_active='Y' AND notified='N' AND expired='N' AND start_time <= UNIX_TIMESTAMP() AND end_time > UNIX_TIMESTAMP()
+LIMIT 1", __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Start rallye
+                       RALLYE_AUTOSTART_RALLYES($result);
+               } // END - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Check for expired rallyes
+               $result = SQL_QUERY("SELECT SQL_SMALL_RESULT d.id, d.title, d.start_time, d.end_time, d.send_notify".$ADD2."
+FROM "._MYSQL_PREFIX."_rallye_data AS d
+WHERE d.is_active='Y' AND d.notified='Y' AND d.expired='N' AND (d.end_time <= UNIX_TIMESTAMP()".$OR.")
+LIMIT 1", __FILE__, __LINE__);
+               if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE("autopurge")))
+               {
+                       // End rallye here...
+                       RALLYE_EXPIRE_RALLYES($result);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "rallye";
+
+//
+?>
diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php
new file mode 100644 (file)
index 0000000..446d0d6
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/29/2008 *
+ * ================                             Last change: 09/29/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-refback.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Refback and ref overview                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Back und Ref-Uebersicht                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` (
+`id` bigint(20) NOT NULL auto_increment,
+`userid` bigint(20) NOT NULL DEFAULT 0,
+`level` smallint(6) NOT NULL DEFAULT 0,
+`refid` bigint(20) NOT NULL DEFAULT 0,
+`refback` float(4,1) NOT NULL DEFAULT 0.0,
+`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL,
+PRIMARY KEY (`id`),
+UNIQUE `user_refid` (`userid`,`level`,`refid`),
+KEY (`level`),
+KEY (`refid`)
+) ENGINE=MyISAM COMMENT='User Referals With Refback'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back/Ref-&Uuml;bersicht',4,'N','N')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
+       $SQLS[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='refback' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // When the refback is not installed we cannot load it's configuration... *sigh*
+       break;
+}
+
+// Shall we include special files?
+if ($EXT_LOAD_MODE == "register") {
+       // Execute this special file on this update
+       $INC_POOL[] = PATH."inc/gen_refback.php";
+} // END - if
+
+// Language file prefix (hmmm, what shall I write with SQL fixes? ;-) )
+$EXT_LANG_PREFIX = "refback";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php
new file mode 100644 (file)
index 0000000..2090697
--- /dev/null
@@ -0,0 +1,332 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/29/2004 *
+ * ================                             Last change: 11/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-register.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Swapped out registration system for new members  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes Anmeldesystem fuer Mitglieder      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.5.2";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+
+       // Load own CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_register' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_must_register";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_must_register (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+field_name VARCHAR(255) NOT NULL DEFAULT '',
+field_required ENUM('Y','N') NOT NULL DEFAULT 'Y',
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+               // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('surname','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('family_name','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('street_nr','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('cntry','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('zip','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('city','Y')";
+
+               // Add admin menu
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <STRONG>Profildaten &auml;ndern</STRONG> ein.', 12)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugef&uuml;gt.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1";
+
+               // This update depends on sql_patches update!
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // This update depends on sql_patches update!
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Konfiguration der Pflichtangaben ausgelagert in Template";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "S&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Cookie <U>refid</U> aus Anmeldeformular entfernt.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Referral-ID wird endlich korrekt gesetzt.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Parse error in <U>what-register.php</U> beseitigt.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Email-Adresse wird vor dem Speichern auf G&uml;tigkeit hin getestet.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Einbindung der Erweiterung <STRONG>country</STRONG>, die Sie sich noch optional von <A href=\"".URL."/modules.php?module=admin&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</A> m&uuml;ssen.<br />
+<br />
+<STRONG>Wichtig: Laden Sie noch das Template <STRONG>guest_register.tpl</STRONG> mit hoch, welches unter templates/".GET_LANGUAGE()."/html/guest/ zu finden ist!</STRONG>";
+
+               // Depends on 'country'
+               $EXT_UPDATE_DEPENDS = "country";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Auf Grund der Integration der neue Erweiterung <STRONG>country</STRONG> in die Anmeldephase klappte die Anmeldung nicht. Die dazu n&uuml;tige Verkn&uuml;pfung ist nun eingebaut und die Anmeldung klappt wieder. Vielen Dank nochmals an den Bug-Reporter (Fehlermelder)!";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design wird nach Anmeldung auch endlich im Mitgliedsmen&uuml; &uuml;bernommen.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_curr_theme<U>e</U>() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weitere SQL-Befehle abgesichert.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.4.1": // SQL queries for v0.4.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
+               break;
+
+       case "0.4.2": // SQL queries for v0.4.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_register2' WHERE what='config_reg' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das &Auml;ndern des Templates <STRONG>templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl</STRONG> ist nicht mehr n&ouml;tig.";
+               break;
+
+       case "0.4.3": // SQL queries for v0.4.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Parser-Error in <STRONG>inc/modules/guest/what-register.php</STRONG> beseitigt.";
+               break;
+
+       case "0.4.4": // SQL queries for v0.4.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.";
+               break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
+               break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Einstellung nach ".POINTS."-Einstellungen verlagert.";
+               break;
+
+       case "0.4.7": // SQL queries for v0.4.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+               break;
+
+       case "0.4.8": // SQL queries for v0.4.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.4.9": // SQL queries for v0.4.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.";
+               break;
+
+       case "0.5.0": // SQL queries for v0.5.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function REGISTER_ADD_CATEGORY_TABLE() in <strong>{!PATH!}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></em> beseitigt.";
+               break;
+
+       case "0.5.1": // SQL queries for v0.5.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mail-Template <strong>register-member.tpl</strong> gefixt. Danke an <A href=\"http://forum.mxchange.org/profile-59.html\" target=\"_blank\" title=\"Mitgliedsprofil aufrufen\">wliepe</A> f&uuml;r die Fehlerfindung!";
+               break;
+
+       case "0.5.2": // SQL queries for v0.5.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "register";
+
+//
+?>
diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php
new file mode 100644 (file)
index 0000000..977e676
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/30/2008 *
+ * ================                             Last change: 09/30/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-removeip.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Anonymizes the IP number of your visitors        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Anomymiziert die IP-Nummer Ihrer Besucher        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_anon_ip` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_anon_host` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_anon_ua` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_anon_ref` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_admin_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_guest_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_member_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `removeip_sponsor_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD `anonymous_ip` ENUM('127.0.0.1','0.0.0.0','RANDOM') NOT NULL DEFAULT '127.0.0.1'";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_removeip','Anonymit&auml;t/Privatsph&auml;hre','Stellen Sie hier ein, ob die IP-Nummer, User-Agent und/oder Referer-Adresse anonymisiert im gesamten Script verwendet werden soll.',15)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_removeip' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "removeip";
+
+//
+?>
diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php
new file mode 100644 (file)
index 0000000..20e442d
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/24/2004 *
+ * ================                             Last change: 05/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-repair.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Repair extension                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Reperatur-Erweiterung                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.5";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='repair' LIMIT 5";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair','repair_amenu','Admin-Men&uuml;', 2, 'Repariert die Gewichtung des Admin-Men&uuml;-Systems')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair','repair_gmenu','Gast-Men&uuml;', 3, 'Repariert die Gewichtung des G&auml;ste-Men&uuml;-Systems')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair','repair_mmenu','Mitglied-Men&uuml;', 4, 'Repariert die Gewichtung des Mitglieder-Men&uuml;-Systems')";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "F&uuml;gt ein Men&uuml;punkt zur Reperatur der Gewichtung des Admin-Men&uuml;s hinzu.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dummy-Release im Intranet??? Hmmmm....";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ung&uuml;tiges Update nach neuster Konvention (Erweiterung <strong>menu</strong> ist ung&uum;ltig).";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "repair";
+
+//
+?>
diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php
new file mode 100644 (file)
index 0000000..d0741fd
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/24/2004 *
+ * ================                             Last change: 08/28/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-rewrite.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Rewrites own links for search engines            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Schreibt eigene Links um fuer Suchmaschinen      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.2";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_rewrite' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetauscht: bid, mid, url, page, offset";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetauscht: type, do=search";
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "URLs zu MXChange.org (".SERVER_URL.") sind nun auch wieder g&uuml;ltig.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetausch: sub, home";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Links im Admin- und Mitgliedsbereich werden nicht mehr umgeschrieben. Entsprechend f&auml;llt die neue .htaccess-Datei kleiner aus. Bitte anpassen!";
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Links im Frametester-Modul werden nicht mehr umgeschrieben.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module &uuml;bersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Zu &uuml;berspringende Module k&ouml;nnen per Admin-Bereich eingestellt werden.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "rewrite";
+
+//
+?>
diff --git a/inc/extensions/ext-safe.php b/inc/extensions/ext-safe.php
new file mode 100644 (file)
index 0000000..690d683
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/14/2008 *
+ * ================                             Last change: 09/14/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-safe.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : A safe for storing points on a "safe" place      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ein Tresor zum Ablegen der Punkte an einem       *
+ *                     "sicheren Ort"                                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "safe";
+
+//
+?>
diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php
new file mode 100644 (file)
index 0000000..262e75c
--- /dev/null
@@ -0,0 +1,436 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ===============                              Last change: 06/28/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-sponsor.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor area                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenbereich                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       //
+       // SQL commands to run
+       //
+       //if (EXT_IS_ACTIVE("repair"))
+       //{
+               // Try to make it depend on repair
+               $EXT_UPDATE_DEPENDS = "repair";
+
+               //
+               // Sponsor data
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_data (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+company VARCHAR(255) NOT NULL DEFAULT '',
+position VARCHAR(255) NOT NULL DEFAULT '',
+tax_ident VARCHAR(255) NOT NULL DEFAULT '',
+gender ENUM('M','F','C') NOT NULL DEFAULT 'M',
+surname VARCHAR(255) NOT NULL DEFAULT '',
+family VARCHAR(255) NOT NULL DEFAULT '',
+street_nr1 VARCHAR(255) NOT NULL DEFAULT '',
+street_nr2 VARCHAR(255) NOT NULL DEFAULT '',
+zip VARCHAR(6) NOT NULL DEFAULT '',
+city VARCHAR(255) NOT NULL DEFAULT '',
+country CHAR(2) NOT NULL DEFAULT 'DE',
+phone VARCHAR(255) NOT NULL DEFAULT '',
+fax VARCHAR(255) NOT NULL DEFAULT '',
+cell VARCHAR(255) NOT NULL DEFAULT '',
+email VARCHAR(255) NOT NULL DEFAULT '',
+url VARCHAR(255) NOT NULL DEFAULT '',
+password VARCHAR(255) NOT NULL DEFAULT '',
+remote_addr VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+sponsor_created VARCHAR(10) NOT NULL DEFAULT '0',
+last_online VARCHAR(10) NOT NULL DEFAULT '0',
+last_change VARCHAR(10) NOT NULL DEFAULT '0',
+status ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
+receive_warnings ENUM('Y','N') NOT NULL DEFAULT 'Y',
+warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."',
+points_amount DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+points_used DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+ref_count BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+hash VARCHAR(32) NOT NULL DEFAULT '',
+last_pay FLOAT(7,2) UNSIGNED NOT NULL DEFAULT '0.00',
+last_curr VARCHAR(255) NOT NULL DEFAULT '&euro;',
+KEY(refid),
+KEY(email),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Sponsor orders
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_orders (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+regid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+payid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+pay_count BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+pay_status ENUM('PENDING','PAYED','UNPAYED','DELETED') NOT NULL DEFAULT 'PENDING',
+pay_ordered VARCHAR(10) NOT NULL DEFAULT '0',
+pay_done VARCHAR(10) NOT NULL DEFAULT '0',
+KEY (payid),
+KEY (regid),
+KEY (aid),
+KEY (sponsorid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Pay-types
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_paytypes (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+pay_name VARCHAR(255) NOT NULL DEFAULT '',
+pay_rate DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+pay_min_count BIGINT(20) UNSIGNED NOT NULL DEFAULT '1',
+pay_currency VARCHAR(255) NOT NULL DEFAULT '&euro;',
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Points-to-action converting
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_action_convert (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
+conv_rate BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+conv_name VARCHAR(255) NOT NULL DEFAULT 'Mails',
+KEY (ext_name),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Sponsor menu system (default)
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_menu (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+action VARCHAR(255) NOT NULL DEFAULT '',
+what  VARCHAR(255) NOT NULL DEFAULT '',
+title VARCHAR(255) NOT NULL DEFAULT '',
+active ENUM('Y','N') NOT NULL DEFAULT 'N',
+sort BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+KEY(what),
+KEY(action),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Registry for performable actions by your sponsors
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_registry (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
+is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
+stamp_added VARCHAR(10) NOT NULL DEFAULT '0',
+KEY(ext_name),
+KEY(aid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // URLs from the sponsors
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_urls (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+url VARCHAR(255) NOT NULL DEFAULT 'http://',
+title VARCHAR(255) NOT NULL DEFAULT '',
+clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+KEY(sponsorid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Banners of any size from the sponsors
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_banner (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+url VARCHAR(255) NOT NULL DEFAULT 'http://',
+alternate VARCHAR(255) NOT NULL DEFAULT '',
+width INT(7) NOT NULL DEFAULT '468',
+height INT(7) NOT NULL DEFAULT '60',
+views BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+KEY(sponsorid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Campaigns
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaigns (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+campaign_name VARCHAR(255) NOT NULL DEFAULT '',
+campaign_start VARCHAR(10) NOT NULL DEFAULT '0',
+campaign_end VARCHAR(10) NOT NULL DEFAULT '0',
+campaign_amount DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+campaign_expired ENUM('Y','N') NOT NULL DEFAULT 'N',
+campaign_locked ENUM('Y','N') NOT NULL DEFAULT 'Y',
+campaign_ended VARCHAR(10) NOT NULL DEFAULT '0',
+locked_reason tinyblob,
+locked_timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+KEY(aid),
+KEY(sponsorid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Campaigns + URLs + Banner
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaign_assigns (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+campaignid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+urlid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+bannerid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+views BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+KEY(bannerid),
+KEY(urlid),
+KEY(campaignid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Allowed data to display (administrative)
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_admin_data (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+data_row VARCHAR(255) NOT NULL DEFAULT '',
+display ENUM('Y','N') NOT NULL DEFAULT 'N',
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Allowed data to display (sponsor-side)
+               //
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_display_data (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+data_row VARCHAR(255) NOT NULL DEFAULT '',
+display ENUM('Y','N') NOT NULL DEFAULT 'N',
+KEY(sponsorid),
+PRIMARY KEY(id)
+)TYPE=MyISAM";
+               //
+               // Default allowed data to display
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('id','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('company','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('position','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('tax_ident','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('gender','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('surname','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('family','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr1','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr2','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('zip','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('city','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('country','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('phone','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('fax','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('email','Y')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('url','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('password','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('remote_addr','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('sponsor_created','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_online','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_change','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('status','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('receive_warnings','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('warning_interval','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_amount','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_used','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('refid','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('ref_count','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('hash','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_pay','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_curr','N')";
+               //
+               // Add default entries
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_registry (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N','".GET_ADMIN_ID(get_session('admin_login'))."','UNIX_TIMESTAMP()')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_action_convert (ext_name, conv_rate, conv_name) VALUES('sponsor','10','Mails')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '&euro;')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '&euro;')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '&euro;')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '&euro;')";
+               //
+               // Admin menu
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor', NULL, 'Sponsorenbereich','Den Sponsorenbereich verwalten. Hier k&ouml;nnen Sie auch Sonderaktionen seperat deakvieren oder wieder aktivieren, Sponsorenaccounts verwalten usw.', 7)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','add_sponsor','Neuer Sponsor','Neues Sponsorenaccount hinzuf&uuml;gen.', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','unlock_sponsor','Sponsor freischalten','Sponsorenaccounts freigeben / sperren.', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor','Sponsoren auflisten','Listet alle verf&uuml;gbaren Sponsorenaccounts auf.', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','edit_sponsor','Sponsor &auml;ndern','Sponsorenaccount &auml;ndern (Grundaten, nicht Freigabe!).', 4)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','lock_sponsor','Sponsor ent-/sperren','Sponsorenaccount sperren und entsperren.', 5)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','del_sponsor','Sponsor l&ouml;schen','Sponsorenaccount l&ouml;schen.', 6)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich &uuml;ber sicht anzeigen darf und welche nicht.', 7)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_menu','Sponsorenmen&uuml;','Das Sponsorenmen&uuml; kann hier ge&auml;ndert werden.', 9)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, l&ouml;schen, testen, bearbeiten usw.) von gebuchten URLs.', 11)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, l&ouml;schen, testen, bearbeiten usw.) von gebuchten Bannern.', 12)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren k&ouml;nnen sich {--POINTS--}-Pakete kaufen. Hier k&ouml;nnen Sie diese verwalten.', 14)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_conv','{--POINTS--} umwandeln...','Mit den vom Sponsor gekauften {--POINTS--} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {--POINTS--} nach Sponsoraktionen um. Beispiel: 1 {--POINTS--} = 10 Mails.', 15)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','config_sponsor','Einstellungen','Allgemeine Einstellungen am Sponsoring-System.', 16)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('repair','repr_sponsor','Sponsormen&uuml;','Gewichtung des Sponsormen&uuml;s reparieren.', 5)";
+               //
+               // Menu system (still admin menu)
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_medit','Sponsor-Men&uuml; editieren','Hier k&ouml;nnen Sie das Sponsorenmen&uuml; ver&auml;ndern: Positionen ver&auml;ndern, Men&uuml;titel &auml;ndern usw.', 7)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_madd','Sponsor-Men&uuml; hinzuf&uuml;gen','Hier k&ouml;nnen Sie einen neuen Men&uuml;punkt hinzuf&uuml;gen (falls Sie z.B. eigene Sponsoraktionen entwickelt haben oder welche versehendlich gel&ouml;scht haben.', 8)";
+               //
+               // Guest menu
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor', NULL, 'Sponsoren', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_login','Einloggen', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_agb','AGBs', 4)";
+               //
+               // Member menu
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort) VALUES ('main','sponsor','Unsere Sponsoren', 8)";
+               //
+               // Add default menus to sponsor menu
+               //
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main', NULL, 'Hauptauswahl','N', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','welcome','Willkommen','N', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','account','Ihr Account','N', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','campaigns','Kampagnen','N', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','urls','URL-Verwaltung','N', 4)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','banner','Banner-Verwaltung','N', 5)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','settings','Einstellungen','N', 6)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','fillup','Konto auff&uuml;llen','N', 7)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','stats','Statistiken','N', 8)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','inquiry','Kontaktanfrage','N', 9)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('main','refid','Referral-Link','N', 10)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('actions', NULL, 'Sponsorenaktionen','N', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('actions','mail','Sponsor-Mail','N', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('actions','banner','Banner buchen','N', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('actions','text','Textlink buchen','N', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('logout', NULL, 'Ausloggen','N', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('logout','logout','Ausloggen','N', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES('logout','guest','Zum Gastbereich','N', 2)";
+               //
+               // General configuration stuff
+               //
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD sponsor_ref_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '100.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD sponsor_min_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '1000.00000'";
+
+               // Load CSS file
+               $EXT_CSS = "Y";
+       //}
+       // else
+       //{
+       //      // Sponsor extension depends now on repair extension!
+       //      $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='sponsor' LIMIT 1";
+       //}
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='sponsor' LIMIT 5";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='sponsor' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE action='sponsor' LIMIT 4";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='sponsor' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='Y' WHERE active='N'";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='Y' WHERE is_active='N'";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='N', locked='Y' WHERE action='sponsor' LIMIT 4";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='sponsor' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='N' WHERE active='Y'";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='N' WHERE is_active='Y'";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "sponsor";
+
+//
+?>
diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php
new file mode 100644 (file)
index 0000000..426eb00
--- /dev/null
@@ -0,0 +1,731 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/21/2004 *
+ * ================                             Last change: 12/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-sql_patches.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : SQL fixes for pro versions                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes "Profildaten aendern"              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.5.3";
+
+// Auto-set extension version
+if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE
+what='theme_import' OR
+what='theme_edit' OR
+what='config_extensions' OR
+what='config_home' OR
+what='list_unconfirmed' OR
+what='config_refid' OR
+what='config_title' OR
+what='sub_points' OR
+what='config_admin' OR
+what='config_proxy' OR
+what='config_session' OR
+what='list_norefs'
+LIMIT 14";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='themes' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE
+action='themes' OR
+what='themes' OR
+what='stats2' OR
+(action='stats' AND (what='' OR what IS NULL)) OR
+(action='extras' AND (what='' OR what IS NULL)) OR
+(action='rals' AND (what='' OR what IS NULL)) OR
+(action='account' AND (what='' OR what IS NULL))";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE
+action='stats' OR
+action='extras' OR
+action='rals' OR
+action='account'";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
+
+       // Drop indexes
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP UNIQUE KEY (login)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner DROP INDEX (visible)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths DROP UNIQUE KEY (level)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem DROP INDEX (level)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP INDEX (data_type)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg DROP UNIQUE KEY (module)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (action)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu DROP INDEX (what)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_type)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (status)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (task_created)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP FULLTEXT (subject)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system DROP INDEX (subject)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP INDEX (ext_active)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (status)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP FULLTEXT (family)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (max_mails)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP INDEX (password)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (action)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (what)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (sort)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (visible)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu DROP INDEX (locked)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (what)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (sort)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (visible)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP INDEX (locked)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (visible)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats DROP INDEX (sort)";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es kann nun bestimmt werden, ob vom Server gel&ouml;schte ext-xxx.php erkannt werden sollen und die verkn&uuml;pften Daten auch aus der Datenbank entfernt werden sollen.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT '1209600'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "In der Tabelle <STRONG>"._MYSQL_PREFIX."_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. L&ouml;schen von Best&auml;tigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Das Wort &quot;Punkte&quot; kann nun per Datenbank ge&auml;ndert werden. Damit k&ouml;nnen Sie anstelle des Wortes Punkte auch Klammlose oder &euro; schreiben.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anzahl Mails pro Seite in <STRONG>EMail-Details ansehen</STRONG> und <STRONG>EMail-Archiv</STRONG> hinzugef&uuml;gt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_home','Home-Seite festlegen','Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;system genutzt werden soll.', 5)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die what-welcome.php ist derzeit die &quot;Home&quot;-Seite (Eingangsseite). Dies kann nun per Datenbank ge&auml;ndert werden.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es k&ouml;nnen nun SQL-Updates von einander abh&auml;ngig gemacht werden und die CSS-Datei kann per Admin-Bereich (wegen Debuggings) ein- bzw. ausgeschaltet werden.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT '&nbsp;<STRONG><BIG>&middot;</BIG></STRONG>&nbsp;'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <STRONG>MENUE_HOVER.txt</STRONG> zum Patchen der general.css bitte lesen!)";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_unconfirmed','Unbest. Mails auflisten','Schauen Sie sich hier unbest&auml;tigte Maillinks an. Bitte diesen Link nur &uuml;ber dem EMail-Archiv oder EMail-Details aufrufen, direkt aufgerufen bekommen Sie eine Fehlermeldung.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Unbest&auml;tigte Maillinks k&ouml;nnen unter Email-Management -&gt; Unbest. Mails auflisten aufgelistet werden.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Soll der einmalige Ref-Bonus &uuml;ber das Referral-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;system genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE what='config_home' LIMIT 1";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT '31536000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sie k&ouml;nnen nun <A href=\"".URL."/modules.php?module=admin&amp;what=config_home\">hier</A> die Verz&ouml;gerungszeit in der <A href=\"".URL."/index.php\">Eingangsseite</A> einstellen.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refid','Standart-Ref-ID','Stellen Sie hier die User-ID ein, die genommen werden soll, wenn der Gast n icht per Referral-Link Ihren Mailtausch aufgerufen hat.', 7)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD default_theme VARCHAR(255) NOT NULL DEFAULT '".GET_CURR_THEME()."'";
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='theme' LIMIT 3";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis &quot;theme&quot; nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','&Auml;ndern Sie Titel, Freigaben usw. an den Themes. Sie k&ouml;nnen bis auf das Standart-Theme &quot;default&quot; auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server l&ouml;schen, damit es niht erneut importiert werden kann.', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')";
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_themes";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_themes (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+theme_path VARCHAR(255) NOT NULL DEFAULT '',
+theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
+theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Theme-Support integriert. Bitte laden Sie sich zu dieser Version das <A href=\"http://www.mxchange.org\">281-Patch</A> (wenn Ihr Script v0.2.0-pre7 ist) herunter, da ansonsten die Themes nicht klappen werden!";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP ext_has_admin";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Spalte <U>ext_has_admin</U> aus der Tabelle <U>"._MYSQL_PREFIX."_extensions</U> entfernt, da sie keinen Sinn mehr macht.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_title','Seitentitel &auml;ndern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dekorationen des Seitentiteles lassen sich ein- und ausschalten und selber definieren; Modul-Titel und Titel der <STRONG>what</STRONG>-Dateien kann hinzugef&uuml;gt werden.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_jackpot CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE payment payment DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payments CHANGE price price DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE used_points used_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE points points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_points CHANGE locked_points locked_points DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "5 Nachkommastellen implementiert";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Gast- und Mitgliedsmen&uuml;s lassen sich getrennt voneinander abschalten.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               $auto_type = "png"; // PNG image is the default
+               if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
+                       // Switch to JPEG format
+                       $auto_type = "jpg";
+               }
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Generierung des Mailbest&auml;tigungscodes h&auml;ngt davon ab, ob die PHP-Funktion <U>imagecreatefromjpeg()</U> und das JPEG-Bild vorhanden sind oder nicht.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Spalten <U>max_mails</U> und <U>receive_mails</U> auf BIGINT(20) gesetzt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','sub_points','{!POINTS!} abziehen','Allen oder einem Mitglied {!POINTS!} abziehen.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abzug von {!POINTS!} nun m&ouml;glich.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action,what,title,sort) VALUES ('main','themes','Designs', 6)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_stats' WHERE what='stats' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<OL>
+<LI>Das Mitglied kann das derzeitige Design in sein Profil abspeichern.</LI>
+<LI>Mitgliederstatistik mit Seitennavigation.</LI>
+</OL>";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_login VARCHAR(10) NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachen&auml;nderung aufgefrischt.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='{!POINTS!}/Referral-Ebenen' WHERE what='config_points' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailverg&uuml;tungen...' WHERE what='payments' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Zwei Men&uuml;punkte umbenannt.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD UNIQUE KEY (ext_name)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD UNIQUE KEY (theme_path)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD INDEX (theme_active)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD UNIQUE KEY (login)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refbanner ADD INDEX (visible)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refdepths ADD UNIQUE KEY (level)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_refsystem ADD INDEX (level)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD INDEX (data_type)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD UNIQUE KEY (module)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (action)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu ADD INDEX (what)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_type)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (status)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (task_created)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD FULLTEXT (subject)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions ADD INDEX (ext_active)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (status)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD FULLTEXT (family)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (max_mails)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD INDEX (password)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (action)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (what)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (sort)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (visible)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_guest_menu ADD INDEX (locked)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (what)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (sort)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (visible)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu ADD INDEX (locked)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (visible)";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_cats ADD INDEX (sort)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Eindeutige Schl&uuml;ssel (UNIQUE KEY) und normale Schl&uuml;ssel (INDEX) gesetzt.";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Connection table between the menu system and the "logical area" system
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+la_id VARCHAR(255) NOT NULL DEFAULT '',
+la_action VARCHAR(255) NOT NULL DEFAULT '',
+la_what VARCHAR(255) NOT NULL DEFAULT '',
+INDEX (la_id),
+INDEX (la_action),
+INDEX (la_what),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+               // All "logical areas" together
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_las_data (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+la_id VARCHAR(255) NOT NULL DEFAULT '',
+la_title VARCHAR(255) NOT NULL DEFAULT '',
+la_posx BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+la_posy BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+UNIQUE KEY (la_id),
+INDEX (la_posx),
+INDEX (la_posy),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+               // Which menu do you like?
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'";
+
+               // Insert menus
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmen&uuml;','Diverse Einstellungen am Adminmen&uuml; vornehmen.', 9)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Logische Bereiche (Logical Areas = LAs) eingef&uuml;hrt. Dadurch wird das immer st&auml;rker anwachsende Admin-Men&uuml; in grosse Hauptgruppen unterteilt, wodurch ein Auffinden von Men&uuml;punkten verbessert wird.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure...
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // The statistics table
+               $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
+               $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_admin_menu_stats (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+aid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+type ENUM('la','action','what') NOT NULL DEFAULT 'what',
+clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+INDEX (aid),
+PRIMARY KEY (id)
+) TYPE=MyISAM";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Admin-abh&auml;ngig werden nun Klicks im Admin-Men&uuml; gez&auml;hlt, die zur automatischen Anpassung des Men&uuml;s in den logischen Bereichen diennen. Dieses &quot;intelligente Unbauen&quot; k&ouml;nnen Sie auch ganz abschalten.";
+               break;
+
+       case "0.3.4": // SQL queries for v0.3.4
+               // List accounts with no referral
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_norefs','Mitglieder ohne Werber','Finden Sie hier alle Mitglieder-Accounts, die von niemandem ({--MAIN_TITLE--} wird in der Mail als Werber angegebenen) geworben wurden.', 7)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "F&uuml;gt den Men&uuml;punkt &quot;Mitglieder ohne Werber&quot; in die Mitglieder-Management hinzu. Mit dieser neuen Funktion k&ouml;nnen Sie nach Mitglieder-Accounts ohne Werber suchen. TODO-ID #2 CLOSED";
+               break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               // List accounts with no referral
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET sort='8' WHERE action='themes' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='stats', sort='1', title='Klick-Mails' WHERE what='stats' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='account', sort='1', title='Designs' WHERE what='themes' LIMIT 1";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='3' WHERE what='reflinks' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett umgebaut.";
+               break;
+
+       case "0.3.6": // SQL queries for v0.3.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins MODIFY password VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_config SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_mod_reg ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)";
+               break;
+
+       case "0.3.7": // SQL queries for v0.3.7
+               $UPDATE_NOTES = "Problem w&auml;hrend des Installationsvorganges behoben.";
+               break;
+
+       case "0.3.8": // SQL queries for v0.3.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admin_menu CHANGE descr descr MEDIUMTEXT NULL";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool CHANGE `text` `text` LONGTEXT NOT NULL";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
+               break;
+
+       case "0.3.9": // SQL queries for v0.3.9
+               $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
+               $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_admin_menu SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'";
+               $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_guest_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
+               $SQLs[] = "UPDATE  "._MYSQL_PREFIX."_member_menu SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Beschreibungstexte f&uuml;r Admin-Men&uuml;s k&ouml;nnen l&auml;nger sein. Diverse Fixes.";
+               break;
+
+       case "0.4.0": // SQL queries for v0.4.0
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt.";
+               break;
+
+       case "0.4.1": // SQL queries for v0.4.1
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Tabellen-Schl&uuml;ssel neu gesetzt und Parsing-Zeit im Footer eingeblendet.";
+               break;
+
+       case "0.4.2": // SQL queries for v0.4.2
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Neuen Schl&uuml;ssel zur Online-Tabelle hinzugef&uuml;gt.";
+               break;
+
+       case "0.4.3": // SQL queries for v0.4.3
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_proxy','Proxy-Einstellungen','Sollte Ihr Webserver sich hinter einem Proxy befinden, so k&ouml;nnen Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Proxy-Einstellungen hinzugef&uuml;gt.";
+               break;
+
+       case "0.4.4": // SQL queries for v0.4.4
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET what=NULL WHERE what=''";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.";
+               break;
+
+       case "0.4.5": // SQL queries for v0.4.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_month CHAR(2) NOT NULL DEFAULT '00'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD last_week CHAR(2) NOT NULL DEFAULT '00'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "T&auml;glichen/w&ouml;chentlichen/monatlichen Reset verbessert.";
+               break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET gender=sex WHERE sex != 'M'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP sex";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Offensives Wort &quot;Sex&quot; gegen &quot;Gender&quot; ausgetauscht.";
+               break;
+
+       case "0.4.7": // SQL queries for v0.4.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgez&auml;hlt und der letzte vermerkt.";
+               break;
+
+       case "0.4.8": // SQL queries for v0.4.8
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Index f&uuml;r Betreff eingef&uuml;gt.";
+               break;
+
+       case "0.4.9": // SQL queries for v0.4.9
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "User-Hash zum Best&auml;tigen wird auf NULL gesetzt, wenn Account best&auml;tigt wird.";
+               break;
+
+       case "0.5.0": // SQL queries for v0.5.0
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Referal-System unterst&uuml;tzt nun detailierte Referal-&Uuml;bersicht und vieles mehr.";
+               break;
+
+       case "0.5.1": // SQL queries for v0.5.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_member_menu DROP `descr`";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmen&uuml; entfernt, welche ohnehin nicht genutzt wird.";
+               break;
+
+       case "0.5.2": // SQL queries for v0.5.2
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refdepths` CHANGE `percents` `percents` FLOAT(8,5) NOT NULL DEFAULT '0.00000'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Prozents&aum;tze k&ouml;nnen nun f&uuml;nf Stelle hinter dem Komma sein.";
+               break;
+
+       case "0.5.3": // SQL queries for v0.5.3
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD session_save_path varchar(255) NOT NULL DEFAULT ''";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_session','Session-Einstellungen','&Auml;ndern Sie hier den Speicherpfad f&uuml;r Sessiondateien (Sitzungsdateien) ab, falls die Standart-Einstellung bei Ihrem Hoster zu Problem f&uuml;hren sollte.', 16)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com n&ouml;tig.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       // When the sql_patches is not installed we cannot load it's configuration... *sigh*
+       if (GET_EXT_VERSION("sql_patches") != '') {
+               // Init key
+               $_CONFIG['secret_key'] = "";
+
+               // Read key from secret file
+               if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
+                       // Maybe need setup of secret key!
+                       require_once(PATH."inc/gen_sql_patches.php");
+
+                       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (is_object($cacheInstance))) {
+                               // Remove extensions and mod_reg cache file
+                               require_once(PATH."inc/libs/cache_functions.php");
+                               require_once(PATH."inc/extensions/ext-cache.php");
+                               if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
+                       } // END - if
+               } // END - if
+
+               // Test again
+               if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
+                       // File hash fas generated so we can also file the secret file... hopefully.
+                       $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
+                       if (FILE_READABLE($hashFile)) {
+                               // Read file
+                               $_CONFIG['secret_key'] = implode("", file($hashFile));
+                       } else {
+                               // Remove it from database
+                               UPDATE_CONFIG("file_hash", "");
+
+                               // Cannot read secret file!
+                               mxchange_die("Cannot read secret file! Please try to reload");
+                       }
+               } // END - if
+
+               // Transfer words/numbers to constants
+               define('POINTS'  , $_CONFIG['points_word']);
+               define('MT_WORD' , $_CONFIG['mt_word']);
+               define('MT_WORD2', $_CONFIG['mt_word2']);
+               define('MT_WORD3', $_CONFIG['mt_word3']);
+               define('_MAX'    , $_CONFIG['rand_no']);
+       } else {
+               // Set some lame ;-) default settings
+               $_CONFIG['def_refid'] = 0;
+               $_CONFIG['enable_title_deco'] = "N";
+               $_CONFIG['title_mod_show']    = "Y";
+               $_CONFIG['title_middle']      = "-";
+               //$_CONFIG['verbose_sql']       = "N";
+               define('MT_WORD' , DEFAULT_MT_WORD );
+               define('MT_WORD2', DEFAULT_MT_WORD2);
+               define('POINTS'  , DEFAULT_POINTS);
+       }
+       break;
+}
+
+// Language file prefix (hmmm, what shall I write with SQL fixes? ;-) )
+$EXT_LANG_PREFIX = "sql_patches";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-support.php b/inc/extensions/ext-support.php
new file mode 100644 (file)
index 0000000..b8d6d89
--- /dev/null
@@ -0,0 +1,136 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/29/2004 *
+ * ================                             Last change: 05/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-support.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Swapped out support system                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes Support-System                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.2";
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dateiamenskonflikt zwischen den Erweiterungen <STRONG>support</STRONG> und <STRONG>order</STRONG> behoben.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate vom 27.08.2005.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern der Support-Anfrage repariert und Mail wird an Mitglied wieder versendet.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "support";
+
+//
+?>
diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php
new file mode 100644 (file)
index 0000000..e67e15b
--- /dev/null
@@ -0,0 +1,236 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/28/2008 *
+ * ================                             Last change: 08/28/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-surfbar.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : A surfbar for your members                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Eine Surfbar fuer Ihre Mitglieder                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run (surfbar URLs)
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
+`id` BIGINT(20) UNSIGNED  NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`url` VARCHAR(255) NOT NULL DEFAULT '',
+`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
+`views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`views_max` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`views_allowed` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
+`registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+`lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
+`reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY(`id`),
+UNIQUE KEY `userid_url` (`userid`,`url`),
+INDEX `status_userid` (`status`,`userid`),
+INDEX (`payment_id`)
+) TYPE=MyISAM COMMENT='Surfbar URLs'";
+
+       // Reload locks
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY(`id`),
+INDEX (`userid`),
+INDEX (`url_id`)
+) TYPE=MyISAM COMMENT='Surfbar reload locks'";
+
+       // Surfbar salts
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_salts` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY(`id`),
+INDEX (`userid`),
+INDEX (`url_id`)
+) TYPE=MyISAM COMMENT='Surfbar last used salts'";
+
+       // Statistics
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_stats` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`last_online` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`userid`,`url_id`)
+) TYPE=MyISAM COMMENT='Surfbar Statistics'";
+
+       // Member actions pending on status
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_actions`";
+       $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_actions` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
+`action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
+`new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
+PRIMARY KEY (`id`),
+INDEX (`status`)
+) TYPE=MyISAM COMMENT='Surfbar Member Actions'";
+
+       // Member actions
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('PENDING','RETREAT','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('PENDING','FRAMETEST',NULL)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','EDIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','PAUSE','STOPPED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','FRAMETEST',NULL)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','FRAMETEST',NULL)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','RESUBMIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','EDIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','UNPAUSE','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('DEPLETED','EDIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('DEPLETED','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','EDIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','FRAMETEST',NULL)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','RESUBMIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','EDIT','PENDING')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','DELETE','DELETED')";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','FRAMETEST',NULL)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','BOOKNOW','PENDING')";
+
+       // Config entries
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5)."";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6)."";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_urls` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7)."";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*3)."";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_warn_low_points` BIGINT(20) NOT NULL DEFAULT 100";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_low_interval` BIGINT(20) NOT NULL DEFAULT ".$_CONFIG['one_day']."";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'";
+
+       // Extend user data
+       $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
+
+       // Member menus
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_list','URL-Verwaltung','Y','Y',3)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',4)";
+
+       // Admin menus
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzuf&uuml;gen','F&uuml;gen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. <strong>Vorsicht!</strong> Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzuf&uuml;gen.',1)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar &auml;ndern, wie Festverg&uuml;tung, prozentuale Ref-Verg&uuml;tung und vieles mehr.',4)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_stats','Statistiken','Detailierte Statistiken zu einer ausgew&auml;hlten URL anzeigen.',5)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_actions','Mitgliederaktionen','Listet alle Mitgliederaktionen auf.',6)";
+
+       // Load CSS?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_actions`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 5";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `action`='surfbar' LIMIT 7";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='surfbar' LIMIT 5";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `locked`='Y' WHERE `action` = 'surfbar' LIMIT 5";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "surfbar";
+
+//
+?>
diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php
new file mode 100644 (file)
index 0000000..2fd0a1f
--- /dev/null
@@ -0,0 +1,251 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/10/2004 *
+ * ================                             Last change: 09/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-task.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Task management                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Aufgabenverwaltung                               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.3.1";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('task', NULL, 'Aufgaben-Management','1','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.')";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('task','list_task','Aufgaben auflisten','1','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).')";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_task_system SET status='SOLVED' WHERE status='CLOSED'";
+
+       // Enable CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='task' LIMIT 2";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='task' AND ext_has_css='N' LIMIT 1";
+
+               // This update depends on sql_patches update!
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
+               break;
+
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Unn&ouml;tige Script-Teile aus what-list_tasks.php herausgel&ouml;scht; beim Anzeigen einer Extension-Update, oder -Register Aufgabe werden bei eingeschaltetem Verbose-Modus alle SQL-Anweisungen aufgelistet.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <FONT class=\"admin_failed\">Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227</FONT> behoben.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "&amp;admin= in &amp;amp;admin= umgewandelt.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erstellung der Extra-&Uuml;bersichten verbessert.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler bei Abfrage der payout-Erweiterung beseitigt.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Task-Liste ausgelagert als Template";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Links wegen <STRONG>what=admins_contct</STRONG> ge&auml;ndert.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Weitere Direkt-Links eingebaut:<br />
+<UL>
+  <LI>L&auml;ndercodes</LI>
+  <LI>Wartende Verdopplungen</LI>
+  <LI><STRONG>Ge&auml;ndert:</STRONG> Wartende Auszahlungen</LI>
+  <LI>Teilnehmer an der Aktiv-Rallye</LI>
+  <LI>Nett hinweisende Linktitel hinzugef&uuml;gt. :-)</LI>
+</UL>";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Direkt Links zum Sponsorenbereich vorbereitend eingebaut.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Es werden alle installierten und aktivierten Themes angezeigt und verlinkt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei in general.css verschmolzen (Patch 435!)";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Alle Administratoren, Referral-Banner und aktivierte Referral-Banner werden nun eingeblendet.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit &uuml;berlanger Textbreite beseitigt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Freischalten von Sponoren-Accounts korregiert.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sortierungsreihenfolge grundlegend ge&auml;ndert: Es wird jetzt nach Mitglieder-ID, Aufgabenbereich, Infos und nach dem Erstellunsdatum sortiert.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>Nur mit bonus v0.6.9 oder h&ouml;her:</STRONG> Zuschaltbare Bonis werden auch bei der Ermittlung Anzahl teilnehmender Mitglieder mit ber&uumk;cksichtigt.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Teilnehmer der Bettel-Rallye werden angezeigt.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum direkten Aufheben einer Urlaubsschaltung eines Mitgliedes korregiert.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt. Update-Aufgaben werden nach &quot;Bearbeitung&quot; nicht mehr als <STRONG>Erledigt</STRONG> gesetzt. Dies hatte sonst den Anschein, die Update-Aufgaben m&uuml;ssten erledigt werden, um die Erweiterungs-Updates einzuspielen, was aber automatisch geschieht.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Export-Accounts werden in Task-&Uuml;bersicht aufgelistet.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Diverse Fixes an den Templates (Notice-Hinweise vom PHP-Interpreter entfernt).";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "task";
+
+//
+?>
diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php
new file mode 100644 (file)
index 0000000..84a4728
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 06/28/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-theme.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme Management                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Theme-Management                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0.7";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_check','Pr&uuml;fen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='theme_check' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code f&uuml;r ein Zeilen-Template ausgelagert.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Im Men&uuml;punkt &quot;Pr&uuml;fen&quot; wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Variablen-Handling skriptglobal ge&auml;ndert.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD theme_name VARCHAR(255) NOT NULL DEFAULT ''";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Designname (von Menschen lesbar) hinzugef&uuml;gt.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "theme";
+
+//
+?>
diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php
new file mode 100644 (file)
index 0000000..358367b
--- /dev/null
@@ -0,0 +1,150 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/20/2004 *
+ * ================                             Last change: 11/20/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-top10.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : TOP10 clicker / points amount / etc.             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : TOP10-Klicker / Guthaben / Ref-Werber            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.1.2";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','top10','TOP-10','Y','Y', 7)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_top10','TOP-10 Listen','Stellen Sie hier ein, wie lang die TOP-Listen sein sollen, also wie viele Pl&auml;tze angezeigt werden sollen.', 8)";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD top10_max TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+
+       // Load CSS file?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='top10' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_top10' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE what='top10' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE what='top10' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <I>Column: 'userid' in group statement is ambiguous</I> im Gastbereich beseitigt.";
+               break;
+
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.4": // SQL queries for v0.0.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Im Gastbereich konnte als Nicht-Admin die Seite nicht ge&ouml;ffnet werden.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Rechtschreibefehler beseitigt.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "top10";
+
+//
+?>
diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php
new file mode 100644 (file)
index 0000000..77b6cad
--- /dev/null
@@ -0,0 +1,291 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/07/2004 *
+ * ================                             Last change: 07/08/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-transfer.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Point transfers between members                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punktetransfers zwischen Mitgliedern             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.2.9";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_in";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_out";
+
+       // Transfer from a member
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_in (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+from_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+reason VARCHAR(255) NOT NULL DEFAULT '',
+time_trans VARCHAR(14) NOT NULL DEFAULT '0',
+trans_id VARCHAR(12) NOT NULL DEFAULT '',
+KEY (userid),
+KEY (from_uid),
+PRIMARY KEY(id)
+) Type=MyISAM";
+
+       // Transfers to a member
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_out (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+to_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+reason VARCHAR(255) NOT NULL DEFAULT '',
+time_trans VARCHAR(14) NOT NULL DEFAULT '0',
+trans_id VARCHAR(12) NOT NULL DEFAULT '',
+KEY (userid),
+KEY (to_uid),
+PRIMARY KEY(id)
+) Type=MyISAM";
+
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer', NULL, '{!POINTS!}-Transfer','Verwalten Sie hier die {!POINTS!}-Transaktionen zwischen Ihren Mitgliedern.', 7)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','list_transfer','Auflisten','Hier bekommen Sie alle ein- und ausgehende Transaktionen aufgelistet.', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','config_transfer','Einstellungen','Stellen Sie ein, wie viele Transaktionen aufgelistet werden sollen und wie alt diese werden d&uuml;rfen. Die evtl. installierte autopurge-Erweiterung kann dann automatisch die veralteten Transktionen l&ouml;schen.', 2)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','del_transfer','Manuell l&ouml;schen','Hier k&ouml;nnen Sie - abgesehen von der automatischen L&ouml;schung - Transaktionen selber l&ouml;schen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gel&ouml;scht werden.', 3)";
+
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','transfer','{!POINTS!}-Transfer','Y','Y', 5)";
+
+       // Add config values
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*28)."'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".$_CONFIG['one_day']."'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT '100'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT '5'";
+
+       // Add row(s) to user's data
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_in";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_out";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='transfer' LIMIT 4";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='transfer' LIMIT 1";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP opt_in";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='transfer' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='transfer' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.2": // SQL queries for v0.0.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler <FONT class=\"admin_failed\">Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227</FONT> behoben.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "&Uuml;berfl&uuml;ssige unset()-Anweisungen aus der what-config_transfer.php entfernt. Dies wird bereits von der eigenen Funktion ADMIN_SAVE_SETTINGS() erledigt.";
+               break;
+
+       case "0.0.3": // SQL queries for v0.0.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+               break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_transfer ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link <I>Auflisten</LI> im Admin-Bereich hatte das eingeloggte Mitglied und nicht den eingeloggten Admin abgefragt. Automatisches L&ouml;schen von veraltete Eintr&auml;gen kann unabh&auml;ngig von der autopurge-Erweiterung de-/aktiviert werden. Bitte aktualisieren Sie auch die beiden Admin-Templates!";
+               break;
+
+       case "0.0.6": // SQL queries for v0.0.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
+               break;
+
+       case "0.0.7": // SQL queries for v0.0.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.0.8": // SQL queries for v0.0.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit E in Transaktionsnummer beseitigt.";
+               break;
+
+       case "0.0.9": // SQL queries for v0.0.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
+               break;
+
+       case "0.1.0": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
+               break;
+
+       case "0.1.2": // SQL queries for v0.1.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Template <u>admin_config_transfer_pro.tpl</u> ist &uuml;berfl&uuml;ssig geworden. Bitte l&ouml;schen Sie dies!";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Wort <STRONG>Punkte</STRONG> dynamisiert.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Parser-Error im Mitgliedsbereich beseitigt.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Durchf&uuml;hrung des Transfers korregiert.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'list_transfer')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'del_transfer')";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('config', NULL, 'config_transfer')";
+
+               // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung in's neue Men&uuml;system integriert.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "<STRONG>Touring-Code wiederholen</STRONG> nach <STRONG>Touring-Code eingeben</STRONG> hin ge&auml;ndert.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='extras', sort='5' WHERE what='transfer' LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitgliedsmen&uuml; komplett ge&auml;ndert.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die ".POINTS." k&ouml;nnen nun wieder wie gewohnt transferiert werden. Der Grund f&uuml;r <em>{--TRANSFER_INVALID_PASSWORD--}</em> war, dass der Cookie-Hash ein anderer ist, als der in der Datenbank... :-/";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlermeldung <em>Notice: Undefined index: to_uid in ".PATH."/inc/modules/member/what-transfer.php on line 301</em> gefixt. Danke an <a href=\"http://forum.mxchange.org/profile-8.html\" target=\"_blank\" title=\"Forumprofil von Piter01\">Piter01</a>.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y")) {
+               // Automatically remove outdated or not displayed transactions
+               TRANSFER_AUTPPURGE($_CONFIG['transfer_max'], $_CONFIG['transfer_age']);
+       }
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "transfer";
+
+//
+?>
diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php
new file mode 100644 (file)
index 0000000..d62590e
--- /dev/null
@@ -0,0 +1,226 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/29/2004 *
+ * ================                             Last change: 10/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-user.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Swapped out user management                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgelagertes Mitglieder-Management              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.3.3";
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+
+       // Load CSS-File?
+       $EXT_CSS = "Y";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_user' OR what='user_contct' LIMIT 2";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.1": // SQL queries for v0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_limit INT(7) NOT NULL DEFAULT '20'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun m&ouml;glich.";
+               break;
+
+       case "0.1.1": // SQL queries for v0.1.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='user' AND ext_has_css='N' LIMIT 1";
+
+               // This update depends on sql_patches update!
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
+
+       case "0.1.2": // SQL queries for v0.1.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mails_confirmed BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Dem Mitglied wird nun angezeigt, wie viele Mails er best&auml;tigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr ber&uuml;cksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit.";
+               break;
+
+       case "0.1.3": // SQL queries for v0.1.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Den Pfad <I>Sie sind hier</I> im Men&uuml;punkt <U>Online-Liste</U> erweitert.";
+               break;
+
+       case "0.1.4": // SQL queries for v0.1.4
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD emails_received BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. <BIG>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</BIG>";
+               break;
+
+       case "0.1.5": // SQL queries for v0.1.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.6": // SQL queries for v0.1.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+               break;
+
+       case "0.1.7": // SQL queries for v0.1.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
+               break;
+
+       case "0.1.8": // SQL queries for v0.1.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               break;
+
+       case "0.1.9": // SQL queries for v0.1.9
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
+               break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "User-Liste ausgelagert in Templates und &uuml;berbreite Zeile in 2er-Zeile umgewandelt.";
+               break;
+
+       case "0.2.1": // SQL queries for v0.2.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_alpha TINYINT(3) UNSIGNED NOT NULL DEFAULT '10'";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt.";
+               break;
+
+       case "0.2.2": // SQL queries for v0.2.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE gender gender ENUM('M','F','C') NOT NULL DEFAULT 'M'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
+               break;
+
+       case "0.2.3": // SQL queries for v0.2.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Datumsformat festgelegt auf ausf&uuml;hrlich.";
+               break;
+
+       case "0.2.4": // SQL queries for v0.2.4
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+               break;
+
+       case "0.2.5": // SQL queries for v0.2.5
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "SQL-Anweisungen abgesichert.";
+               break;
+
+       case "0.2.6": // SQL queries for v0.2.6
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+               break;
+
+       case "0.2.7": // SQL queries for v0.2.7
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Sicherheitsupdate f&uuml;r die Include-Befehle.";
+               break;
+
+       case "0.2.8": // SQL queries for v0.2.8
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
+               break;
+
+       case "0.2.9": // SQL queries for v0.2.9
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('user','user_contct','Mitglied kontaktieren','Kontaktieren Sie hier Ihre Mitglieder ganz direkt &uuml;ber ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Admin-Kontaktformular hinzugef&uuml;gt.";
+               break;
+
+       case "0.3.0": // SQL queries for v0.3.0
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.<br />Diverse Fixes f&uuml;r <em>0.2.1-Beta1</em> Release.";
+               break;
+
+       case "0.3.1": // SQL queries for v0.3.1
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND (what='' OR what IS NULL) LIMIT 1";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
+               break;
+
+       case "0.3.2": // SQL queries for v0.3.2
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "PHP-Hinweis in Userauflistung gefixt (trat bei fehlender nickname-Erweiterung auf) und Darstellungsfehler von <strong>0.00000</strong> unbest&auml;tigten Mails gefixt.";
+               break;
+
+       case "0.3.3": // SQL queries for v0.3.3
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und best&auml;tigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung <em>task</em>!)";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "user";
+
+// Extension is always active?
+$EXT_ALWAYS_ACTIVE = "Y";
+
+//
+?>
diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php
new file mode 100644 (file)
index 0000000..672ec50
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ================                             Last change: 11/15/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-wernis.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Payout extension                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
+ * -------------------------------------------------------------------- *
+ * Modified payout extension! See: http://www.mxchange.org for details  *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version of this extension
+$EXT_VERSION = "0.0.1";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0", "0.0.1");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_wernis";
+       $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_wernis (
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+wernis_account VARCHAR(255) NOT NULL DEFAULT '',
+wernis_amount DOUBLE(22,5) UNSIGNED NOT NULL DEFAULT '0.00000',
+wernis_timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+wernis_type ENUM('IN','OUT','FAILED') NOT NULL DEFAULT 'FAILED',
+wernis_api_message TINYTEXT,
+wernis_api_status VARCHAR(255) NULL DEFAULT NULL,
+KEY(userid),
+PRIMARY KEY(id)
+) TYPE=MyISAM";
+
+       // Confiuration
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_md5 VARCHAR(32) NOT NULL DEFAULT ''";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_url VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_refid VARCHAR(6) NOT NULL DEFAULT ''";
+
+       // User data
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD wernis_userid VARCHAR(6) NOT NULL DEFAULT ''";
+
+       // Admin menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('wernis', NULL, 'Wernis-Management','Konfiguration zur WDS66-API einstellen, Auszahlungen auflisten usw..', 15)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('wernis','config_wernis','WDS66-API-Einstellungen','Konfiguration zur WDS66-API einstellen.', 1)";
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES('wernis','list_wernis','Wernis-Anfragen auflisten','Listet alle Wernis-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)";
+
+       // Member menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('main','wernis','Wernis-Ein-/Auszahlungen','N','N', 11)";
+
+       // Guest menu
+       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('main','wernis_portal','WDS66-News','N','N', 7)";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_wernis";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='wernis'";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='wernis' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='wernis_portal' LIMIT 1";
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='wernis' LIMIT 1";
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='wernis' LIMIT 1";
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_factor DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_factor DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {!POINTS!}-&gt;Wernis versehen. Prozentualer Abzug als &quot;Betreibergeb&uuml;hr hinzugef&uuml;gt, was z.B. f&uuml;r Wechselstuben interessant ist.";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "wernis";
+
+// Init array
+global $WERNIS;
+$WERNIS = array();
+
+//
+?>
diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php
new file mode 100644 (file)
index 0000000..9972440
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2008 *
+ * ================                             Last change: 08/27/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-yoomedia.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Extension for contacting the API of Yoo!Media    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweitertung zur Anbindung an die API von        *
+ *                     Yoo!Media                                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Version number
+$EXT_VERSION = "0.0";
+
+// Auto-set extension version
+if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+
+// Version history array (add more with , "0.1" and so on)
+$EXT_VER_HISTORY = array("0.0");
+
+switch ($EXT_LOAD_MODE)
+{
+case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+       // SQL commands to run
+       $SQLs[] = "";
+       break;
+
+case "remove": // Do stuff when removing extension
+       // SQL commands to run
+       break;
+
+case "activate": // Do stuff when admin activates this extension
+       // SQL commands to run
+       break;
+
+case "deactivate": // Do stuff when admin deactivates this extension
+       // SQL commands to run
+       break;
+
+case "update": // Update an extension
+       switch ($EXT_VER)
+       {
+       case "0.0.1": // SQL queries for v0.0.1
+               $SQLs[] = "";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "";
+               break;
+       }
+       break;
+
+default: // Do stuff when extension is loaded
+       break;
+}
+
+// Language file prefix
+$EXT_LANG_PREFIX = "yoomedia";
+
+//
+?>
diff --git a/inc/fatal_errors.php b/inc/fatal_errors.php
new file mode 100644 (file)
index 0000000..96a7d85
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/29/2003 *
+ * ===============                              Last change: 01/16/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : fatal_errors.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Outputs fatal errors                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gibt fatale Fehler aus                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+if ((sizeof($FATAL) > 0) || (!empty($FATAL[0])))
+{
+       // Main div container
+       LOAD_TEMPLATE("fatal_header");
+
+       // Set unset variable
+       if (empty($check)) $check = "";
+       if (isBooleanConstantAndTrue('mxchange_installing')) {
+               // While we are installing ouput other header than while it is installed... :-)
+               $OUT = "";
+               foreach ($FATAL as $key => $value) {
+                       // Prepare content for the template
+                       $content = array(
+                               'key'   => ($key + 1),
+                               'value' => $value
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("install_fatal_row", true, $content);
+               }
+
+               // Load main template
+               LOAD_TEMPLATE("install_fatal_table", false, $OUT);
+       } elseif (isBooleanConstantAndTrue('mxchange_installed')) {
+               // Display all runtime fatal errors
+               $OUT = "";
+               foreach ($FATAL as $key => $value) {
+                       // Prepare content for the template
+                       $content = array(
+                               'key'   => ($key + 1),
+                               'value' => $value
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("runtime_fatal_row", true, $content);
+               }
+
+               // Load main template
+               mxchange_die(LOAD_TEMPLATE("runtime_fatal_table", true, $OUT));
+       }
+       $CORR = FATAL_REPORT_ERRORS;
+
+       // PHP warnings fixed
+       if ($check == "done") {
+               if (IS_ADMIN()) $CORR = FATAL_CORRECT_ERRORS;
+       }
+
+       // Load footer template
+       LOAD_TEMPLATE("fatal_footer", false, $CORR);
+}
+
+//
+?>
diff --git a/inc/footer.php b/inc/footer.php
new file mode 100644 (file)
index 0000000..6d4b63c
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 10/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : footer.php                                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Add the HTML code for the footer                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Den Fuss des HTML-Codes hinzufuegen              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Global variable stuff
+global $link, $frame, $CSS, $header;
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// @TODO Workaround for css.php
+if (!isset($footer)) $footer = 0;
+
+if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
+       // Output the generated HTML code or do nothing in direct-mode
+       if (!empty($FATAL[0])) {
+               // Output fatal error messages
+               require_once(PATH."inc/fatal_errors.php");
+       } // END - if
+
+       // Shall we display the copyright notice?
+       if ((empty($frame)) && (empty($_GET['frame'])) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER')) && ($header == "2")) {
+               // Backlink enabled?
+               if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) {
+                       // Copyright with backlink, thanks! :-)
+                       LOAD_TEMPLATE("copyright_backlink");
+               } else {
+                       // No backlink in Copyright note
+                       LOAD_TEMPLATE("copyright");
+               }
+       } // END - if
+
+       // Shall we display the parsing time and number of queries?
+       if ((isset($_CONFIG['show_timings'])) && ($_CONFIG['show_timings'] == "Y") && (empty($_GET['frame'])) && ($header == "2")) {
+               // Then display it here
+               DISPLAY_PARSING_TIME_FOOTER();
+       } // END - if
+
+       // Not in frameset mode?
+       if ((!isset($isFrameset)) || ($isFrameset === false)) {
+               // Load page footer
+               LOAD_TEMPLATE("page_footer");
+       } // END - if
+
+       // And the last closing HTML tag
+       OUTPUT_HTML("</HTML>");
+
+       // Footer has been reached
+       $footer = 1;
+
+       // Output HTML code
+       OUTPUT_HTML("");
+
+       if (is_resource($link)) {
+               // Close link
+               SQL_CLOSE($link, __FILE__, __LINE__);
+       } else {
+               // No database link
+               ADD_FATAL(NO_DB_LINK);
+       }
+} elseif ($CSS == "1") {
+       // Footer has been reached
+       $footer = 1;
+
+       // Output CSS content
+       OUTPUT_HTML("");
+}
+
+//
+?>
diff --git a/inc/functions.php b/inc/functions.php
new file mode 100644 (file)
index 0000000..d356add
--- /dev/null
@@ -0,0 +1,2674 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 11/29/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : functions.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Many non-MySQL functions (also file access)      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Viele Nicht-MySQL-Funktionen (auch Dateizugriff) *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Check if our config file is writeable or not
+function is_INCWritable($inc) {
+       $fp = @fopen(PATH."inc/".$inc.".php", 'a');
+       if ($inc == "dummy") {
+               // Remove dummy file
+               @fclose($fp);
+               return @unlink(PATH."inc/dummy.php");
+       } else {
+               // Close all other files
+               return @fclose($fp);
+       }
+}
+
+// Open a table (you may want to add some header stuff here)
+function OPEN_TABLE($PERCENT = "", $CLASS = "", $ALIGN="left", $VALIGN="", $td_only=false) {
+       global $table_cnt;
+
+       // Count tables so we can generate CSS classes for every table... :-)
+       if (empty($CLASS)) {
+               // Class is empty so count one up and create a class
+               $table_cnt++; $CLASS = "class".$table_cnt;
+       }
+       $OUT = "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\"";
+
+       // Shall I add the classes to TABLE and TD or only to TD?
+       if (!$td_only) $OUT .= " class=\"".$CLASS."\"";
+
+       // Width is given
+       if (!empty($PERCENT)) $OUT .= " width=\"".$PERCENT."\"";
+
+       // Horizonal align
+       if (!empty($ALIGN)) $OUT .=" align=\"".$ALIGN."\"";
+
+       // Vertical align is given
+       if (!empty($VALIGN))  $OUT .= " valign=\"".$VALIGN."\"";
+       $OUT .= ">\n<TR>\n<TD";
+       if (!empty($ALIGN)) $OUT .=" align=\"".$ALIGN."\"";
+       $OUT .= " class=\"".$CLASS."\">";
+       OUTPUT_HTML($OUT);
+}
+
+// Close a table (you may want to add some footer stuff here)
+function CLOSE_TABLE($ADD="") {
+       OUTPUT_HTML("  </TD>\n</TR>");
+       if (!empty($ADD)) OUTPUT_HTML($ADD);
+       OUTPUT_HTML("</TABLE>");
+}
+
+// Output HTML code directly or "render" it. You addionally switch the new-line character off
+function OUTPUT_HTML($HTML, $NEW_LINE = true) {
+       // Some global variables
+       global $OUTPUT, $footer, $CSS;
+
+       // Do we have HTML-Code here?
+       if (!empty($HTML)) {
+               // Yes, so we handle it as you have configured
+               switch (OUTPUT_MODE)
+               {
+               case "render":
+                       // That's why you don't need any \n at the end of your HTML code... :-)
+                       if (_OB_CACHING == "on") {
+                               // Output into PHP's internal buffer
+                               OUTPUT_RAW($HTML);
+
+                               // That's why you don't need any \n at the end of your HTML code... :-)
+                               if ($NEW_LINE) echo "\n";
+                       } else {
+                               // Render mode for old or lame servers...
+                               $OUTPUT .= $HTML;
+
+                               // That's why you don't need any \n at the end of your HTML code... :-)
+                               if ($NEW_LINE) $OUTPUT .= "\n";
+                       }
+                       break;
+
+               case "direct":
+                       // If we are switching from render to direct output rendered code
+                       if ((!empty($OUTPUT)) && (_OB_CACHING != "on")) { OUTPUT_RAW($OUTPUT); $OUTPUT = ""; }
+
+                       // The same as above... ^
+                       OUTPUT_RAW($HTML);
+                       if ($NEW_LINE) echo "\n";
+                       break;
+
+               default:
+                       // Huh, something goes wrong or maybe you have edited config.php ???
+                       die ("<STRONG>".FATAL_ERROR.":</STRONG> ".LANG_NO_RENDER_DIRECT);
+                       break;
+               }
+       } elseif ((_OB_CACHING == "on") && ($footer == 1)) {
+               // Output cached HTML code
+               $OUTPUT = ob_get_contents();
+
+               // Clear output buffer for later output
+               ob_end_clean();
+
+               // Extension "rewrite" installed?
+               if ((EXT_IS_ACTIVE("rewrite")) && (function_exists('REWRITE_LINKS')) && ($CSS != "1") && ($CSS != "-1")) {
+                       $OUTPUT = REWRITE_LINKS($OUTPUT);
+               } // END - if
+
+               // Compile and run finished rendered HTML code
+               while (strpos($OUTPUT, '{!') > 0) {
+                       // Prepare the content and eval() it...
+                       $newContent = "";
+                       $eval = "\$newContent = \"".COMPILE_CODE(addslashes($OUTPUT))."\";";
+                       @eval($eval);
+
+                       // Was that eval okay?
+                       if (empty($newContent)) {
+                               // Something went wrong!
+                               die("Evaluation error:<pre>".htmlentities($eval)."</pre>");
+                       } // END - if
+                       $OUTPUT = $newContent;
+               } // END - while
+
+               // Output code here, DO NOT REMOVE! ;-)
+               OUTPUT_RAW($OUTPUT);
+       } elseif ((OUTPUT_MODE == "render") && (!empty($OUTPUT))) {
+               // Rewrite links when rewrite extension is active
+               if ((EXT_IS_ACTIVE("rewrite")) && (function_exists('REWRITE_LINKS')) && ($CSS != "1") && ($CSS != "-1")) {
+                       $OUTPUT = REWRITE_LINKS($OUTPUT);
+               } // END - if
+
+               // Compile and run finished rendered HTML code
+               while (strpos($OUTPUT, '{!') > 0) {
+                       $eval = "\$OUTPUT = \"".COMPILE_CODE(addslashes($OUTPUT))."\";";
+                       eval($eval);
+               } // END - while
+
+               // Output code here, DO NOT REMOVE! ;-)
+               OUTPUT_RAW($OUTPUT);
+       }
+}
+
+// Output the raw HTML code
+function OUTPUT_RAW ($HTML) {
+       // Output stripped HTML code to avoid broken JavaScript code, etc.
+       echo stripslashes(stripslashes($HTML));
+
+       // Flush the output if only _OB_CACHING is not "on"
+       if (_OB_CACHING != "on") {
+               // Flush it
+               flush();
+       } // END - if
+}
+
+// Add a fatal error message to the queue array
+function ADD_FATAL ($message, $extra="") {
+       global $FATAL;
+       if (empty($extra)) {
+               // Regular text message to add to $FATAL
+               $FATAL[] = $message;
+       } else {
+               // $message is text with a mask plus extras to insert into the text
+               $FATAL[] = sprintf($message, $extra);
+       }
+}
+
+// Load a template file and return it's content (only it's name; do not use ' or ")
+function LOAD_TEMPLATE($template, $return=false, $content=array()) {
+       // Add more variables which you want to use in your template files
+       global $DATA, $_CONFIG, $username;
+
+       // Make all template names lowercase
+       $template = strtolower($template);
+
+       // Count the template load
+       if (!isset($_CONFIG['num_templates'])) $_CONFIG['num_templates'] = 0;
+       $_CONFIG['num_templates']++;
+
+       // Init some data
+       $ret = "";
+       if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
+
+       // @DEPRECATED Try to remove this if() block
+       if ($template == "member_support_form") {
+               // Support request of a member
+               $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // @TODO Merge this data into $content
+               list($gender, $surname, $family, $email) = SQL_FETCHROW($result);
+
+               // Translate gender
+               $gender = TRANSLATE_GENDER($gender);
+
+               // Insert data if content is an array
+               if (is_array($content)) {
+                       // Please switch to $content[bla] in all your templates! Direct
+                       // variables are deprecated as of 09/13/2008.
+                       $content['gender']  = $gender;
+                       $content['surname'] = $surname;
+                       $content['family']  = $family;
+                       $content['email']   = $email;
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Generate date/time string
+       $date_time = MAKE_DATETIME(time(), "1");
+
+       // Base directory
+       $BASE = sprintf("%stemplates/%s/html/", PATH, GET_LANGUAGE());
+       $MODE = "";
+
+       // Check for admin/guest/member templates
+       if (strpos($template, "admin_") > -1) {
+               // Admin template found
+               $MODE = "admin/";
+       } elseif (strpos($template, "guest_") > -1) {
+               // Guest template found
+               $MODE = "guest/";
+       } elseif (strpos($template, "member_") > -1) {
+               // Member template found
+               $MODE = "member/";
+       } elseif (strpos($template, "install_") > -1) {
+               // Installation template found
+               $MODE = "install/";
+       } elseif (strpos($template, "ext_") > -1) {
+               // Extension template found
+               $MODE = "ext/";
+       } elseif (strpos($template, "la_") > -1) {
+               // "Logical-area" template found
+               $MODE = "la/";
+       } else {
+               // Test for extension
+               $test = substr($template, 0, strpos($template, "_"));
+               if (EXT_IS_ACTIVE($test)) {
+                       // Set extra path to extension's name
+                       $MODE = $test."/";
+               }
+       }
+
+       ////////////////////////
+       // Generate file name //
+       ////////////////////////
+       $file = $BASE.$MODE.$template.".tpl";
+
+       if ((!empty($GLOBALS['what'])) && ((strpos($template, "_header") > 0) || (strpos($template, "_footer") > 0)) && (($MODE == "guest/") || ($MODE == "member/") || ($MODE == "admin/"))) {
+               // Select what depended header/footer template file for admin/guest/member area
+               $file2 = sprintf("%s%s%s_%s.tpl",
+                       $BASE,
+                       $MODE,
+                       $template,
+                       SQL_ESCAPE($GLOBALS['what'])
+               );
+
+               // Probe for it...
+               if (FILE_READABLE($file2)) $file = $file2;
+
+               // Remove variable from memory
+               unset($file2);
+       }
+
+       // Does the special template exists?
+       if (!FILE_READABLE($file)) {
+               // Reset to default template
+               $file = $BASE.$template.".tpl";
+       } // END - if
+
+       // Now does the final template exists?
+       if (FILE_READABLE($file)) {
+               // The local file does exists so we load it. :)
+               $tmpl_file = implode("", file($file));
+
+               // Replace ' to our own chars to preventing them being quoted
+               while (strpos($tmpl_file, "\'") !== false) { $tmpl_file = str_replace("\'", '{QUOT}', $tmpl_file); }
+
+               // Do we have to compile the code?
+               $ret = "";
+               if ((strpos($tmpl_file, "\$") !== false) || (strpos($tmpl_file, '{--') !== false) || (strpos($tmpl_file, '--}') > 0)) {
+                       // Okay, compile it!
+                       $tmpl_file = "\$ret=\"".COMPILE_CODE(addslashes($tmpl_file))."\";";
+                       eval($tmpl_file);
+               } else {
+                       // Simply return loaded code
+                       $ret = $tmpl_file;
+               }
+
+               // Add surrounding HTML comments to help finding bugs faster
+               $ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
+       } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!isBooleanConstantAndTrue('mxchange_installed')))) {
+               // Only admins shall see this warning or when installation mode is active
+               $ret = "<br /><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><br />
+(".basename($file).")<br />
+<br />
+".TEMPLATE_CONTENT."
+<pre>".print_r($content, true)."</pre>
+".TEMPLATE_DATA."
+<pre>".print_r($DATA, true)."</pre>
+<br /><br />";
+       }
+
+       // Do we have some content to output or return?
+       if (!empty($ret)) {
+               // Not empty so let's put it out! ;)
+               if ($return) {
+                       // Return the HTML code
+                       return $ret;
+               } else {
+                       // Output direct
+                       OUTPUT_HTML($ret);
+               }
+       } elseif (isBooleanConstantAndTrue('DEBUG_MODE')) {
+               // Warning, empty output!
+               return "E:".$template."<br />\n";
+       }
+}
+
+// Send mail out to an email address
+function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") {
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO},SUBJECT={$SUBJECT}<br />\n";
+
+       // Compile subject line (for POINTS constant etc.)
+       $eval = "\$SUBJECT = html_entity_decode(\"".COMPILE_CODE(addslashes($SUBJECT))."\");";
+       eval($eval);
+
+       // Set from header
+       if ((!eregi("@", $TO)) && ($TO > 0)) {
+               // Value detected, is the message extension installed?
+               if (EXT_IS_ACTIVE("msg")) {
+                       ADD_MESSAGE_TO_BOX($TO, $SUBJECT, $MSG, $HTML);
+                       return;
+               } else {
+                       // Load email address
+                       $result_email = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__);
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
+
+                       // Does the user exist?
+                       if (SQL_NUMROWS($result_email)) {
+                               // Load email address
+                               list($TO) = SQL_FETCHROW($result_email);
+                       } else {
+                               // Set webmaster
+                               $TO = WEBMASTER;
+                       }
+
+                       // Free result
+                       SQL_FREERESULT($result_email);
+               }
+       } elseif ("$TO" == "0") {
+               // Is the webmaster!
+               $TO = WEBMASTER;
+       }
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO}<br />\n";
+
+       // Check for PHPMailer or debug-mode
+       if (!CHECK_PHPMAILER_USAGE()) {
+               // Not in PHPMailer-Mode
+               if (empty($FROM)) {
+                       // Load email header template
+                       $FROM = LOAD_EMAIL_TEMPLATE("header");
+               } else {
+                       // Append header
+                       $FROM .= LOAD_EMAIL_TEMPLATE("header");
+               }
+       } elseif (isBooleanConstantAndTrue('DEBUG_MODE')) {
+               if (empty($FROM)) {
+                       // Load email header template
+                       $FROM = LOAD_EMAIL_TEMPLATE("header");
+               } else {
+                       // Append header
+                       $FROM .= LOAD_EMAIL_TEMPLATE("header");
+               }
+       }
+
+       // Compile "TO"
+       $eval = "\$TO = \"".COMPILE_CODE(addslashes($TO))."\";";
+       eval($eval);
+
+       // Fix HTML parameter (default is no!)
+       if (empty($HTML)) $HTML = "N";
+       if (isBooleanConstantAndTrue('DEBUG_MODE')) {
+               // In debug mode we want to display the mail instead of sending it away so we can debug this part
+               echo "<pre>
+".htmlentities(trim($FROM))."
+To      : ".$TO."
+Subject : ".$SUBJECT."
+Message : ".$MSG."
+</pre>\n";
+
+               // Log the mail away
+               if (defined('DEBUG_MAIL')) DEBUG_LOG(__FUNCTION__.":to={$TO},subject={$SUBJECT},msg={$MSG}");
+       } elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail"))) {
+               // Send mail as HTML away
+               SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM);
+       } elseif (!empty($TO)) {
+               // Send Mail away
+               SEND_RAW_EMAIL($TO, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM);
+       } elseif ($HTML == "N") {
+               // Problem found!
+               SEND_RAW_EMAIL(WEBMASTER, COMPILE_CODE($SUBJECT), COMPILE_CODE($MSG), $FROM);
+       }
+}
+
+// Check if legacy or PHPMailer command
+// @private
+function CHECK_PHPMAILER_USAGE() {
+       return ((defined('SMTP_HOSTNAME')) && (defined('SMTP_USER')) && (defined('SMTP_PASSWORD')) && (SMTP_HOSTNAME != "") && (SMTP_USER != ""));
+}
+
+/*
+ * Send out a raw email with PHPMailer class or legacy mail() command
+ */
+function SEND_RAW_EMAIL ($to, $subject, $msg, $from) {
+       // Shall we use PHPMailer class or legacy mode?
+       if (CHECK_PHPMAILER_USAGE()) {
+               // Use PHPMailer class with SMTP enabled
+               require_once(PATH."inc/phpmailer/class.phpmailer.php");
+               require_once(PATH."inc/phpmailer/class.smtp.php");
+
+               // get new instance
+               $mail = new PHPMailer();
+               $mail->PluginDir  = sprintf("%sinc/phpmailer/", PATH);
+
+               $mail->IsSMTP();
+               $mail->SMTPAuth   = true;
+               $mail->Host       = SMTP_HOSTNAME;
+               $mail->Port       = 25;
+               $mail->Username   = SMTP_USER;
+               $mail->Password   = SMTP_PASSWORD;
+               if (empty($from)) {
+                       $mail->From = WEBMASTER;
+               } else {
+                       $mail->From = $from;
+               }
+               $mail->FromName   = MAIN_TITLE;
+               $mail->Subject    = $subject;
+               if ((EXT_IS_ACTIVE("html_mail")) && (strip_tags($msg) != $msg)) {
+                       $mail->Body       = $msg;
+                       $mail->AltBody    = "Your mail program required HTML support to read this mail!";
+                       $mail->WordWrap   = 70;
+                       $mail->IsHTML(true);
+               } else {
+                       $mail->Body       = $msg;
+               }
+               $mail->AddAddress($to, "");
+               $mail->AddReplyTo(WEBMASTER,MAIN_TITLE);
+               $mail->AddCustomHeader("Errors-To:".WEBMASTER);
+               $mail->AddCustomHeader("X-Loop:".WEBMASTER);
+               $mail->Send();
+       } else {
+               // Use legacy mail() command
+               @mail($to, $subject, $msg, $from);
+       }
+}
+//
+
+// Generate a password in a specified length or use default password length
+function GEN_PASS($LEN = 0) {
+       global $_CONFIG;
+       if ($LEN == 0) $LEN = $_CONFIG['pass_len'];
+
+       // Initialize array with all allowed chars
+       $ABC = explode(",", "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/");
+
+       // Initialize randomizer
+       mt_srand((double) microtime() * 1000000);
+
+       // Start creating password
+       $PASS = "";
+       for ($i = 0; $i < $LEN; $i++) {
+               $PASS .= $ABC[mt_rand(0, sizeof($ABC) -1)];
+       }
+
+       // When the size is below 40 we can also add additional security by scrambling it
+       if (strlen($PASS) <= 40) {
+               // Also scramble the password
+               $PASS = scrambleString($PASS);
+       }
+
+       // Return the password
+       return $PASS;
+}
+//
+function MAKE_DATETIME ($time, $mode="0")
+{
+       if ($time == 0) {
+               // Never happend
+               return NEVER_HAPPENED;
+       } else {
+               // Filter out numbers
+               $time = bigintval($time);
+       }
+
+       switch (GET_LANGUAGE())
+       {
+       case "de": // German date / time format
+               switch ($mode) {
+                       case "0": $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
+                       case "1": $ret = strtolower(date("d.m.Y - H:i", $time)); break;
+                       case "2": $ret = date("d.m.Y|H:i", $time); break;
+                       case "3": $ret = date("d.m.Y", $time); break;
+               }
+               break;
+
+       default:        // Default is the US date / time format!
+               switch ($mode) {
+                       case "0": $ret = date("r", $time); break;
+                       case "1": $ret = date("Y-m-d - g:i A", $time); break;
+                       case "2": $ret = date("y-m-d|H:i", $time); break;
+                       case "3": $ret = date("y-m-d", $time); break;
+               }
+       }
+       return $ret;
+}
+
+// Translates the american decimal dot into a german comma
+function TRANSLATE_COMMA ($dotted, $cut=true) {
+       global $_CONFIG;
+
+       // Default is 3 you can change this in admin area "Misc -> Misc Options"
+       if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
+       $maxComma = $_CONFIG['max_comma'];
+
+       // Cut zeros off?
+       if ($cut) {
+               // Test for commata if in cut-mode
+               $com = explode(".", $dotted);
+               if (count($com) > 1) {
+                       // Commata found, so only zeros?
+                       if ($com[1] == str_repeat("0", strlen($com[1]))) {
+                               // Only zeros, so display only one
+                               $maxComma = 1;
+                       } // END - if
+               } else {
+                       // Don't display commatas even if there are none... ;-)
+                       $maxComma = 0;
+               }
+       } // END - if
+
+       // Debug log
+       //DEBUG_LOG(__FUNCTION__.":dotted={$dotted},maxComma={$maxComma}");
+
+       // Translate it now
+       switch (GET_LANGUAGE()) {
+       case "de":
+               $dotted = number_format($dotted, $maxComma, ",", ".");
+               break;
+
+       default:
+               $dotted = number_format($dotted, $maxComma, ".", ",");
+               break;
+       }
+
+       // Return translated value
+       return $dotted;
+}
+
+//
+function DEREFERER ($URL) {
+       $URL = URL."/modules.php?module=loader&amp;url=".urlencode(base64_encode(gzcompress($URL)));
+       return $URL;
+}
+
+//
+function TRANSLATE_GENDER ($gender) {
+       switch ($gender)
+       {
+               case "M": $ret = GENDER_M; break;
+               case "F": $ret = GENDER_F; break;
+               case "C": $ret = GENDER_C; break;
+               default : $ret = $gender; break;
+       }
+       return $ret;
+}
+//
+function FRAMETESTER($URL) {
+       // Prepare frametester URL
+       $frametesterUrl = sprintf("%s/modules.php?module=frametester&amp;url=%s",
+               URL,
+               urlencode(base64_encode(gzcompress(COMPILE_CODE($URL))))
+       );
+       return $frametesterUrl;
+}
+//
+function SELECTION_COUNT($array) {
+       $ret = 0;
+       if (is_array($array)) {
+               foreach ($array as $key => $sel) {
+                       if (!empty($sel)) $ret++;
+               }
+       }
+       return $ret;
+}
+//
+function IMG_CODE ($code, $type, $DATA, $uid) {
+       return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&amp;".$type."=".$DATA."&amp;mode=img&amp;code=".$code."\">";
+}
+//
+function TRANSLATE_STATUS($status) {
+       switch ($status)
+       {
+       case "UNCONFIRMED":
+               $ret = ACCOUNT_UNCONFIRMED;
+               break;
+
+       case "CONFIRMED":
+               $ret = ACCOUNT_CONFIRMED;
+               break;
+
+       case "LOCKED":
+               $ret = ACCOUNT_LOCKED;
+               break;
+
+       case "":
+       case null:
+               $ret = ACCOUNT_DELETED;
+               break;
+
+       default:
+               $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
+               break;
+       }
+       return $ret;
+}
+//
+function GET_LANGUAGE() {
+       if (!empty($_GET['mx_lang'])) {
+               // Accept only first 2 chars
+               $lang = substr($_GET['mx_lang'], 0, 2);
+       } else {
+               // Do nothing
+               $lang = "";
+       }
+
+       // Set default return value to default language from config
+       $ret = DEFAULT_LANG;
+
+       // Check GET variable and cookie
+       if (!empty($lang)) {
+               // Check if main language file does exist
+               if (FILE_READABLE(PATH."inc/language/".$lang.".php")) {
+                       // Okay found, so let's update cookies
+                       SET_LANGUAGE($lang);
+               }
+       } elseif (!isSessionVariableSet('mx_lang')) {
+               // Return stored value from cookie
+               $ret = get_session('mx_lang');
+
+               // Fixes a warning before the session has the mx_lang constant
+               if (empty($ret)) $ret = DEFAULT_LANG;
+       }
+       return $ret;
+}
+//
+function SET_LANGUAGE($lang) {
+       global $_CONFIG;
+
+       // Accept only first 2 chars!
+       $lang = substr(SQL_ESCAPE(strip_tags($lang)), 0, 2);
+
+       // Set cookie
+       set_session("mx_lang", $lang);
+}
+//
+function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
+       global $DATA, $_CONFIG, $REPLACER;
+
+       // Make sure all template names are lowercase!
+       $template = strtolower($template);
+
+       // Default "nickname" if extension is not installed
+       $nick = "---";
+
+       // Keept for backward-compatiblity (please replace these variables against our new {!CONST!} syntax!)
+       // No longer used: $MAIN_TITLE = MAIN_TITLE; $URL = URL; $WEBMASTER = WEBMASTER;
+
+       // Prepare IP number and User Agent
+       $REMOTE_ADDR     = GET_REMOTE_ADDR();
+       $HTTP_USER_AGENT = GET_USER_AGENT();
+
+       // Default admin
+       $ADMIN = MAIN_TITLE;
+
+       // Is the admin logged in?
+       if (IS_ADMIN()) {
+               // Load Admin data
+               $ADMIN = GET_ADMIN_EMAIL(get_session('admin_login'));
+       } // END - if
+
+       // Neutral email address is default
+       $email = WEBMASTER;
+
+       // Expiration in a nice output format
+       if ($_CONFIG['auto_purge'] == 0) {
+               // Will never expire!
+               $EXPIRATION = MAIL_WILL_NEVER_EXPIRE;
+       } elseif (function_exists('CREATE_FANCY_TIME')) {
+               // Create nice date string
+               $EXPIRATION = CREATE_FANCY_TIME($_CONFIG['auto_purge']);
+       } else {
+               // Display days only
+               $EXPIRATION = round($_CONFIG['auto_purge']/60/60/24)." "._DAYS;
+       }
+
+       // Is content an array?
+       if (is_array($content)) {
+               // Add expiration to array, $EXPIRATION is now deprecated!
+               $content['expiration'] = $EXPIRATION;
+       } // END - if
+
+       // Load user's data
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):UID={$UID},template={$template}<br />\n";
+       if ($UID > 0) {
+               if (EXT_IS_ACTIVE("nickname")) {
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\n";
+                       // Load nickname
+                       $result = SQL_QUERY_ESC("SELECT surname, family, gender, email, nickname FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                               array(bigintval($UID)), __FILE__, __LINE__);
+               } else {
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\n";
+                       /// Load normal data
+                       $result = SQL_QUERY_ESC("SELECT surname, family, gender, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                               array(bigintval($UID)), __FILE__, __LINE__);
+               }
+
+               // Is content an array?
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content[]=".gettype($content)."<br />\n";
+               if (is_array($content)) {
+                       // Fetch and migrate data
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - PRE<br />\n";
+                       $content = array_merge($content, SQL_FETCHARRAY($result));
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):content()=".count($content)." - AFTER<br />\n";
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Translate M to male or F to female if present
+       if (isset($content['gender'])) $content['gender'] = TRANSLATE_GENDER($content['gender']);
+
+       // Overwrite email from data if present
+       if (isset($content['email']))  $email = $content['email'];
+
+       // Store email for some functions in global data array
+       $DATA['email'] = $email;
+
+       // Base directory
+       $BASE = sprintf("%stemplates/%s/emails/", PATH, GET_LANGUAGE());
+
+       // Check for admin/guest/member templates
+       if (strpos($template, "admin_") > -1) {
+               // Admin template found
+               $file = $BASE."admin/".$template.".tpl";
+       } elseif (strpos($template, "guest_") > -1) {
+               // Guest template found
+               $file = $BASE."guest/".$template.".tpl";
+       } elseif (strpos($template, "member_") > -1) {
+               // Member template found
+               $file = $BASE."member/".$template.".tpl";
+       } else {
+               // Test for extension
+               $test = substr($template, 0, strpos($template, "_"));
+               if (EXT_IS_ACTIVE($test)) {
+                       // Set extra path to extension's name
+                       $file = $BASE.$test."/".$template.".tpl";
+               } else {
+                       // No special filename
+                       $file = $BASE.$template.".tpl";
+               }
+       }
+
+       // Does the special template exists?
+       if (!FILE_READABLE($file)) {
+               // Reset to default template
+               $file = $BASE.$template.".tpl";
+       } // END - if
+
+       // Now does the final template exists?
+       $newContent = "";
+       if (FILE_READABLE($file)) {
+               // The local file does exists so we load it. :)
+               $tmpl_file = implode("", file($file));
+               $tmpl_file = addslashes($tmpl_file);
+
+               // Run code
+               $tmpl_file = "\$newContent=html_entity_decode(\"".COMPILE_CODE($tmpl_file)."\");";
+               @eval($tmpl_file);
+       } elseif (!empty($template)) {
+               // Template file not found!
+               $newContent = TEMPLATE_404.": ".$template."<br />
+".TEMPLATE_CONTENT."
+<pre>".print_r($content, true)."</pre>
+".TEMPLATE_DATA."
+<pre>".print_r($DATA, true)."</pre>
+<br /><br />";
+
+               // Debug mode not active? Then remove the HTML tags
+               if (!DEBUG_MODE) $newContent = strip_tags($newContent);
+       } else {
+               // No template name supplied!
+               $newContent = NO_TEMPLATE_SUPPLIED;
+       }
+
+       // Is there some content?
+       if (empty($newContent)) {
+               // Compiling failed
+               $newContent = "Compiler error for template {$template}!\nUncompiled content:\n".$tmpl_file;
+               if (function_exists('error_get_last')) $newContent .= "\n--------------------------------------\nDebug:\n".print_r(error_get_last(), true)."--------------------------------------\nPlease don't alter these informations!\nThanx.";
+       } // END - if
+
+       // Return compiled content
+       return COMPILE_CODE($newContent);
+}
+//
+function MAKE_TIME($H, $M, $S, $stamp) {
+       // Extract day, month and year from given timestamp
+       $DAY   = date("d", $stamp);
+       $MONTH = date("m", $stamp);
+       $YEAR  = date('Y', $stamp);
+
+       // Create timestamp for wished time which depends on extracted date
+       return mktime($H, $M, $S, $MONTH, $DAY, $YEAR);
+}
+//
+function LOAD_URL($URL, $addUrlData=true) {
+       global $CSS, $_CONFIG, $footer;
+
+       // Check if http(s):// is there
+       if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
+               // Make all URLs full-qualified
+               $URL = URL."/".$URL;
+       }
+
+       // Compile out URI codes
+       $URL = COMPILE_CODE($URL);
+
+       // Get output buffer
+       $OUTPUT = ob_get_contents();
+
+       // Clear it only if there is content
+       if (!empty($OUTPUT)) {
+               ob_end_clean();
+       } // END - if
+
+       // Add some data to URL if cookies are not accepted
+       if (((!defined('__COOKIES')) || (!__COOKIES)) && ($addUrlData)) $URL = ADD_URL_DATA($URL);
+
+       // Probe for bot from search engine
+       if ((eregi("spider", GET_USER_AGENT())) || (eregi("bot", GET_USER_AGENT())) || (eregi("spider", GET_USER_AGENT()))) {
+               // Search engine bot detected so let's rewrite many chars for the link
+               $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
+
+               // Output new location link as anchor
+               OUTPUT_HTML("<A href=\"".$URL."\">".$URL."</A>");
+       } elseif (!headers_sent()) {
+               // Load URL when headers are not sent
+               /*
+               print("<pre>");
+               debug_print_backtrace();
+               die("</pre>URL={$URL}");
+               */
+               @header ("Location: ".str_replace("&amp;", "&", $URL));
+       } else {
+               // Output error message
+               include(PATH."inc/header.php");
+               LOAD_TEMPLATE("redirect_url", false, str_replace("&amp;", "&", $URL));
+               include(PATH."inc/footer.php");
+       }
+       exit();
+}
+//
+function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) {
+       global $SEC_CHARS, $URL_CHARS;
+       // Is the code a string?
+       if (!is_string($code)) {
+               // Abort here with backtrace
+               DEBUG_LOG(__FUNCTION__.": code is not string!");
+               print "<pre>";
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
+       $ARRAY = $SEC_CHARS;
+
+       // Select smaller set of chars to replace when we e.g. want to compile URLs
+       if (!$full) $ARRAY = $URL_CHARS;
+
+       // Compile constants
+       if ($constants) {
+               // BEFORE 0.2.1 : Language and data constants
+               // WITH 0.2.1+  : Only language constants
+               $code = str_replace('{--','".', str_replace('--}','."', $code));
+
+               // BEFORE 0.2.1 : Not used
+               // WITH 0.2.1+  : Data constants
+               $code = str_replace('{!','".', str_replace("!}", '."', $code));
+       } // END - if
+
+       // Compile QUOT and other non-HTML codes
+       foreach ($ARRAY['to'] as $k => $to) {
+               // Do the reversed thing as in inc/libs/security_functions.php
+               $code = str_replace($to, $ARRAY['from'][$k], $code);
+       } // END - foreach
+
+       // But shall I keep simple quotes for later use?
+       if ($simple) $code = str_replace("\'", '{QUOT}', $code);
+
+       // Find $content[bla][blub] entries
+       @preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
+
+       // Are some matches found?
+       if ((count($matches) > 0) && (count($matches[0]) > 0)) {
+               // Replace all matches
+               $matchesFound = array();
+               foreach ($matches[0] as $key => $match) {
+                       // Fuzzy look has failed by default
+                       $fuzzyFound = false;
+
+                       // Fuzzy look on match if already found
+                       foreach ($matchesFound as $found => $set) {
+                               // Get test part
+                               $test = substr($found, 0, strlen($match));
+
+                               // Does this entry exist?
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found={$found},match={$match},set={$set}<br />\n";
+                               if ($test == $match) {
+                                       // Match found!
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):fuzzyFound!<br />\n";
+                                       $fuzzyFound = true;
+                                       break;
+                               } // END - if
+                       } // END - foreach
+
+                       // Skip this entry?
+                       if ($fuzzyFound) continue;
+
+                       // Take all string elements
+                       if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key."_".$matches[4][$key]]))) {
+                               // Replace it in the code
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):key={$key},match={$match}<br />\n";
+                               $newMatch = str_replace("[".$matches[4][$key]."]", "['".$matches[4][$key]."']", $match);
+                               $code = str_replace($match, "\".".$newMatch.".\"", $code);
+                               $matchesFound[$key."_".$matches[4][$key]] = 1;
+                               $matchesFound[$match] = 1;
+                       } elseif (!isset($matchesFound[$match])) {
+                               // Not yet replaced!
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):match={$match}<br />\n";
+                               $code = str_replace($match, "\".".$match.".\"", $code);
+                               $matchesFound[$match] = 1;
+                       }
+               } // END - foreach
+       } // END - if
+
+       // Return compiled code
+       return $code;
+}
+//
+/************************************************************************
+ *                                                                      *
+ * Gaenderter Sortier-Algorythmus, $array wird nach dem Array (!)       *
+ * $a_sort sortiert:                                                    *
+ *                                                                      *
+ * $array - Das 3-dimensionale Array, das paralell sortiert werden soll *
+ * $a_sort - Array, das die Sortiereihenfolge der ersten Elementeben    *
+ * $primary_key - Prim.rschl.ssel aus $a_sort, nach dem sortiert wird   *
+ * $order - Sortiereihenfolge: -1 = A-Z, 0 = keine, 1 = Z-A             *
+ * $nums - true = Als Zahlen sortieren, false = Als Zeichen sortieren   *
+ *                                                                      *
+ * $a_sort muss Elemente enthalten, deren Wert Schluessel von $array    *
+ * sind... Klingt kompliziert, suchen Sie mal mein Beispiel, dann sehen *
+ * Sie, dass es doch nicht so schwer ist! :-)                           *
+ *                                                                      *
+ ************************************************************************/
+function array_pk_sort(&$array, $a_sort, $primary_key = 0, $order = -1, $nums = false)
+{
+       $dummy = $array;
+       while ($primary_key < count($a_sort)) {
+               foreach ($dummy[$a_sort[$primary_key]] as $key => $value) {
+                       foreach ($dummy[$a_sort[$primary_key]] as $key2 => $value2) {
+                               $match = false;
+                               if (!$nums) {
+                                       // Sort byte-by-byte (also numbers will be interpreted as chars! E.g.: "9" > "10")
+                                       if (($key != $key2) && (strcmp(strtolower($dummy[$a_sort[$primary_key]][$key]), strtolower($dummy[$a_sort[$primary_key]][$key2])) == $order)) $match = true;
+                               } elseif ($key != $key2) {
+                                       // Sort numbers (E.g.: 9 < 10)
+                                       if (($dummy[$a_sort[$primary_key]][$key] < $dummy[$a_sort[$primary_key]][$key2]) && ($order == -1)) $match = true;
+                                       if (($dummy[$a_sort[$primary_key]][$key] > $dummy[$a_sort[$primary_key]][$key2]) && ($order == 1))  $match = true;
+                               }
+
+                               if ($match) {
+                                       // We have found two different values, so let's sort whole array
+                                       foreach ($dummy as $sort_key => $sort_val) {
+                                               $t                       = $dummy[$sort_key][$key];
+                                               $dummy[$sort_key][$key]  = $dummy[$sort_key][$key2];
+                                               $dummy[$sort_key][$key2] = $t;
+                                               unset($t);
+                                       } // END - foreach
+                               } // END - if
+                       } // END - foreach
+               } // END - foreach
+
+               // Count one up
+               $primary_key++;
+       } // END - while
+
+       // Write back sorted array
+       $array = $dummy;
+}
+//
+function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
+{
+       global $MONTH_DESCR; $OUT = "";
+       if ($type == "yn")
+       {
+               // This is a yes/no selection only!
+               if ($id > 0) $prefix .= "[".$id."]";
+               $OUT .= "    <SELECT name=\"".$prefix."\" class=\"register_select\" size=\"1\">\n";
+       }
+        else
+       {
+               // Begin with regular selection box here
+               if (!empty($prefix)) $prefix .= "_";
+               $type2 = $type;
+               if ($id > 0) $type2 .= "[".$id."]";
+               $OUT .= "    <SELECT name=\"".strtolower($prefix.$type2)."\" class=\"register_select\" size=\"1\">\n";
+       }
+       switch ($type)
+       {
+       case "day": // Day
+               for ($idx = 1; $idx < 32; $idx++)
+               {
+                       $OUT .= "<OPTION value=\"".$idx."\"";
+                       if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
+                       $OUT .= ">".$idx."</OPTION>\n";
+               }
+               break;
+
+       case "month": // Month
+               foreach ($MONTH_DESCR as $month => $descr)
+               {
+                       $OUT .= "<OPTION value=\"".$month."\"";
+                       if ($DEFAULT == $month) $OUT .= " selected=\"selected\"";
+                       $OUT .= ">".$descr."</OPTION>\n";
+               }
+               break;
+
+       case "year": // Year
+               // Get current year
+               $YEAR = date('Y', time());
+
+               // Check if the default value is larger than minimum and bigger than actual year
+               if (($DEFAULT > 1930) && ($DEFAULT >= $YEAR))
+               {
+                       for ($idx = $YEAR; $idx < ($YEAR + 11); $idx++)
+                       {
+                               $OUT .= "<OPTION value=\"".$idx."\"";
+                               if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+               }
+                elseif ($DEFAULT == -1)
+               {
+                       // Current year minus 1
+                       for ($idx = 2003; $idx <= ($YEAR + 1); $idx++)
+                       {
+                               $OUT .= "<OPTION value=\"".$idx."\">".$idx."</OPTION>\n";
+                       }
+               }
+                else
+               {
+                       // Get current year and subtract 16 (for erotic content)
+                       $OUT .= "<OPTION value=\"1929\">&lt;1930</OPTION>\n";
+                       $YEAR = date('Y', time()) - 16;
+                       for ($idx = 1930; $idx <= $YEAR; $idx++)
+                       {
+                               $OUT .= "<OPTION value=\"".$idx."\"";
+                               if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+               }
+               break;
+
+       case "sec":
+       case "min":
+               for ($idx = 0; $idx < 60; $idx+=5) {
+                       if (strlen($idx) == 1) $idx = "0".$idx;
+                       $OUT .= "<OPTION value=\"".$idx."\"";
+                       if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
+                       $OUT .= ">".$idx."</OPTION>\n";
+               }
+               break;
+
+       case "hour":
+               for ($idx = 0; $idx < 24; $idx++) {
+                       if (strlen($idx) == 1) $idx = "0".$idx;
+                       $OUT .= "<OPTION value=\"".$idx."\"";
+                       if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
+                       $OUT .= ">".$idx."</OPTION>\n";
+               }
+               break;
+
+       case "yn":
+               $OUT .= "<OPTION value=\"Y\"";
+               if ($DEFAULT == "Y") $OUT .= " selected=\"selected\"";
+               $OUT .= ">".YES."</OPTION>\n<OPTION value=\"N\"";
+               if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
+               $OUT .= ">".NO."</OPTION>\n";
+               break;
+       }
+       $OUT .= "    </SELECT>\n";
+       return $OUT;
+}
+//
+function TRANSLATE_YESNO($yn)
+{
+       switch ($yn)
+       {
+               case 'Y': $yn = YES; break;
+               case 'N': $yn = NO; break;
+               default : $yn = "??? (".$yn.")"; break;
+       }
+       return $yn;
+}
+//
+// Deprecated : $length
+// Optional   : $DATA
+//
+function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") {
+       global $_CONFIG;
+
+       // Fix missing _MAX constant
+       if (!defined('_MAX')) define('_MAX', 15235);
+
+       // Build server string
+       $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
+
+       // Build key string
+       $keys   = SITE_KEY.":".DATE_KEY;
+       if (isset($_CONFIG['secret_key']))  $keys .= ":".$_CONFIG['secret_key'];
+       if (isset($_CONFIG['file_hash']))   $keys .= ":".$_CONFIG['file_hash'];
+       $keys .= ":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime']));
+       if (isset($_CONFIG['master_salt'])) $keys .= ":".$_CONFIG['master_salt'];
+
+       // Build string from misc data
+       $data   = $code.":".$uid.":".$DATA;
+
+       // Add more additional data
+       if (isSessionVariableSet('u_hash'))                     $data .= ":".get_session('u_hash');
+       if (isset($GLOBALS['userid']))                          $data .= ":".$GLOBALS['userid'];
+       if (isSessionVariableSet('lifetime'))           $data .= ":".get_session('lifetime');
+       if (isSessionVariableSet('mxchange_theme'))     $data .= ":".get_session('mxchange_theme');
+       if (isSessionVariableSet('mx_lang'))            $data .= ":".GET_LANGUAGE();
+       if (isset($GLOBALS['refid']))                           $data .= ":".$GLOBALS['refid'];
+
+       // Calculate number for generating the code
+       $a = $code + _ADD - 1;
+
+       if (isset($_CONFIG['master_hash'])) {
+               // Generate hash with master salt from modula of number with the prime number and other data
+               $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']);
+
+               // Create number from hash
+               $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+       } else {
+               // Generate hash with "hash of site key" from modula of number with the prime number and other data
+               $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(SITE_KEY), 0, 8));
+
+               // Create number from hash
+               $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi();
+       }
+
+       // At least 10 numbers shall be secure enought!
+       $len = $_CONFIG['code_length'];
+       if ($len == 0) $len = $length;
+       if ($len == 0) $len = 10;
+
+       // Cut off requested counts of number
+       $return = substr(str_replace('.', "", $rcode), 0, $len);
+
+       // Done building code
+       return $return;
+}
+// Does only allow numbers
+function bigintval($num, $castValue = true) {
+       // Filter all numbers out
+       $ret = preg_replace("/[^0123456789]/", "", $num);
+
+       // Shall we cast?
+       if ($castValue) $ret = (double)$ret;
+
+       // Has the whole value changed?
+       if ("".$ret."" != "".$num."") {
+               // Log the values
+               DEBUG_LOG(__FUNCTION__.": num={$num},ret={$ret}");
+       } // END - if
+
+       // Return result
+       return $ret;
+}
+// Insert the code in $img_code into jpeg or PNG image
+function GENERATE_IMAGE($img_code, $header=true) {
+       global $_CONFIG;
+
+       if ((strlen($img_code) > 6) || (empty($img_code)) || ($_CONFIG['code_length'] == 0)) {
+               // Stop execution of function here because of over-sized code length
+               return;
+       } elseif (!$header) {
+               // Return in an HTML code code
+               return "<IMG src=\"".URL."/img.php?code=".$img_code."\">\n";
+       }
+
+       // Load image
+       $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), $_CONFIG['img_type']);
+       if (FILE_READABLE($img)) {
+               // Switch image type
+               switch ($_CONFIG['img_type'])
+               {
+               case "jpg":
+                       // Okay, load image and hide all errors
+                       $image = @imagecreatefromjpeg($img);
+                       break;
+
+               case "png":
+                       // Okay, load image and hide all errors
+                       $image = @imagecreatefrompng($img);
+                       break;
+               }
+       } else {
+               // Exit function here
+               return;
+       }
+
+       // Generate text color (red/green/blue; 0 = dark, 255 = bright)
+       $text_color = imagecolorallocate($image, 0, 0, 0);
+
+       // Insert code into image
+       imagestring($image, 5, 14, 2, $img_code, $text_color);
+
+       // Return to browser
+       header ("Content-Type: image/".$_CONFIG['img_type']);
+
+       // Output image with matching image factory
+       switch ($_CONFIG['img_type']) {
+               case "jpg": imagejpeg($image); break;
+               case "png": imagepng($image);  break;
+       }
+
+       // Remove image from memory
+       imagedestroy($image);
+}
+// Create selection box or array of splitted timestamp
+function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="center", $return_array=false) {
+       global $_CONFIG;
+
+       // Calculate 2-seconds timestamp
+       $stamp = round($timestamp / 2) * 2;
+
+       // Do we have a leap year?
+       $SWITCH = 0;
+       $TEST = date('Y', time()) / 4;
+       $M1 = date("m", time());
+       $M2 = date("m", (time() + $stamp));
+
+       // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
+       if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02"))  $SWITCH = $_CONFIG['one_day'];
+
+       // First of all years...
+       $Y = abs(floor($stamp / (31536000 + $SWITCH)));
+       // Next months...
+       $M = abs(floor($stamp / 2628000 - $Y * 12));
+       // Next weeks
+       $W = abs(floor($stamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7)));
+       // Next days...
+       $D = abs(floor($stamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7));
+       // Next hours...
+       $h = abs(floor($stamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24));
+       // Next minutes..
+       $m = abs(floor($stamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
+       // And at last seconds...
+       $s = abs(floor($stamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
+
+       // Is seconds zero and time is < 60 seconds?
+       if (($s == 0) && ($stamp < 60)) {
+               // Fix seconds
+               $s = round($timestamp);
+       } // END - if
+
+       //
+       // Now we convert them in seconds...
+       //
+       if ($return_array) {
+               // Just put all data in an array for later use
+               $OUT = array(
+                       'YEARS'   => $Y,
+                       'MONTHS'  => $M,
+                       'WEEKS'   => $W,
+                       'DAYS'    => $D,
+                       'HOURS'   => $h,
+                       'MINUTES' => $m,
+                       'SECONDS' => $s
+               );
+       } else {
+               // Generate table
+               $OUT  = "<DIV align=\"".$align."\">\n";
+               $OUT .= "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_table dashed\">\n";
+               $OUT .= "<TR>\n";
+
+               if (ereg('Y', $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._YEARS."</STRONG></TD>\n";
+               }
+
+               if (ereg("M", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MONTHS."</STRONG></TD>\n";
+               }
+
+               if (ereg("W", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._WEEKS."</STRONG></TD>\n";
+               }
+
+               if (ereg("D", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._DAYS."</STRONG></TD>\n";
+               }
+
+               if (ereg("h", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._HOURS."</STRONG></TD>\n";
+               }
+
+               if (ereg("m", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MINUTES."</STRONG></TD>\n";
+               }
+
+               if (ereg("s", $display) || (empty($display))) {
+                       $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._SECONDS."</STRONG></TD>\n";
+               }
+
+               $OUT .= "</TR>\n";
+               $OUT .= "<TR>\n";
+
+               if (ereg('Y', $display) || (empty($display))) {
+                       // Generate year selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 10; $idx++) {
+                               $OUT .= "    <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $Y) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ye\" value=\"0\">\n";
+               }
+
+               if (ereg("M", $display) || (empty($display))) {
+                       // Generate month selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mo\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 11; $idx++)
+                       {
+                                       $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $M) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mo\" value=\"0\">\n";
+               }
+
+               if (ereg("W", $display) || (empty($display))) {
+                       // Generate week selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_we\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 4; $idx++) {
+                               $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $W) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_we\" value=\"0\">\n";
+               }
+
+               if (ereg("D", $display) || (empty($display))) {
+                       // Generate day selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_da\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 31; $idx++) {
+                               $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $D) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_da\" value=\"0\">\n";
+               }
+
+               if (ereg("h", $display) || (empty($display))) {
+                       // Generate hour selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ho\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 23; $idx++)      {
+                               $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $h) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
+               }
+
+               if (ereg("m", $display) || (empty($display))) {
+                       // Generate minute selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 59; $idx++) {
+                               $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $m) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mi\" value=\"0\">\n";
+               }
+
+               if (ereg("s", $display) || (empty($display))) {
+                       // Generate second selection
+                       $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
+                       for ($idx = 0; $idx <= 45; $idx += 15) {
+                               $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
+                               if ($idx == $s) $OUT .= " selected default";
+                               $OUT .= ">".$idx."</OPTION>\n";
+                       }
+                       $OUT .= "  </SELECT></TD>\n";
+               } else {
+                       $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
+               }
+               $OUT .= "</TR>\n";
+               $OUT .= "</TABLE>\n";
+               $OUT .= "</DIV>\n";
+               // Return generated HTML code
+       }
+       return $OUT;
+}
+//
+function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
+       global $_CONFIG;
+       $ret = 0;
+
+       // Do we have a leap year?
+       $SWITCH = 0;
+       $TEST = date('Y', time()) / 4;
+       $M1   = date("m", time());
+       // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
+       if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02"))  $SWITCH = $_CONFIG['one_day'];
+       // First add years...
+       $ret += $POST[$prefix."_ye"] * (31536000 + $SWITCH);
+       // Next months...
+       $ret += $POST[$prefix."_mo"] * 2628000;
+       // Next weeks
+       $ret += $POST[$prefix."_we"] * 604800;
+       // Next days...
+       $ret += $POST[$prefix."_da"] * 86400;
+       // Next hours...
+       $ret += $POST[$prefix."_ho"] * 3600;
+       // Next minutes..
+       $ret += $POST[$prefix."_mi"] * 60;
+       // And at last seconds...
+       $ret += $POST[$prefix."_se"];
+       // Return calculated value
+       return $ret;
+}
+// Sends out mail to all administrators
+// IMPORTANT: Please use SEND_ADMIN_NOTIFCATION() for now!
+function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) {
+       // Trim template name
+       $template = trim($template);
+
+       // Load email template
+       $msg = LOAD_EMAIL_TEMPLATE($template, $content, $UID);
+
+       if (EXT_VERSION_IS_OLDER("admins", "0.4.0")) {
+               // Older version detected!
+               return SEND_ADMIN_EMAILS($subj, $msg);
+       } // END - if
+
+       // Check which admin shall receive this mail
+       $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY admin_id",
+        array($template), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Create new entry (to all admins)
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_mails (admin_id, mail_template) VALUES (0, '%s')",
+                array($template), __FILE__, __LINE__);
+       } else {
+               // Load admin IDs...
+               $aids = array();
+               while(list($aid) = SQL_FETCHROW($result)) {
+                       $aids[] = $aid;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // "implode" IDs and query string
+               $aid = implode(",", $aids);
+               if ($aid == "-1") {
+                       // Add line to userlog
+                       USERLOG_ADD_LINE($subj, $msg, $UID);
+                       return;
+               } elseif ($aid == "0") {
+                       // Select all email adresses
+                       $result = SQL_QUERY("SELECT email FROM "._MYSQL_PREFIX."_admins ORDER BY id", __FILE__, __LINE__);
+               } else {
+                       // If Admin-ID is not "to-all" select
+                       $result = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id IN (%s) ORDER BY id", array($aid), __FILE__, __LINE__);
+               }
+       }
+
+       // Load email addresses and send away
+       while (list($email) = SQL_FETCHROW($result)) {
+               SEND_EMAIL($email, $subj, $msg);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+//
+function CREATE_FANCY_TIME($stamp) {
+       // Get data array with years/months/weeks/days/...
+       $data = CREATE_TIME_SELECTIONS($stamp, "", "", "", true);
+       $ret = "";
+       foreach($data as $k => $v) {
+               if ($v > 0) {
+                       // Value is greater than 0 "eval" data to return string
+                       $eval = "\$ret .= \", \".\$v.\" \"._".strtoupper($k).";";
+                       eval($eval);
+                       break;
+               } // END - if
+       } // END - foreach
+
+       // Do we have something there?
+       if (strlen($ret) > 0) {
+               // Remove leading commata and space
+               $ret = substr($ret, 2);
+       } else {
+               // Zero seconds
+               $ret = "0 "._SECONDS;
+       }
+
+       // Return fancy time string
+       return $ret;
+}
+//
+function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) {
+       $SEP = ""; $TOP = "";
+       if (!$show_form) {
+               $TOP = " top2";
+               $SEP = "<TR><TD colspan=\"".$colspan."\" class=\"seperator\">&nbsp;</TD></TR>";
+       }
+
+       $NAV = "";
+       for ($page = 1; $page <= $PAGES; $page++) {
+               // Is the page currently selected or shall we generate a link to it?
+               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1"))) {
+                       // Is currently selected, so only highlight it
+                       $NAV .= "<STRONG>-";
+               } else {
+                       // Open anchor tag and add base URL
+                       $NAV .= "<A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&amp;page=".$page."&amp;offset=".$offset;
+
+                       // Add userid when we shall show all mails from a single member
+                       if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) $NAV .= "&amp;u_id=".bigintval($_GET['u_id']);
+
+                       // Close open anchor tag
+                       $NAV .= "\">";
+               }
+               $NAV .= $page;
+               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1"))) {
+                       // Is currently selected, so only highlight it
+                       $NAV .= "-</STRONG>";
+               } else {
+                       // Close anchor tag
+                       $NAV .= "</A>";
+               }
+
+               // Add seperator if we have not yet reached total pages
+               if ($page < $PAGES) $NAV .= "&nbsp;|&nbsp;";
+       }
+
+       // Define constants only once
+       if (!defined('__NAV_OUTPUT')) {
+               define('__NAV_OUTPUT' , $NAV);
+               define('__NAV_COLSPAN', $colspan);
+               define('__NAV_TOP'    , $TOP);
+               define('__NAV_SEP'    , $SEP);
+       }
+
+       // Load navigation template
+       $OUT = LOAD_TEMPLATE("admin_email_nav_row", true);
+
+       if ($return) {
+               // Return generated HTML-Code
+               return $OUT;
+       } else {
+               // Output HTML-Code
+               OUTPUT_HTML($OUT);
+       }
+}
+
+// Extract host from script name
+function EXTRACT_HOST (&$script) {
+       // Use default SERVER_URL by default... ;) So?
+       $url = SERVER_URL;
+
+       // Is this URL valid?
+       if (substr($script, 0, 7) == "http://") {
+               // Use the hostname from script URL as new hostname
+               $url = substr($script, 7);
+               $extract = explode("/", $url);
+               $url = $extract[0];
+               // Done extracting the URL :)
+       } // END - if
+
+       // Extract host name
+       $host = str_replace("http://", "", $url);
+       if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
+
+       // Generate relative URL
+       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
+       if (substr(strtolower($script), 0, 7) == "http://") {
+               // But only if http:// is in front!
+               $script = substr($script, (strlen($url) + 7));
+       } elseif (substr(strtolower($script), 0, 8) == "https://") {
+               // Does this work?!
+               $script = substr($script, (strlen($url) + 8));
+       }
+
+       //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
+       if (substr($script, 0, 1) == "/") $script = substr($script, 1);
+
+       // Return host name
+       return $host;
+}
+
+// Send a GET request
+function GET_URL ($script) {
+       // Compile the script name
+       $script = COMPILE_CODE($script);
+
+       // Extract host name from script
+       $host = EXTRACT_HOST($script);
+
+       // Generate GET request header
+       $request  = "GET /" . trim($script) . " HTTP/1.1\r\n";
+       $request .= "Host: " . $host . "\r\n";
+       $request .= "Referer: " . URL . "/admin.php\r\n";
+       $request .= "User-Agent: " . TITLE . "/" . FULL_VERSION . "\r\n";
+       $request .= "Content-Type: text/plain\r\n";
+       $request .= "Cache-Control: no-cache\r\n";
+       $request .= "Connection: Close\r\n\r\n";
+
+       // Send the raw request
+       $response = SEND_RAW_REQUEST($host, $request);
+
+       // Return the result to the caller function
+       return $response;
+}
+
+// Send a POST request
+function POST_URL ($script, $postData) {
+       // Is postData an array?
+       if (!is_array($postData)) {
+               // Abort here
+               return array("", "", "");
+       } // END - if
+
+       // Compile the script name
+       $script = COMPILE_CODE($script);
+
+       // Extract host name from script
+       $host = EXTRACT_HOST($script);
+
+       // Construct request
+       $data = http_build_query($postData, '','&');
+
+       // Generate POST request header
+       $request  = "POST /" . trim($script) . " HTTP/1.1\r\n";
+       $request .= "Host: " . $host . "\r\n";
+       $request .= "Referer: " . URL . "/admin.php\r\n";
+       $request .= "User-Agent: " . TITLE . "/" . FULL_VERSION . "\r\n";
+       $request .= "Content-type: application/x-www-form-urlencoded\r\n";
+       $request .= "Content-length: " . strlen($data) . "\r\n";
+       $request .= "Cache-Control: no-cache\r\n";
+       $request .= "Connection: Close\r\n\r\n";
+       $request .= $data;
+
+       // Send the raw request
+       $response = SEND_RAW_REQUEST($host, $request);
+
+       // Return the result to the caller function
+       return $response;
+}
+
+// Sends a raw request to another host
+function SEND_RAW_REQUEST ($host, $request) {
+       global $_CONFIG;
+
+       // Initialize array
+       $response = array("", "", "");
+
+       // Default is not to use proxy
+       $useProxy = false;
+
+       // Are proxy settins set?
+       if ((!empty($_CONFIG['proxy_host'])) && ($_CONFIG['proxy_port'] > 0)) {
+               // Then use it
+               $useProxy = true;
+       } // END - if
+
+       // Open connection
+       //* DEBUG: */ die("SCRIPT=".$script."<br />\n");
+       if ($useProxy) {
+               $fp = @fsockopen(COMPILE_CODE($_CONFIG['proxy_host']), $_CONFIG['proxy_port'], $errno, $errdesc, 30);
+       } else {
+               $fp = @fsockopen($host, 80, $errno, $errdesc, 30);
+       }
+
+       // Is there a link?
+       if (!is_resource($fp)) {
+               // Failed!
+               return $response;
+       } // END - if
+
+       // Do we use proxy?
+       if ($useProxy) {
+               // Generate CONNECT request header
+               $proxyTunnel  = "CONNECT ".$host.":80 HTTP/1.1\r\n";
+               $proxyTunnel .= "Host: ".$host."\r\n";
+
+               // Use login data to proxy? (username at least!)
+               if (!empty($_CONFIG['proxy_username'])) {
+                       // Add it as well
+                       $encodedAuth = base64_encode(COMPILE_CODE($_CONFIG['proxy_username']).":".COMPILE_CODE($_CONFIG['proxy_password']));
+                       $proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n";
+               } // END - if
+
+               // Add last new-line
+               $proxyTunnel .= "\r\n";
+               //* DEBUG: */ print("<strong>proxyTunnel=</strong><pre>".$proxyTunnel."</pre>");
+
+               // Write request
+               fputs($fp, $proxyTunnel);
+
+               // Got response?
+               if (feof($fp)) {
+                       // No response received
+                       return $response;
+               } // END - if
+
+               // Read the first line
+               $resp = trim(fgets($fp, 10240));
+               $respArray = explode(" ", $resp);
+               if ((strtolower($respArray[0]) !== "http/1.0") || ($respArray[1] != "200")) {
+                       // Invalid response!
+                       return $response;
+               } // END - if
+       } // END - if
+
+       // Write request
+       fputs($fp, $request);
+
+       // Read response
+       while(!feof($fp)) {
+               $response[] = trim(fgets($fp, 1024));
+       } // END - while
+
+       // Close socket
+       fclose($fp);
+
+       // Skip first empty lines
+       $resp = $response;
+       foreach ($resp as $idx => $line) {
+               // Trim space away
+               $line = trim($line);
+
+               // Is this line empty?
+               if (empty($line)) {
+                       // Then remove it
+                       array_shift($response);
+               } else {
+                       // Abort on first non-empty line
+                       break;
+               }
+       } // END - foreach
+
+       //* DEBUG: */ print("<strong>Response:</strong><pre>".print_r($response, true)."</pre>");
+
+       // Proxy agent found?
+       if ((substr(strtolower($response[0]), 0, 11) == "proxy-agent") && ($useProxy)) {
+               // Proxy header detected, so remove two lines
+               array_shift($response);
+               array_shift($response);
+       } // END - if
+
+       // Was the request successfull?
+       if ((!eregi("200 OK", $response[0])) || (empty($response[0]))) {
+               // Not found / access forbidden
+               $response = array("", "", "");
+       } // END - if
+
+       // Return response
+       return $response;
+}
+// Taken from www.php.net eregi() user comments
+function VALIDATE_EMAIL($email) {
+       // Compile email
+       $email = COMPILE_CODE($email);
+
+       // Check first part of email address
+       $first = "[-a-z0-9!#$%&\'*+/=?^_<{|}~]+(\.[-a-zA-Z0-9!#$%&\'*+/=?^_<{|}~]+)*";
+
+       //  Check domain
+       $domain = "[a-z0-9-]+(\.[a-z0-9-]{2,5})+";
+
+       // Generate pattern
+       $regex = "^".$first."@".$domain."$";
+
+       // Return check result
+       return eregi($regex, $email);
+}
+// Function taken from user comments on www.php.net / function eregi()
+function VALIDATE_URL ($URL, $compile=true) {
+       // Trim URL a little
+       $URL = trim(urldecode($URL));
+       //* DEBUG: */ echo $URL."<br />";
+
+       // Compile some chars out...
+       if ($compile) $URL = COMPILE_CODE($URL, false, false, false);
+       //* DEBUG: */ echo $URL."<br />";
+
+       // Check for the extension filter
+       if (EXT_IS_ACTIVE("filter")) {
+               // Use the extension's filter set
+               return FILTER_VALIDATE_URL($URL, false);
+       }
+
+       // If not installed, perform a simple test. Just make it sure there is always a http:// or
+       // https:// in front of the URLs
+       return (((substr($URL, 0, 7) == "http://") || (substr($URL, 0, 8) == "https://")) && (strlen($URL) >= 12));
+}
+//
+function MEMBER_ACTION_LINKS($uid, $status="") {
+       // Define all main targets
+       $TARGETS = array("del_user", "edit_user", "lock_user", "add_points", "sub_points");
+
+       // Begin of navigation links
+       $eval = "\$OUT = \"[&nbsp;";
+
+       foreach ($TARGETS as $tar) {
+               $eval .= "<SPAN class=\\\"admin_user_link\\\"><A href=\\\"".URL."/modules.php?module=admin&amp;what=".$tar."&amp;u_id=".$uid."\\\" title=\\\"\".ADMIN_LINK_";
+               //* DEBUG: */ echo "*".$tar."/".$status."*<br />\n";
+               if (($tar == "lock_user") && ($status == "LOCKED")) {
+                       // Locked accounts shall be unlocked
+                       $eval .= "UNLOCK_USER";
+               } else {
+                       // All other status is fine
+                       $eval .= strtoupper($tar);
+               }
+               $eval .= "_TITLE.\"\\\">\".ADMIN_";
+               if (($tar == "lock_user") && ($status == "LOCKED")) {
+                       // Locked accounts shall be unlocked
+                       $eval .= "UNLOCK_USER";
+               } else {
+                       // All other status is fine
+                       $eval .= strtoupper($tar);
+               }
+               $eval .= ".\"</A></SPAN>&nbsp;|&nbsp;";
+       }
+
+       // Finish navigation link
+       $eval = substr($eval, 0, -7)."]\";";
+       eval($eval);
+
+       // Return string
+       return $OUT;
+}
+// Function for backward-compatiblity
+function ADD_CATEGORY_TABLE ($MODE, $return=false) {
+       // Load it from the register extension
+       return REGISTER_ADD_CATEGORY_TABLE ($MODE, $return);
+}
+// Generate an email link
+function CREATE_EMAIL_LINK($email, $table="admins") {
+       // Default email link (INSECURE! Spammer can read this by harvester programs)
+       $EMAIL = "mailto:".$email;
+
+       // Check for several extensions
+       if ((EXT_IS_ACTIVE("admins")) && ($table == "admins")) {
+               // Create email link for contacting admin in guest area
+               $EMAIL = ADMINS_CREATE_EMAIL_LINK($email);
+       } elseif ((EXT_IS_ACTIVE("user")) && (GET_EXT_VERSION("user") >= "0.3.3") && ($table == "user_data")) {
+               // Create email link for contacting a member within admin area (or later in other areas, too?)
+               $EMAIL = USER_CREATE_EMAIL_LINK($email);
+       } elseif ((EXT_IS_ACTIVE("sponsor")) && ($table == "sponsor_data")) {
+               // Create email link to contact sponsor within admin area (or like the link above?)
+               $EMAIL = SPONSOR_CREATE_EMAIL_LINK($email);
+       }
+
+       // Shall I close the link when there is no admin?
+       if ((!IS_ADMIN()) && ($EMAIL == $email)) $EMAIL = "#"; // Closed!
+
+       // Return email link
+       return $EMAIL;
+}
+// Generate a hash for extra-security for all passwords
+function generateHash ($plainText, $salt = "") {
+       global $_CONFIG, $_SERVER;
+
+       // Is the required extension "sql_patches" there and a salt is not given?
+       if (((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (!EXT_IS_ACTIVE("sql_patches"))) && (empty($salt))) {
+               // Extension sql_patches is missing/outdated so we return the plain text
+               return $plainText;
+       } // END - if
+
+       // Do we miss an arry element here?
+       if (!isset($_CONFIG['file_hash'])) {
+               // Stop here
+               print("Missing file_hash in ".__FUNCTION__.". Backtrace:<pre>");
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
+       // When the salt is empty build a new one, else use the first x configured characters as the salt
+       if (empty($salt)) {
+               // Build server string
+               $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
+
+               // Build key string
+               $keys   = SITE_KEY.":".DATE_KEY.":".$_CONFIG['secret_key'].":".$_CONFIG['file_hash'].":".date("d-m-Y (l-F-T)", bigintval($_CONFIG['patch_ctime'])).":".$_CONFIG['master_salt'];
+
+               // Additional data
+               $data = $plainText.":".uniqid(rand(), true).":".time();
+
+               // Calculate number for generating the code
+               $a = time() + _ADD - 1;
+
+               // Generate SHA1 sum from modula of number and the prime number
+               $sha1 = sha1(($a % _PRIME).$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a);
+               //* DEBUG: */ echo "SHA1=".$sha1." (".strlen($sha1).")<br />";
+               $sha1 = scrambleString($sha1);
+               //* DEBUG: */ echo "Scrambled=".$sha1." (".strlen($sha1).")<br />";
+               //* DEBUG: */ $sha1b = descrambleString($sha1);
+               //* DEBUG: */ echo "Descrambled=".$sha1b." (".strlen($sha1b).")<br />";
+
+               // Generate the password salt string
+               $salt = substr($sha1, 0, $_CONFIG['salt_length']);
+               //* DEBUG: */ echo $salt." (".strlen($salt).")<br />";
+       } else {
+               // Use given salt
+               $salt = substr($salt, 0, $_CONFIG['salt_length']);
+               //* DEBUG: */ echo "GIVEN={$salt}<br />\n";
+       }
+
+       // Return hash
+       return $salt.sha1($salt.$plainText);
+}
+//
+function scrambleString($str) {
+       global $_CONFIG;
+
+       // Init
+       $scrambled = "";
+
+       // Final check, in case of failture it will return unscrambled string
+       if (strlen($str) > 40) {
+               // The string is to long
+               return $str;
+       } elseif (strlen($str) == 40) {
+               // From database
+               $scrambleNums = explode(":", $_CONFIG['pass_scramble']);
+       } else {
+               // Generate new numbers
+               $scrambleNums = explode(":", genScrambleString(strlen($str)));
+       }
+
+       // Scramble string here
+       //* DEBUG: */ echo "***Original=".$str."***<br />";
+       for ($idx = 0; $idx < strlen($str); $idx++) {
+               // Get char on scrambled position
+               $char = substr($str, $scrambleNums[$idx], 1);
+
+               // Add it to final output string
+               $scrambled .= $char;
+       } // END - for
+
+       // Return scrambled string
+       //* DEBUG: */ echo "***Scrambled=".$scrambled."***<br />";
+       return $scrambled;
+}
+//
+function descrambleString($str) {
+       global $_CONFIG;
+       // Scramble only 40 chars long strings
+       if (strlen($str) != 40) return $str;
+
+       // Load numbers from config
+       $scrambleNums = explode(":", $_CONFIG['pass_scramble']);
+
+       // Validate numbers
+       if (count($scrambleNums) != 40) return $str;
+
+       // Begin descrambling
+       $orig = str_repeat(" ", 40);
+       //* DEBUG: */ echo "+++Scrambled=".$str."+++<br />";
+       for ($idx = 0; $idx < 40; $idx++) {
+               $char = substr($str, $idx, 1);
+               $orig = substr_replace($orig, $char, $scrambleNums[$idx], 1);
+       } // END - for
+
+       // Return scrambled string
+       //* DEBUG: */ echo "+++Original=".$orig."+++<br />";
+       return $orig;
+}
+//
+function genScrambleString($len) {
+       // Prepare randomizer and array for the numbers
+       mt_srand((double) microtime() * 1000000);
+       $scrambleNumbers = array();
+
+       // First we need to setup randomized numbers from 0 to 31
+       for ($idx = 0; $idx < $len; $idx++) {
+               // Generate number
+               $rand = mt_rand(0, ($len -1));
+
+               // Check for it by creating more numbers
+               while (array_key_exists($rand, $scrambleNumbers)) {
+                       $rand = mt_rand(0, ($len -1));
+               } // END - while
+
+               // Add number
+               $scrambleNumbers[$rand] = $rand;
+       } // END - for
+
+       // So let's create the string for storing it in database
+       $scrambleString = implode(":", $scrambleNumbers);
+       return $scrambleString;
+}
+// Append data like session ID referral ID to the given URL which would
+// normally be stored in cookies
+function ADD_URL_DATA($URL) {
+       global $_CONFIG;
+       $ADD = "";
+
+       // Determine URL binder
+       $BIND = "?";
+       if (strpos($URL, "?") !== false) $BIND = "&";
+
+       if ((!defined('__COOKIES')) || ((!__COOKIES))) {
+               // Cookies are not accepted
+               if ((!empty($_GET['refid'])) && (strpos($URL, "refid=") == 0)) {
+                       // Cookie found in URL
+                       $ADD .= $BIND."refid=".bigintval($_GET['refid']);
+               } elseif ((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['def_refid'] > 0)) {
+                       // Not found! So let's set default here
+                       $ADD .= $BIND."refid=".$_CONFIG['def_refid'];
+               }
+
+               // Is there already added data? Then change the binder
+               if (!empty($ADD)) $BIND = "&";
+
+               // Add session ID
+               if ((!empty($_GET['PHPSESSID'])) && (strpos($URL, "PHPSESSID=") == 0)) {
+                       // Add session from URL
+                       $ADD .= $BIND."PHPSESSID=".SQL_ESCAPE(strip_tags($_GET['PHPSESSID']));
+               } else {
+                       // Add current session
+                       $ADD .= $BIND."PHPSESSID=".session_id();
+               }
+       } // END - if
+
+       // Add all together and return it
+       return $URL.$ADD;
+}
+// Generate an PGP-like encrypted hash of given hash for e.g. cookies
+function generatePassString($passHash) {
+       global $_CONFIG;
+
+       // Return vanilla password hash
+       $ret = $passHash;
+
+       // Is a secret key and master salt already initialized?
+       if ((!empty($_CONFIG['secret_key'])) && (!empty($_CONFIG['master_salt']))) {
+               // Only calculate when the secret key is generated
+               $newHash = ""; $start = 9;
+               for ($idx = 0; $idx < 10; $idx++) {
+                       $part1 = hexdec(substr($passHash, $start, 4));
+                       $part2 = hexdec(substr($_CONFIG['secret_key'], $start, 4));
+                       $mod = dechex($idx);
+                       if ($part1 > $part2) {
+                               $mod = dechex(sqrt(($part1 - $part2) * _PRIME / pi()));
+                       } elseif ($part2 > $part1) {
+                               $mod = dechex(sqrt(($part2 - $part1) * _PRIME / pi()));
+                       }
+                       $mod = substr(round($mod), 0, 4);
+                       $mod = str_repeat('0', 4-strlen($mod)).$mod;
+                       //* DEBUG: */ echo "*".$start."=".$mod."*<br />";
+                       $start += 4;
+                       $newHash .= $mod;
+               } // END - for
+
+               //* DEBUG: */ print($passHash."<br />".$newHash." (".strlen($newHash).")");
+               $ret = generateHash($newHash, $_CONFIG['master_salt']);
+               //* DEBUG: */ print($ret."<br />\n");
+       } else {
+               // Hash it simple
+               //* DEBUG: */ echo "--".$passHash."--<br />\n";
+               $ret = md5($passHash);
+               //* DEBUG: */ echo "++".$ret."++<br />\n";
+       }
+
+       // Return result
+       return $ret;
+}
+
+// Fix "deleted" cookies
+function FIX_DELETED_COOKIES ($cookies) {
+       // Is this an array with entries?
+       if ((is_array($cookies)) && (count($cookies) > 0)) {
+               // Then check all cookies if they are marked as deleted!
+               foreach ($cookies as $cookieName) {
+                       // Is the cookie set to "deleted"?
+                       if (get_session($cookieName) == "deleted") {
+                               set_session($cookieName, "");
+                       }
+               } // END - foreach
+       } // END - if
+}
+
+// Output error messages in a fasioned way and die...
+function mxchange_die ($msg) {
+       global $footer;
+
+       // Load the message template
+       LOAD_TEMPLATE("admin_settings_saved", false, $msg);
+
+       // Load footer
+       include(PATH."inc/footer.php");
+
+       // Exit explicitly
+       exit;
+}
+
+// Display parsing time and number of SQL queries in footer
+function DISPLAY_PARSING_TIME_FOOTER() {
+       global $startTime, $_CONFIG;
+       $endTime = microtime(true);
+
+       // Is the timer started?
+       if (!isset($GLOBALS['startTime'])) {
+               // Abort here
+               return false;
+       }
+
+       // "Explode" both times
+       $start = explode(" ", $GLOBALS['startTime']);
+       $end = explode(" ", $endTime);
+       $runTime = $end[0] - $start[0];
+       if ($runTime < 0) $runTime = 0;
+       $runTime = TRANSLATE_COMMA($runTime);
+
+       // Prepare output
+       $content = array(
+               'runtime'               => $runTime,
+               'numSQLs'               => ($_CONFIG['sql_count'] + 1),
+               'numTemplates'  => ($_CONFIG['num_templates'] + 1)
+       );
+
+       // Load the template
+       LOAD_TEMPLATE("show_timings", false, $content);
+}
+
+// Unset/set session variables
+function set_session ($var, $value) {
+       global $CSS;
+
+       // Abort in CSS mode here
+       if ($CSS == 1) return true;
+
+       // Trim value and session variable
+       $var = trim(SQL_ESCAPE($var)); $value = trim($value);
+
+       // Is the session variable set?
+       if (("".$value."" == "") && (isSessionVariableSet($var))) {
+               // Remove the session
+               //* DEBUG: */ echo "UNSET:".$var."=".get_session($var)."<br />\n";
+               unset($_SESSION[$var]);
+               return session_unregister($var);
+       } elseif (("".$value."" != '') && (!isSessionVariableSet($var))) {
+               // Set session
+               //* DEBUG: */ echo "SET:".$var."=".$value."<br />\n";
+               $_SESSION[$var] =  $value;
+               return session_register($var);
+       } elseif (!empty($value)) {
+               // Update session
+               //* DEBUG: */ echo "UPDATE:".$var."=".$value."<br />\n";
+               $_SESSION[$var] = $value;
+               return true;
+       }
+
+       // Ignored (but valid)
+       //* DEBUG: */ echo "IGNORED:".$var."=".$value."<br />\n";
+       return true;
+}
+
+// Check wether a boolean constant is set
+// Taken from user comments in PHP documentation for function constant()
+function isBooleanConstantAndTrue($constName) { // : Boolean
+       global $constCache;
+
+       // Failed by default
+       $res = false;
+
+       // In cache?
+       if (isset($constCache[$constName])) {
+               // Use cache
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-CACHE!<br />\n";
+               $res = $constCache[$constName];
+       } else {
+               // Check constant
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-RESOLVE!<br />\n";
+               if (defined($constName)) $res = (constant($constName) === true);
+
+               // Set cache
+               $constCache[$constName] = $res;
+       }
+       //* DEBUG: */ var_dump($res);
+
+       // Return value
+       return $res;
+}
+
+// Check wether a session variable is set
+function isSessionVariableSet($var) {
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):var={$var}<br />\n";
+       return (isset($_SESSION[$var]));
+}
+// Returns wether the value of the session variable or NULL if not set
+function get_session($var) {
+       global $cacheArray;
+
+       // Default is not found! ;-)
+       $value = null;
+
+       // Is the variable there or cached values?
+       if (isset($cacheArray['session'][$var])) {
+               // Get cached value (skips a lot SQL_ESCAPE() calles!
+               $value = $cacheArray['session'][$var];
+       } elseif (isSessionVariableSet($var)) {
+               // Then  get it secured!
+               $value = SQL_ESCAPE($_SESSION[$var]);
+
+               // Cache the value
+               $cacheArray['session'][$var] = $value;
+       } // END - if
+
+       // Return the value
+       return $value;
+}
+// Send notification to admin
+function SEND_ADMIN_NOTIFICATION($subject, $templateName, $content=array(), $uid="0") {
+       if (GET_EXT_VERSION("admins") >= "0.4.1") {
+               // Send new way
+               SEND_ADMIN_EMAILS_PRO($subject, $templateName, $content, $uid);
+       } else {
+               // Send outdated way
+               $msg = LOAD_EMAIL_TEMPLATE($templateName, $content, $uid);
+               SEND_ADMIN_EMAILS($subject, $msg);
+       }
+}
+// Destroy user session
+function destroy_user_session () {
+       // Remove all user data from session
+       return ((set_session("userid", "")) && (set_session("u_hash", "")) && (set_session("lifetime", "")));
+}
+// Merges an array together but only if both are arrays
+function merge_array ($array1, $array2) {
+       // Are both an array?
+       if ((is_array($array1)) && (is_array($array2))) {
+               // Merge all together
+               return array_merge($array1, $array2);
+       } elseif (is_array($array1)) {
+               // Return left array
+               return $array1;
+       }
+
+       // Something wired happened here...
+       print(__FUNCTION__.":<pre>");
+       debug_print_backtrace();
+       die("</pre>");
+}
+// Debug message logger
+function DEBUG_LOG ($message, $force=false) {
+       // Is debug mode enabled?
+       if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force)) {
+               // Log this message away
+               $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
+               fwrite($fp, date("d.m.Y|H:i:s", time())."|".strip_tags($message)."\n");
+               fclose($fp);
+       } // END - if
+}
+// Reads a directory with PHP files in and gets only files back
+function GET_DIR_AS_ARRAY ($baseDir, $prefix) {
+       $INCs = array();
+
+       // Open directory
+       $dirPointer = opendir($baseDir) or mxchange_die("Cannot read ".basename($baseDir)." path!");
+
+       // Read all entries
+       while ($baseFile = readdir($dirPointer)) {
+               // Load file only if extension is active
+               // Make full path
+               $file = $baseDir.$baseFile;
+
+               // Is this a valid reset file?
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}<br />\n";
+               if ((FILE_READABLE($file)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) {
+                       // Remove both for extension name
+                       $extName = substr($baseFile, strlen($prefix), -4);
+
+                       // Try to find it
+                       $extId = GET_EXT_ID($extName);
+
+                       // Is the extension valid and active?
+                       if (($extId > 0) && (EXT_IS_ACTIVE($extName))) {
+                               // Then add this file
+                               $INCs[] = $file;
+                       } elseif ($extId == 0) {
+                               // Add non-extension files as well
+                               $INCs[] = $file;
+                       }
+               } // END - if
+       } // END - while
+
+       // Close directory
+       closedir($dirPointer);
+
+       // Return array with include files
+       return $INCs;
+}
+// Load more reset scripts
+function RESET_ADD_INCLUDES () {
+       global $_CONFIG;
+
+       // Is the reset set or old sql_patches?
+       if ((!defined('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
+               // Then abort here
+               return array();
+       } // END - if
+
+       // Get more daily reset scripts
+       $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_");
+
+       // Create current week mark
+       $currWeek = date("W", time());
+
+       // Has it changed?
+       if ($_CONFIG['last_week'] != $currWeek) {
+               // Include weekly reset scripts
+               $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_"));
+
+               // Update config
+               UPDATE_CONFIG("last_week", $currWeek);
+       } // END - if
+
+       // Create current month mark
+       $currMonth = date("m", time());
+
+       // Has it changed?
+       if ($_CONFIG['last_month'] != $currMonth) {
+               // Include monthly reset scripts
+               $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_"));
+
+               // Update config
+               UPDATE_CONFIG("last_month", $currMonth);
+       } // END - if
+
+       // Return array
+       return $INC_POOL;
+}
+// Handle extra values
+function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
+       // Default is the value itself
+       $ret = $value;
+
+       // Do we have a special filter function?
+       if (!empty($filterFunction)) {
+               // Does the filter function exist?
+               if (function_exists($filterFunction)) {
+                       // Do we have extra parameters here?
+                       if (!empty($extraValue)) {
+                               // Put both parameters in one new array by default
+                               $args = array($value, $extraValue);
+
+                               // If we have an array simply use it and pre-extend it with our value
+                               if (is_array($extraValue)) {
+                                       // Make the new args array
+                                       $args = array_merge(array($value), $extraValue);
+                               } // END - if
+
+                               // Call the multi-parameter call-back
+                               $ret = call_user_func_array($filterFunction, $args);
+                       } else {
+                               // One parameter call
+                               $ret = call_user_func($filterFunction, $value);
+                       }
+               } // END - if
+       } // END - if
+
+       // Return the value
+       return $ret;
+}
+// Check if given FQFN is a readable file
+function FILE_READABLE($fqfn) {
+       // Check all...
+       return ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn)));
+}
+// Converts timestamp selections into a timestamp
+function CONVERT_SELECTIONS_TO_TIMESTAMP(&$POST, &$DATA, &$id, &$skip) {
+       // Init test variable
+       $TEST2 = "";
+
+       // Get last three chars
+       $TEST = substr($id, -3);
+
+       // Improved way of checking! :-)
+       if (in_array($TEST, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) {
+               // Found a multi-selection for timings?
+               $TEST = substr($id, 0, -3);
+               if ((isset($POST[$TEST."_ye"])) && (isset($POST[$TEST."_mo"])) && (isset($POST[$TEST."_we"])) && (isset($POST[$TEST."_da"])) && (isset($POST[$TEST."_ho"])) && (isset($POST[$TEST."_mi"])) && (isset($POST[$TEST."_se"])) && ($TEST != $TEST2)) {
+                       // Generate timestamp
+                       $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST);
+                       $DATA[] = "$TEST='".$POST[$TEST]."'";
+
+                       // Remove data from array
+                       foreach (array("ye", "mo", "we", "da", "ho", "mi", "se") as $rem) {
+                               unset($POST[$TEST."_".$rem]);
+                       } // END - foreach
+
+                       // Skip adding
+                       unset($id); $skip = true; $TEST2 = $TEST;
+               } // END - if
+       } else {
+               // Process this entry
+               $skip = false; $TEST2 = "";
+       }
+}
+// Reverts the german decimal comma into Computer decimal dot
+function REVERT_COMMA ($str) {
+       // Default float is not a float... ;-)
+       $float = false;
+
+       // Which language is selected?
+       switch (GET_LANGUAGE()) {
+               case "de": // German language
+                       // Remove german thousand dots first
+                       $str = str_replace(".", "", $str);
+
+                       // Replace german commata with decimal dot and cast it
+                       $float = (float)str_replace(",", ".", $str);
+                       break;
+
+               default: // US and so on
+                       // Remove thousand dots first and cast
+                       $float = (float)str_replace(",", "", $str);
+                       break;
+       }
+
+       // Return float
+       return $float;
+}
+// Handle menu-depending failed logins and return the rendered content
+function HANDLE_LOGIN_FAILTURES ($accessLevel) {
+       // Default output is empty ;-)
+       $OUT = "";
+
+       // Is the session data set?
+       if ((isSessionVariableSet('mxchange_'.$accessLevel.'_failtures')) && (isSessionVariableSet('mxchange_'.$accessLevel.'_last_fail'))) {
+               // Ignore zero values
+               if (get_session('mxchange_'.$accessLevel.'_failtures') > 0) {
+                       // Non-guest has login failtures found, get both data and prepare it for template
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
+                       $content = array(
+                               'login_failtures' => get_session('mxchange_'.$accessLevel.'_failtures'),
+                               'last_failture'   => MAKE_DATETIME(get_session('mxchange_'.$accessLevel.'_last_fail'), "2")
+                       );
+
+                       // Load template
+                       $OUT = LOAD_TEMPLATE("login_failtures", true, $content);
+               } // END - if
+
+               // Reset session data
+               set_session('mxchange_'.$accessLevel.'_failtures', "");
+               set_session('mxchange_'.$accessLevel.'_last_fail', "");
+       } // END - if
+
+       // Return rendered content
+       return $OUT;
+}
+// Rebuild cache
+function REBUILD_CACHE ($cache, $inc="") {
+       global $cacheInstance, $_CONFIG, $CSS;
+
+       // Shall I remove the cache file?
+       if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) {
+               // Rebuild cache
+               if ($cacheInstance->cache_file($cache, true)) {
+                       // Destroy it
+                       $cacheInstance->cache_destroy();
+               } // END - if
+
+               // Include file given?
+               if (!empty($inc)) {
+                       // Construct FQFN
+                       $fqfn = sprintf("%sinc/loader/load_cache-%s.php", PATH, $inc);
+
+                       // Is the include there?
+                       if (FILE_READABLE($fqfn)) {
+                               // And rebuild it from scratch
+                               require($fqfn);
+                       } else {
+                               // Include not found!
+                               DEBUG_LOG(__FUNCTION__.":Include {$inc} not found. cache={$cache}");
+                       }
+               } // END - if
+       } // END - if
+}
+// Purge admin menu cache
+function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
+       global $_CONFIG, $cacheInstance;
+
+       // Is the cache extension enabled or no cache instance or admin menu cache disabled?
+       if (!EXT_IS_ACTIVE("cache")) {
+               // Cache extension not active
+               return false;
+       } elseif (!is_object($cacheInstance)) {
+               // No cache instance!
+               DEBUG_LOG(__FUNCTION__.": No cache instance found.");
+               return false;
+       } elseif ((!isset($_CONFIG['cache_admin_menu'])) || ($_CONFIG['cache_admin_menu'] == "N")) {
+               // Caching disabled (currently experiemental!)
+               return false;
+       }
+
+       // Experiemental feature!
+       trigger_error("You have to delete the admin_*.cache files by yourself at this point.");
+}
+// Translates the "pool type" into human-readable
+function TRANSLATE_POOL_TYPE ($type) {
+       // Default type is unknown
+       $translated = sprintf(POOL_TYPE_UNKNOWN, $type);
+
+       // Generate constant
+       $constName = sprintf("POOL_TYPE_%s", $type);
+
+       // Does it exist?
+       if (defined($constName)) {
+               // Then use it
+               $translated = constant($constName);
+       } // END - if
+
+       // Return "translation"
+       return $translated;
+}
+// "Getter" for remote IP number
+function GET_REMOTE_ADDR () {
+       // Get remote ip from environment
+       $remoteAddr = getenv('REMOTE_ADDR');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE("removeip")) {
+               // Then anonymize it
+               $remoteAddr = GET_ANONYMOUS_REMOTE_ADDR($remoteAddr);
+       } // END - if
+
+       // Return it
+       return $remoteAddr;
+}
+// "Getter" for remote hostname
+function GET_REMOTE_HOST () {
+       // Get remote ip from environment
+       $remoteHost = getenv('REMOTE_HOST');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE("removeip")) {
+               // Then anonymize it
+               $remoteHost = GET_ANONYMOUS_REMOTE_HOST($remoteHost);
+       } // END - if
+
+       // Return it
+       return $remoteHost;
+}
+// "Getter" for user agent
+function GET_USER_AGENT () {
+       // Get remote ip from environment
+       $userAgent = getenv('HTTP_USER_AGENT');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE("removeip")) {
+               // Then anonymize it
+               $userAgent = GET_ANONYMOUS_USER_AGENT($userAgent);
+       } // END - if
+
+       // Return it
+       return $userAgent;
+}
+// "Getter" for referer
+function GET_REFERER () {
+       // Get remote ip from environment
+       $referer = getenv('HTTP_REFERER');
+
+       // Is removeip installed?
+       if (EXT_IS_ACTIVE("removeip")) {
+               // Then anonymize it
+               $referer = GET_ANONYMOUS_REFERER($referer);
+       } // END - if
+
+       // Return it
+       return $referer;
+}
+//
+//////////////////////////////////////////////////
+//                                              //
+// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
+//                                              //
+//////////////////////////////////////////////////
+//
+if (!function_exists('html_entity_decode')) {
+       // Taken from documentation on www.php.net
+       function html_entity_decode($string) {
+               $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+               $trans_tbl = array_flip($trans_tbl);
+               return strtr($string, $trans_tbl);
+       }
+} // END - if
+
+//
+?>
diff --git a/inc/gen_mediadata.php b/inc/gen_mediadata.php
new file mode 100644 (file)
index 0000000..66d5a4d
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/08/2005 *
+ * ===============                              Last change: 01/01/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : gen_mediadata.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Checks for existing mail orders                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Prueft bestehende Mailbuchungen                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check for normal mails
+$result_media = SQL_QUERY("SELECT SUM(max_rec) AS max_rec, SUM(clicks) AS clicks
+FROM "._MYSQL_PREFIX."_user_stats", __FILE__, __LINE__);
+list($nsent, $nclicks) = SQL_FETCHROW($result_media);
+if (empty($nsent))   $nsent   = 0;
+if (empty($nclicks)) $nclicks = 0;
+
+// Free memory
+SQL_FREERESULT($result_media);
+
+// Count mail orders
+$result_media = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_user_stats", __FILE__, __LINE__);
+list($ncount) = SQL_FETCHROW($result_media);
+SQL_FREERESULT($result_media);
+$result_media = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_bonus", __FILE__, __LINE__);
+list($bcount) = SQL_FETCHROW($result_media);
+SQL_FREERESULT($result_media);
+
+// Check for bonus extension
+if (EXT_IS_ACTIVE("bonus"))
+{
+       // Check for bonus mails
+       $result_media = SQL_QUERY("SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks
+FROM "._MYSQL_PREFIX."_bonus", __FILE__, __LINE__);
+       list($bsent, $bclicks) = SQL_FETCHROW($result_media);
+       if (empty($bsent))   $bsent   = 0;
+       if (empty($bclicks)) $bclicks = 0;
+}
+ else
+{
+       // Not found!
+       $bsent = 0; $bclicks = 0;
+}
+
+// Load (maybe) missing file
+require_once(PATH."inc/libs/mediadata_functions.php");
+
+// Insert info to database
+MEDIA_UPDATE_ENTRY(array("total_send"  , "normal_send")  , "init", $nsent);
+MEDIA_UPDATE_ENTRY(array("total_clicks", "normal_clicks"), "init", $nclicks);
+MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), "init", $ncount);
+MEDIA_UPDATE_ENTRY(array("total_send"  , "bonus_send" )  , "init", $bsent);
+MEDIA_UPDATE_ENTRY(array("total_clicks", "bonus_clicks") , "init", $bclicks);
+MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders") , "init", $bcount);
+
+// Aquire total used points
+$result = SQL_QUERY("SELECT SUM(used_points) AS used_points FROM "._MYSQL_PREFIX."_user_data", __FILE__, __LINE__);
+list($used) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// ... and total points
+$result = SQL_QUERY("SELECT SUM(points) AS points FROM "._MYSQL_PREFIX."_user_points", __FILE__, __LINE__);
+list($points) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// Update database
+MEDIA_UPDATE_ENTRY(array("total_points"), "init", ($points - $used));
+
+//
+?>
diff --git a/inc/gen_refback.php b/inc/gen_refback.php
new file mode 100644 (file)
index 0000000..be1a3a7
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/27/2008 *
+ * ===============                              Last change: 09/27/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : gen_refback.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Generate refback table including all refs        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Refback-Tabelle mit allen Refs generieren        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Make sure our functions are there
+require_once(PATH."inc/libs/refback_functions.php");
+
+// Sanity-check: Do we have ref level 0?
+$result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_refsystem WHERE level=0", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0) {
+       // Upgrade refsystem, ref-level 0 is silly here
+       SQL_QUERY("UPDATE "._MYSQL_PREFIX."_refsystem SET level=level+1", __FILE__, __LINE__);
+} // END - if
+
+// Free result
+SQL_FREERESULT($result);
+
+// Reset the table
+SQL_QUERY("TRUNCATE TABLE "._MYSQL_PREFIX."_user_refs", __FILE__, __LINE__);
+
+// Begin with all users in level one
+$result_direct = SQL_QUERY("SELECT u.userid
+FROM "._MYSQL_PREFIX."_user_data AS u
+WHERE u.refid=0
+ORDER BY u.userid ASC", __FILE__, __LINE__);
+
+// Do we have entries?
+if (SQL_NUMROWS($result_direct) > 0) {
+       global $cacheArray;
+
+       // When "walk" through all users
+       while (list($uid) = SQL_FETCHROW($result_direct)) {
+               // Init level
+               $cacheArray['back_level'] = 1;
+
+               // Update refback table
+               //* DEBUG: */ echo "uid={$uid}<br />\n";
+               UPDATE_REFBACK_TABLE($uid);
+       } // END - while
+} // END - if
+
+// Free result
+SQL_FREERESULT($result_direct);
+
+//
+?>
diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php
new file mode 100644 (file)
index 0000000..467e4b4
--- /dev/null
@@ -0,0 +1,110 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/08/2005 *
+ * ===============                              Last change: 01/01/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : gen_sql_patches.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Patch password system after upgrading            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Patcht das Passwort-System nach DB-Update        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check for version of sql_patches
+if (EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) return false;
+
+// Check if there is no scrambling string
+if (empty($_CONFIG['pass_scramble'])) {
+       // Generate 40 chars long scramble string
+       $scrambleString = genScrambleString(40);
+
+       // ... and store it there for future usage
+       UPDATE_CONFIG("pass_scramble", $scrambleString);
+
+       // Also remember it in config
+       $_CONFIG['pass_scramble'] = $scrambleString;
+       unset($scrambleString);
+}
+
+// Check if there is no master salt string
+if (empty($_CONFIG['master_salt'])) {
+       // Generate the master salt which is the first chars minus 40 chars of this random hash
+       // We do an extra scrambling here...
+       $masterSalt = scrambleString(substr(generateHash(GEN_PASS(rand(128, 256))), 0, -40));
+
+       // ... and store it there for future usage
+       UPDATE_CONFIG("master_salt", $masterSalt);
+
+       // Also remember it in config
+       $_CONFIG['master_salt'] = $masterSalt;
+       unset($masterSalt);
+}
+
+if (empty($_CONFIG['file_hash'])) {
+       // Create filename from hashed random string
+       $file_hash = generateHash(GEN_PASS(rand(128, 256)));
+       $file = sprintf("%sinc/.secret/.%s", PATH, $file_hash);
+
+       // File hash was never created
+       $fp = @fopen($file, 'w') or mxchange_die("Cannot write secret key file!");
+       if ($fp != false) {
+               // Could write to secret file! So let's generate the secret key...
+               // 1. Count of chars to be taken from back of the string
+               $nums = rand(40, 45);
+               // 2. Generate secret key from a randomized string
+               $secretKey = substr(generateHash(GEN_PASS(rand(128, 256))), -$nums);
+               // 3. Write the key to the file
+               fwrite($fp, $secretKey);
+               // 4. Close file
+               fclose($fp);
+
+               // Change access rights for more security
+               @chmod($file, 0644);
+
+               //* DEBUG: */ unlink($file);
+               //* DEBUG: */ $test = hexdec(get_session('u_hash')) / hexdec($secretKey);
+               //* DEBUG: */ $test = generateHash(str_replace('.', "", $test));
+               //* DEBUG: */ die("Secret-Key: ".$secretKey."<br />Cookie: ".get_session('u_hash')."<br />Test: ".$test);
+
+               // Write $file_hash to database
+               UPDATE_CONFIG("file_hash", $file_hash);
+
+               // Also update configuration
+               $_CONFIG['secret_key'] = $secretKey;
+               $_CONFIG['file_hash']  = $file_hash;
+
+               // And remove some variables
+               unset($secretKey);
+               unset($file_hash);
+       }
+}
+
+//
+?>
diff --git a/inc/header.php b/inc/header.php
new file mode 100644 (file)
index 0000000..fe18f73
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 11/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : header.php                                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Outputs header HTML code, will not when frameset *
+ *           is active                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gibt nur dann HTML-Code fuer den Kopf-Bereich    *
+ *           aus, wenn Frameset nicht aktiv ist                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Initialize variables
+if (!isset($header)) $header = 0;
+
+if (($header != "1") && ($header != "2")) {
+       // If not in CSS mode generate the header
+       if (($CSS != "1")) {
+               // Generate header
+               $TITLE = "";
+
+               // Add title decorations? (left)
+               if (!defined('__PAGE_TITLE')) {
+                       // Config and database connection valid?
+                       if ((isset($_CONFIG)) && (is_array($_CONFIG)) && (count($_CONFIG) > 1) && (is_resource($link)) && (isset($db))) {
+                               // Title decoration enabled?
+                               if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_left']))) $TITLE .= trim($_CONFIG['title_left'])." ";
+
+                               // Do we have some extra title?
+                               if (!empty($EXTRA_TITLE)) {
+                                       // Then prepent it
+                                       $TITLE .= $EXTRA_TITLE." by ";
+                               } // END - if
+
+                               // Add main title
+                               $TITLE .= MAIN_TITLE;
+
+                               // Add title of module? (middle decoration will also be added!)
+                               if (isset($_CONFIG['enable_mod_title'])) {
+                                       if (($_CONFIG['enable_mod_title'] == "Y") || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']);
+                               } // END - if
+
+                               // Add title from what file
+                               $MODE = "";
+                               if ($GLOBALS['module'] == "login") $MODE = "member";
+                                elseif ($GLOBALS['module'] == "index") $MODE = "guest";
+                               if ((!empty($MODE)) && (isset($_CONFIG['enable_what_title'])) && ($_CONFIG['enable_what_title'] == "Y")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".GET_MOD_DESCR($MODE, $GLOBALS['what']);
+
+                               // Add title decorations? (right)
+                               if (($_CONFIG['enable_title_deco'] == "Y") && (!empty($_CONFIG['title_right']))) $TITLE .= " ".trim($_CONFIG['title_right']);
+
+                               // Remember title in constant for the template
+                               define('__PAGE_TITLE', html_entity_decode($TITLE));
+                       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+                               // Load language file because it was missing in installation finalizer step... *sigh*
+                               require_once(sprintf("%sinc/language/install_%s.php",
+                                       PATH,
+                                       GET_LANGUAGE()
+                               ));
+
+                               // Installation mode
+                               define('__PAGE_TITLE', INSTALLATION_OF_MXCHANGE);
+                       } else {
+                               // Configuration not found!
+                               define('__PAGE_TITLE', NO_CONFIG_FOUND_TITLE);
+
+                               // Do not add the fatal message in installation mode
+                               if (basename($_SERVER['PHP_SELF']) != "install.php") ADD_FATAL(NO_CONFIG_FOUND);
+                       }
+               }
+
+               // Save some little memory
+               unset($TITLE);
+
+               // Output page header code
+               LOAD_TEMPLATE("page_header");
+
+               // Include meta data in "guest" module
+               if ($GLOBALS['module'] == "index") {
+                       LOAD_TEMPLATE("metadata");
+
+                       // Add meta description to header
+                       if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (isset($db)) && (is_resource($link))) {
+                               // Add meta description not in admin and login module and when the script is installed
+                               META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']);
+                       } // END - if
+               } // END - if
+
+               // Include more header data here
+               LOAD_TEMPLATE("header");
+
+               // Include stylesheet
+               include (PATH."inc/stylesheet.php");
+       } // END - if
+
+       // Closing HEAD tag
+       if ($CSS != "1") OUTPUT_HTML("</head>");
+       $header = 1;
+} // END - if
+
+// Load body or not
+if (((!$isFrameset) && ($GLOBALS['module'] != "frametester")) || (($GLOBALS['module'] == "frametester") && (isset($_GET['frame']))) || (($header == "1") && ($isFrameset) && (!empty($_GET['frame']))) && ($CSS != "1")) {
+       // Is the header sent and the script is not the mail confirmation script and not a CSS?
+       if (($header == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($CSS != "1")) {
+               // Add BODY tag
+               LOAD_TEMPLATE("page_body");
+               $header = 2;
+       } // END - if
+} // END - if
+
+//
+?>
diff --git a/inc/install-inc.php b/inc/install-inc.php
new file mode 100644 (file)
index 0000000..552956e
--- /dev/null
@@ -0,0 +1,491 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/29/2003 *
+ * ===============                              Last change: 11/11/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : install-inc.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for installation procedure             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die Installationsroutine         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+/************************************************************************
+ *      YOU MAY ALSO WANT TO REMOVE THIS FILE AFTER INSTALLTION!        *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0) {
+       // Initialize all and count up the "seak" value
+       $done = false;
+       $next = -1;
+       $sneak++;
+
+       if (FILE_READABLE($file)) {
+               $search = "CFG: ".$comment;
+               $tmp = $file.".tmp";
+               $fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
+               if (is_resource($fp)) {
+                       $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<STRONG>WRITE:</STRONG> ".$tmp."<br />");
+                       if (is_resource($fp_tmp)) {
+                               while (!feof($fp)) {
+                                       $line = fgets ($fp, 10240);
+                                       //* DEBUG: */ echo $search."/<font color=\"red\">".htmlentities($line)."</font><br />\n";
+                                       $found = strpos($line, $search);
+                                       //* DEBUG: */ echo "FOUND: <font color=\"brown\">";
+                                       //* DEBUG: */ var_dump($found);
+                                       //* DEBUG: */ echo "</font><br />\n";
+                                       if ($found !== false) $next = 0;
+                                       if ($next > -1) {
+                                               if ($next == $sneak) {
+                                                       $next = -1;
+                                                       $line = $prefix.$DATA.$suffix."\n";
+                                                       //* DEBUG: */ echo "NEW: <font color=\"blue\">".htmlentities($line)."</font><br />\n";
+                                               } else {
+                                                       $next++;
+                                               }
+                                       }
+                                       //* DEBUG: */ echo "WRITE: <font color=\"green\">".htmlentities($line)."</font><br />\n";
+                                       fputs($fp_tmp, $line);
+                               }
+                               fclose($fp_tmp);
+
+                               // Finished writing tmp file
+                               $done = true;
+                       }
+
+                       // Close source directory
+                       fclose($fp);
+
+                       if (($done) && (is_writeable($file))) {
+                               // Copy back tmp file and delete tmp :-)
+                               @copy($tmp, $file);
+                               @unlink($tmp);
+                       } else {
+                               OUTPUT_HTML("<STRONG>TMP:</STRONG> UNDONE!");
+                       }
+               }
+       } else {
+               OUTPUT_HTML("<STRONG>404:</STRONG> ".$file."<br />");
+       }
+}
+
+//
+$mysql = "";
+if (isset($_POST['mysql']) && is_array($_POST['mysql'])) $mysql = $_POST['mysql'];
+
+if (URL != "http://your-server.com") {
+       // Already installed???
+       $burl = URL;
+} elseif (empty($burl)) {
+       // Auto-detect URL
+       $burl = "http://".$SERVER_NAME.$_SERVER['PHP_SELF'];
+       $burl = substr($burl, 0, strpos($burl, "install.php"));
+}
+
+// Check if both passwords from SMTP are matching
+if ((isset($_GET['page']) && ($_GET['page'] == 5))) {
+       // Okay, we have to check it
+       if (!empty($_POST['smtp_user']) && (empty($_POST['smtp_host']))) {
+               // Hostname not set
+               OUTPUT_HTML(INSTALL_SMTP_HOSTNAME_EMPTY."<br />");
+               $_GET['page'] = 3;
+       }
+       if ((empty($_POST['smtp_pass1'])) && (!empty($_POST['smtp_pass2']))) {
+               // Password is empty
+               OUTPUT_HTML(INSTALL_SMTP_PASS1_EMPTY."<br />");
+               $_GET['page'] = 3;
+       }
+       if ((!empty($_POST['smtp_pass1'])) && (empty($_POST['smtp_pass2']))) {
+               // Password repeat is empty
+               OUTPUT_HTML(INSTALL_SMTP_PASS2_EMPTY."<br />");
+               $_GET['page'] = 3;
+       }
+       if ($_POST['smtp_pass1'] != $_POST['smtp_pass1']) {
+               // Passwords are not matching
+               OUTPUT_HTML(INSTALL_SMTP_PASS_MISMATCH."<br />");
+               $_GET['page'] = 3;
+       }
+}
+
+// Is MXChange installed or no admin registered so far?
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
+{
+       // Set URL for FORM actions
+       define('__BURL_ACTION', $burl);
+
+       // Output page for entered value
+       switch ($_GET['page'])
+       {
+       case "welcome": // Welcome to the installation!
+               LOAD_TEMPLATE("install_welcome");
+               break;
+
+       case "1": // Server path, base URL
+               define('__PATH_LEN'     , strlen(PATH));
+               define('__BURL_LEN'     , strlen($burl));
+               define('__TITLE_LEN'    , strlen(MAIN_TITLE));
+               define('__SLOGAN_LEN'   , strlen(SLOGAN));
+               define('__WEBMASTER_LEN', (strlen(WEBMASTER) * 3));
+
+               // Load template
+               LOAD_TEMPLATE("install_page1");
+               break;
+
+       case "2": // MySQL data (alone!)
+               if (empty($mysql['dbase']))  $mysql['dbase']  = "your_database";
+               if (empty($mysql['login']))  $mysql['login']  = "your_login";
+               if (empty($mysql['host']))   $mysql['host']   = "localhost";
+               if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange_";
+               if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) {
+                       OUTPUT_HTML("<SPAN class=\"install_fatal\">");
+                       foreach ($FATAL as $key => $err) {
+                               OUTPUT_HTML("  <STRONG>&middot;</STRONG>&nbsp;".FATAL_NO.($key + 1).":&nbsp;".$err."<br />");
+                       }
+                       OUTPUT_HTML("</SPAN><br />");
+               }
+               define('__MYSQL_HOST'  , $mysql['host']);
+               define('__MYSQL_DBASE' , $mysql['dbase']);
+               define('__MYSQL_PREFIX', $mysql['prefix']);
+               define('__MYSQL_LOGIN' , $mysql['login']);
+               define('__SPATH_VALUE' , $_POST['spath']);
+               define('__BURL_VALUE'  , $_POST['burl']);
+               define('__TITLE_VALUE' , $_POST['title']);
+               define('__SLOGAN_VALUE', $_POST['slogan']);
+               define('__EMAIL_VALUE' , $_POST['email']);
+
+               // Load template
+               LOAD_TEMPLATE("install_page2");
+               break;
+
+       case "3":
+               // Set more values
+               define('__SPATH_VALUE'  , $_POST['spath']);
+               define('__BURL_VALUE'   , $_POST['burl']);
+               define('__TITLE_VALUE'  , $_POST['title']);
+               define('__SLOGAN_VALUE' , $_POST['slogan']);
+               define('__EMAIL_VALUE'  , $_POST['email']);
+
+               // Use default SMTP data
+               $smtpHost  = SMTP_HOSTNAME;
+               $smtpUser  = SMTP_USER;
+               $smtpPass1 = SMTP_PASSWORD;
+               $smtpPass2 = SMTP_PASSWORD;
+
+               // Overwrite it with the data from sent (failed) form
+               if (!empty($_POST['smtp_host'])) $smtpHost = $_POST['smtp_host'];
+               if (!empty($_POST['smtp_user'])) $smtpUser = $_POST['smtp_user'];
+
+               // MySQL settings
+               define('__MYSQL_HOST'   , $mysql['host']);
+               define('__MYSQL_DBASE'  , $mysql['dbase']);
+               define('__MYSQL_PREFIX' , $mysql['prefix']);
+               define('__MYSQL_LOGIN'  , $mysql['login']);
+               define('__MYSQL_PASS1'  , $mysql['pass1']);
+               define('__MYSQL_PASS2'  , $mysql['pass2']);
+
+               // Set constants for SMTP data
+               define('__SMTP_HOST'    , $smtpHost);
+               define('__SMTP_USER'    , $smtpUser);
+               define('__SMTP_PASS1'   , $smtpPass1);
+               define('__SMTP_PASS2'   , $smtpPass2);
+
+               // Load template
+               LOAD_TEMPLATE("install_page3");
+               break;
+
+       case "5": // Misc settings
+               // General settings
+               define('__SPATH_VALUE'  , $_POST['spath']);
+               define('__BURL_VALUE'   , $_POST['burl']);
+               define('__TITLE_VALUE'  , $_POST['title']);
+               define('__SLOGAN_VALUE' , $_POST['slogan']);
+               define('__EMAIL_VALUE'  , $_POST['email']);
+
+               // MySQL settings
+               define('__MYSQL_HOST'   , $mysql['host']);
+               define('__MYSQL_DBASE'  , $mysql['dbase']);
+               define('__MYSQL_PREFIX' , $mysql['prefix']);
+               define('__MYSQL_LOGIN'  , $mysql['login']);
+
+               // SMTP settings
+               define('__SMTP_HOST'    , $_POST['smtp_host']);
+               define('__SMTP_USER'    , $_POST['smtp_user']);
+               define('__SMTP_PASS'    , $_POST['smtp_pass1']);
+               OUTPUT_HTML("<FORM action=\"".__BURL_ACTION."/install.php?page=finalize\" method=\"POST\" target=\"_self\">
+<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"install_content\">
+<TR>
+  <TD colspan=\"2\" align=\"center\">
+    <STRONG class=\"install\">".HEADER_TEXT_PAGE5."</STRONG>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD colspan=\"2\"><SPAN class=\"install_intro\">
+    ".TEXT_PAGE_5."
+  </SPAN></TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD class=\"install\" align=\"right\">".LANG_OUTPUT_MODE.":&nbsp;&nbsp;</TD>
+  <TD>
+    <SELECT name=\"omode\" size=\"1\" class=\"install_select\">
+      <OPTION value=\"render\"");
+               if (OUTPUT_MODE == "render") OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".MODE_RENDER."</OPTION>
+      <OPTION value=\"direct\"");
+               if (OUTPUT_MODE == "direct") OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".MODE_DIRECT."</OPTION>
+    </SELECT>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"10\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD class=\"install\" align=\"right\">".WARN_NO_PASSWORD.":&nbsp;&nbsp;</TD>
+  <TD>
+    <SELECT name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
+      <OPTION value=\"true\"");
+               if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".YES."</OPTION>
+      <OPTION value=\"false\"");
+               if (!defined('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".NO."</OPTION>
+    </SELECT>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"10\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD class=\"install\" align=\"right\">".LANG_WRITE_FOOTER.":&nbsp;&nbsp;</TD>
+  <TD>
+    <SELECT name=\"wfooter\" size=\"1\" class=\"install_select\">
+      <OPTION value=\"true\"");
+               if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".YES."</OPTION>
+      <OPTION value=\"false\"");
+               if (!defined('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".NO."</OPTION>
+    </SELECT>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"10\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD class=\"install\" align=\"right\">".INSTALL_ENABLE_BACKLINK.":&nbsp;&nbsp;</TD>
+  <TD>
+    <SELECT name=\"blink\" size=\"1\" class=\"install_select\">
+      <OPTION value=\"true\"");
+               if (ENABLE_BACKLINK) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".YES."</OPTION>
+      <OPTION value=\"false\"");
+               if (!ENABLE_BACKLINK) OUTPUT_HTML(" selected=\"selected\"");
+               OUTPUT_HTML(">".NO."</OPTION>
+    </SELECT>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD colspan=\"2\" align=\"center\">");
+               foreach ($mysql as $key => $value) {
+                       OUTPUT_HTML("    <INPUT type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\">");
+               }
+               OUTPUT_HTML("    <INPUT type=\"hidden\" name=\"spath\" value=\"".__SPATH_VALUE."\">
+    <INPUT type=\"hidden\" name=\"burl\" value=\"".__BURL_VALUE."\">
+    <INPUT type=\"hidden\" name=\"title\" value=\"".__TITLE_VALUE."\">
+    <INPUT type=\"hidden\" name=\"slogan\" value=\"".__SLOGAN_VALUE."\">
+    <INPUT type=\"hidden\" name=\"email\" value=\"".__EMAIL_VALUE."\">
+    <INPUT type=\"hidden\" name=\"smtp_host\" value=\"".__SMTP_HOST."\">
+    <INPUT type=\"hidden\" name=\"smtp_user\" value=\"".__SMTP_USER."\">
+    <INPUT type=\"hidden\" name=\"smtp_pass\" value=\"".__SMTP_PASS."\">
+    <INPUT type=\"submit\" class=\"admin_submit submit\" name=\"finalize\" value=\"".NEXT_PAGE."\" class=\"install_submit\">
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\">&nbsp;</TD></TR>
+</TABLE>
+</FORM>");
+               break;
+
+       case "finalize": // Write captured data to files
+               if ((!empty($_POST['finalize'])) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
+                       // You have submitted data then we have to reset the fatal messages
+                       $FATAL = array(); $SQLs = array();
+
+                       // Connect to MySQL server
+                       $link = SQL_CONNECT($mysql['host'], $mysql['login'], $mysql['pass1'], __FILE__, __LINE__);
+                       if ($link) {
+                               // Seems to work, also right database?
+                               $db = SQL_SELECT_DB($mysql['dbase'], $link, __FILE__, __LINE__);
+                               if ($db) {
+                                       // Automatically run install.sql
+                                       if ((FILE_READABLE($_POST['spath']."install/tables.sql")) && (FILE_READABLE($_POST['spath']."install/menu-".GET_LANGUAGE().".sql"))) {
+                                               // Both exists so import them
+                                               foreach (array("tables.sql", "menu-".GET_LANGUAGE().".sql") as $dump) {
+                                                       // Should be save here because file_exists() is there but we check it again. :)
+                                                       $file = secureString($_POST['spath']) . "install/" . $dump;
+                                                       if (FILE_READABLE($file)) {
+                                                               // Load the file
+                                                               $sql = implode("", file($file));
+
+                                                               // Remove some unwanted chars
+                                                               $sql = str_replace("\r", "", $sql);
+                                                               $sql = str_replace("\n\n", "\n", $sql);
+
+                                                               // And split it up against ;\n ...
+                                                               $SQLs = array_merge($SQLs, explode(";\n", $sql));
+                                                       }
+                                               }
+
+                                               // Are some SQLs found?
+                                               if (count($SQLs) == 0) {
+                                                       // Abort here
+                                                       ADD_FATAL(INSTALL_SQL_IMPORT_FAILED);
+                                                       return;
+                                               }
+
+                                               // Now run all queries through and try to keep out empty or comment queries
+                                               foreach ($SQLs as $sql) {
+                                                       // Trim spaces away
+                                                       $sql = trim($sql);
+
+                                                       // Is this query not empty and not a comment?
+                                                       if ((!empty($sql)) && (substr($sql, 0, 2) != "--") && (substr($sql, 0, 1) != "#")) {
+                                                               // Then run it!
+                                                               SQL_QUERY($sql, __FILE__, __LINE__);
+                                                       }
+                                               }
+
+                                               // Ok, all done. So we can write the config data to the php files
+                                               if ($_POST['spath'] != PATH) install_WriteData($_POST['spath']."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", $_POST['spath'], 0);
+                                               if ($_POST['burl']  != URL)  install_WriteData($_POST['spath']."inc/config.php", "HOST-URL", "define('URL', \"", "\");", $_POST['burl'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MAIN_TITLE", "define('MAIN_TITLE', \"", "\");", $_POST['title'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "SLOGAN", "define('SLOGAN', \"", "\");", $_POST['slogan'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "WEBMASTER", "define('WEBMASTER', \"", "\");", $_POST['email'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "NULLPASS-WARNING", "define('warn_no_pass', ", ");", $_POST['warn_no_pass'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "WRITE-FOOTER", "define('WRITE_FOOTER', ", ");", $_POST['wfooter'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "BACKLINK", "define('ENABLE_BACKLINK', ", ");", $_POST['blink'], 0);
+                                               // install_WriteData($_POST['spath']."inc/config.php", "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", $_POST['omode'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MYSQL-HOST", "     'host'     => \"", "\",", $mysql['host'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MYSQL-DBASE", "    'dbase'    => \"", "\",", $mysql['dbase'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MYSQL-LOGIN", "    'login'    => \"", "\",", $mysql['login'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MYSQL-PASSWORD", " 'password' => \"", "\",", $mysql['pass1'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "MYSQL-PREFIX", "define('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "SMTP-HOSTNAME", "define('SMTP_HOSTNAME', \"", "\");", $_POST['smtp_host'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", $_POST['smtp_user'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", $_POST['smtp_pass'], 0);
+                                               install_WriteData($_POST['spath']."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0);
+
+                                               // Close the link
+                                               SQL_CLOSE($link, __FILE__, __LINE__);
+                                       }
+                                        else
+                                       {
+                                               // Installation area not found!
+                                               ADD_FATAL(INSTALL_MISSING_DUMPS);
+                                       }
+                               }
+                       }
+                       if ((sizeof($FATAL) > 0) || ($FATAL[0] != ''))
+                       {
+                               $OUT = "";
+                               foreach ($FATAL as $value)
+                               {
+                                       $OUT .= "    <LI>".$value."</LI>\n";
+                               }
+                               define('__FATAL_ERROR_LI', $OUT);
+                               $OUT = "";
+                               foreach ($mysql as $key => $value)
+                               {
+                                       $OUT .= "    <INPUT type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\">\n";
+                               }
+                               define('__MYSQL_DATA'   , $OUT);
+                               define('__SPATH_VALUE'  , $_POST['spath']);
+                               define('__BURL_VALUE'   , $_POST['burl']);
+                               define('__TITLE_VALUE'  , $_POST['title']);
+                               define('__SMTP_HOST'    , $_POST['smtp_host']);
+                               define('__SMTP_USER'    , $_POST['smtp_user']);
+                               define('__SMTP_PASS'    , $_POST['smtp_pass']);
+
+                               OUTPUT_HTML("<FORM action=\"".__BURL_ACTION."/install.php?page=2\" method=\"POST\">
+<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"install_content\">
+<TR>
+  <TD align=\"center\">
+    <STRONG class=\"install\">".HEADER_MYSQL_ERRORS."</STRONG>
+  </TD>
+</TR>
+<TR><TD colspan=\"2\" height=\"21\" class=\"seperator\">&nbsp;</TD></TR>
+<TR>
+  <TD><SPAN class=\"install_intro\">
+    ".TEXT_MYSQL_ERRORS."
+  </SPAN></TD>
+</TR>
+<TR>
+  <TD align=\"center\"><STRONG>
+    <OL>
+".__FATAL_ERROR_LI."
+    </OL>
+".__MYSQL_DATA."
+    <INPUT type=\"hidden\" name=\"spath\" value=\"".__SPATH_VALUE."\">
+    <INPUT type=\"hidden\" name=\"burl\" value=\"".__BURL_VALUE."\">
+    <INPUT type=\"hidden\" name=\"title\" value=\"".__TITLE_VALUE."\">
+    <INPUT type=\"submit\" class=\"admin_submit\" name=\"ok\" value=\"".RETURN_MYSQL_PAGE."\">
+  </STRONG></TD>
+</TR>
+</TABLE>
+</FORM>");
+                       }
+                        else
+                       {
+                               // Installation is done!
+                               $URL = $burl."/install.php?page=finalize";
+                               LOAD_URL($URL);
+                       }
+               }
+                elseif (isBooleanConstantAndTrue('mxchange_installed'))
+               {
+                       // Redirection after writing data... :-)
+                       LOAD_TEMPLATE("install_finished");
+               }
+                else
+               {
+                       // Something goes wrong during installation! :-(
+                       ADD_FATAL(INSTALL_FINALIZER_FAILED);
+                       include ("inc/fatal_errors.php");
+               }
+               break;
+
+       default:
+               OUTPUT_HTML("    <STRONG class=\"install_error\">".WRONG_PAGE."</STRONG>");
+               break;
+       }
+}
+ else
+{
+       ADD_FATAL(ALREADY_INSTALLED);
+}
+//
+?>
diff --git a/inc/language.php b/inc/language.php
new file mode 100644 (file)
index 0000000..fc7f73c
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 07/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : language.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Language loader                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sprache-Lader                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Set default language
+if (empty($mx_lang)) $mx_lang = DEFAULT_LANG;
+
+// Look for file
+$file = sprintf("%sinc/language/%s.php", PATH, $mx_lang);
+if (!FILE_READABLE($file)) {
+       // Switch to default (DO NOT CHANGE!!!)
+       set_session("mx_lang", "de");
+       $mx_lang = "de";
+       $file = sprintf("%sinc/language/%s.php", PATH, "de");
+} // END - if
+
+// Load language file
+require($file);
+unset($file);
+
+// Check for installation mode
+if (isBooleanConstantAndTrue('mxchange_installing')) {
+       // Load matching language file
+       require(PATH."inc/language/install_".$mx_lang.".php");
+}
+
+//
+?>
diff --git a/inc/language/.htaccess b/inc/language/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/language/active_de.php b/inc/language/active_de.php
new file mode 100644 (file)
index 0000000..2f692a4
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/26/2004 *
+ * ===============                              Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : active_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('GUEST_ACTIVE_LINK', "Heute Online");
+define('GUEST_ACTIVE_NO_MEMER_ONLINE_TODAY', "Heute war noch kein einziges Mitglied online!");
+define('GUEST_ACTIVE_HEADER', "Wir waren heute online!");
+define('GUEST_ACTIVE_FOOTER', "Diese Mitglieder waren heute bei <STRONG>{--MAIN_TITLE--}</STRONG> eingeloggt.");
+define('ADMIN_ACTIVE_SETTINGS', "Einstellungen an Aktiv-Liste");
+define('ADMIN_ACTIVE_LIMIT', "Anzahl Eintr&auml;ge in Liste");
+
+//
+?>
diff --git a/inc/language/admins_de.php b/inc/language/admins_de.php
new file mode 100644 (file)
index 0000000..c715072
--- /dev/null
@@ -0,0 +1,110 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/15/2004 *
+ * ===============                              Last change: 08/15/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : admins_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_ADMINS_ADD_NEW_ADMIN', "Neuen Administrator-Account anlegen");
+define('ADMIN_ADMINS_ADD_ADMIN', "Hinzuf&uuml;gen");
+define('ADMIN_ADMINS_ENTER_LOGIN', "Loginname eingeben");
+define('ADMIN_ADMINS_ENTER_EMAIL', "E-Mail eingeben");
+define('ADMIN_ADMINS_ENTER_PASS1', "Passwort eingeben");
+define('ADMIN_ADMINS_ENTER_PASS2', "Passwort wiederholen");
+define('ADMIN_ADMINS_ADD_DONE', "Das Admin-Account wurde angelegt.");
+define('ADMIN_ADMINS_EDIT_ACCOUNTS', "Admin-Accounts verwalten");
+define('ADMIN_ADMINS_EDIT', "Bearbeiten");
+define('ADMIN_ADMINS_DELETE', "L&ouml;schen");
+define('ADMIN_ADMINS_CONTACT', "Admin-Login");
+define('ADMIN_ADMINS_EMAIL', "E-Mail Adresse");
+define('ADMIN_ADMINS_PASSWORD', "Passwort und Wiederholung");
+define('ADMIN_ADMINS_EDIT_NOTE', "Bitte beachten Sie, dass Sie nur dann das Passwort zweimal eingeben m&uuml;ssen, wenn Sie es &auml;ndern wollen. Wollen Sie nur die Daten &auml;ndern, brauchen Sie kein Passwort eingeben!");
+define('ADMIN_ADMINS_DELETE_ACCOUNTS', "Wollen Sie wirklich diese Accounts l&ouml;schen?");
+define('ADMIN_ADMINS_CANNOT_DELETE_LAST', "Das letzte Admin-Account kann nicht gel&ouml;scht werden!");
+define('ADMINS_SELECT_ADMIN', "Bitte w&auml;hlen Sie einen Administrator aus dem Men&uuml;punkt <I>Admin-Account &auml;ndern</I> aus!");
+define('ADMINS_ADMIN_ID', "Admin-ID");
+define('ADMINS_CONTACT_SUBMIT', "Admin kontaktieren");
+define('ADMINS_ENTER_CONTACT_TEXT', "Kontaktgrund eingeben");
+define('ADMINS_SELECT_CONTACT_TYPE', "Nachricht &uuml;bertragen als");
+define('ADMINS_CONTACT_TYPE_MAIL', "Mail");
+define('ADMINS_CONTACT_TYPE_MSG', "Nachricht");
+define('ADMINS_CONTACT_DEFAULT_MAIL', "Ihre Nachricht wird als Mail versendet.");
+define('ADMINS_MSG_FROM_ADMIN', "Nachricht von einem Admin");
+define('ADMINS_ADMIN_CONTACTED', "Administrator wurde benachrichtigt!");
+define('ADMINS_ACCESS_DENIED', "Zugriff nicht gestattet.");
+define('ADMIN_ADMINS_ADD_ACL', "Zugriffkontrollzeile hinzuf&uuml;gen");
+define('ADMIN_ADMINS_SELECT_LOGIN', "Admin-Login ausw&auml;hlen");
+define('ADMIN_ADMINS_SELECT_ACTION', "Hauptmen&uuml;");
+define('ADMIN_ADMINS_SELECT_WHAT', "Untermen&uuml;");
+define('ADMIN_ADMINS_SELECT_MODE', "Zugriffsmodus ausw&auml;hlen");
+define('ADMINS_ALLOW_MODE', "Erlauben");
+define('ADMINS_DENY_MODE', "Ablehnen");
+define('ADMIN_ADMINS_ACCESS_MODE', "Zugriffsmodus");
+define('ADMIN_ADMINS_ACL_NOTE', "Sperren Sie nicht sich selber aus, indem Sie den Zugriffsmodus Ihres eigenen Accountes auf <STRONG>Ablehnen</STRONG> stellen! Dann k&ouml;nnen Sie zwar einloggen, aber nichts mehr machen!");
+define('ADMIN_ADMINS_SAME_MODE_SELECTED', "Bitte w&auml;hlen Sie den anderen Zugriffsmodus aus!");
+define('ADMIN_ADMINS_SELECT_ACTION_WHAT', "Bitte w&auml;hlen Sie ein Haupt- oder Untermen&uuml; aus!");
+define('ADMIN_ADMINS_ACL_ALREADY_ADDED', "Zugriffskontrollzeile bereits hinzugef&uuml;gt!");
+define('ADMIN_ADMINS_ACL_SAVED', "Zugriffskontrollzeile gespeichert.");
+define('ADMIN_ADMINS_LIST_ACLS', "Alle angelgten Zugriffkontrollzeilen auflisten");
+define('ADMINS_EDIT_ACLS', "Editieren");
+define('ADMINS_DEL_ACLS', "L&ouml;schen");
+define('ADMINS_AID', "Admin-Login");
+define('ADMIN_ADMINS_EDIT_ACLS', "Zugriffkontrollzeilen &auml;ndern");
+define('ADMINS_CHANGE_ACLS', "Eintr&auml;ge &auml;ndern");
+define('ADMINS_REMOVE_ACLS', "Eintr&auml;ge l&ouml;schen");
+define('ADMIN_ADMINS_ENTRIES_CHANGED', "Zugriffkontrollzeilen wurden ge&auml;ndert.");
+define('ADMIN_ADMINS_DELETE_ACLS', "Zugriffkontrollzeilen l&ouml;schen");
+define('ADMIN_ADMINS_ENTRIES_DELETED', "Zugriffkontrollzeilen wurden gel&ouml;scht.");
+define('ADMINS_MAILS_NO_ENTRIES', "Keine Eintr&auml;ge gefunden!");
+define('ADMINS_MAILS_TITLE', "Admins-Mails verwalten");
+define('ADMIN_ADMINS_TEMPLATE', "Mail-Template");
+define('ADMINS_ALL_ADMINS', "An alle Admins");
+define('ADMINS_TO_USERLOG', "Im Userlog vermerken");
+define('ADMINS_NO_MAIL_CHECKED', "Keine Mails zum Editieren ausgew&auml;hlt.");
+define('ADMINS_MAILS_EDIT_TITLE', "Ausgew&auml;hlte Templates den Admins zuweisen");
+define('ADMIN_ADMINS_CHANGE', "&Auml;ndern");
+define('ADMINS_ADD_MORE_ADMINS', "Weiteren Admin hinzuf&uuml;gen");
+define('ADMIN_ACCOUNT_SAVED', "Admin-Account gespeichert.");
+define('ADMINS_ERROR_PASS_MISMATCH', "Die beiden Passw&ouml;rter stimmen nicht &uuml;berein!");
+define('ADMIN_ACCOUNT_404', "Admin-Account nicht gefunden!");
+
+// Logical area constants
+define('ADMINS_GLOBAL_LA_SETTING', "Globale Einst.");
+define('ADMINS_OLD_LA_SETTING', "Altes Men&uuml;");
+define('ADMINS_NEW_LA_SETTING', "Neues Men&uuml;");
+
+//
+?>
diff --git a/inc/language/autopurge_de.php b/inc/language/autopurge_de.php
new file mode 100644 (file)
index 0000000..f5b9566
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/30/2004 *
+ * ===============                              Last change: 01/07/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : autopurge_de.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('AUTOPURGE_MEMBER_SUBJECT', "{!POINTS!}-Gutschrift bei Auto-Loeschung");
+define('AUTOPURGE_MEMBER_INACTIVE_SUBJECT', "Inaktivitaet --> Account wird bald geloescht!");
+define('AUTOPURGE_MEMBER_UNCONFIRMED_SUBJECT', "Loeschung --> EMail-Adresse nicht bestaetigt!");
+define('AUTOPURGE_ADMIN_SUBJECT', "[Auto-Purge:] Bestaetigungslinks");
+define('AUTOPURGE_ADMIN_INACTIVE_SUBJECT', "Inaktive User benachrichtigt");
+define('AUTOPURGE_ADMIN_DELETE_SUBJECT', "[Auto-Purge:] Inaktiven Mitgliedern");
+define('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT', "[Auto-Purge:] Unbestaetigten Accounts");
+define('AUTOPURGE_ADMIN_TASKS_SUBJECT', "[Auto-Purge:] Zu Loeschen marktierte Aufgaben");
+define('AUTOPURGE_ADMIN_TURBO_SUBJECT', "[Auto-Purge:] Veraltete Bonus-Eintraege");
+define('AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT', "[Auto-Purge:] Mailbuchungen bereits gel. Mitglieder");
+
+define('ADMIN_AUTOPURGE_CONFIGURATION', "Konfiguration der automatischen L&ouml;schungen");
+define('ADMIN_AUTOPURGE_INACTIVE', "Sollten inaktive Accounts erkannt und gel&ouml;scht werden?");
+define('ADMIN_AUTOPURGE_INACTIVE_SINCE', "Dauer bis best&auml;tigtes Account als inaktiv markiert wird");
+define('ADMIN_AUTOPURGE_INACTIVE_TIME', "Dauer bis inaktives Account gel&ouml;scht wird");
+define('ADMIN_AUTOPURGE_UNCONFIRMED', "Sollen unbest&auml;tigte Accounts gel&ouml;scht werden?");
+define('ADMIN_AUTOPURGE_UNCONFIRMED_TIME', "Dauer bis unbest&auml;tigte Accounts gel&ouml;scht werden");
+define('ADMIN_AUTOPURGE_ALL_ACTIVE', "Alle Ihre Mitlieder sind aktiv!");
+define('ADMIN_AUTOPURGE_TASKS', "L&ouml;schen von veralteten zu L&ouml;schen markierten Aufgaben?");
+define('ADMIN_AUTOPURGE_TASKS_TIME', "Dauer bis zu l&ouml;schen marktierte Aufgaben gel&ouml;scht werden");
+define('ADMIN_AUTOPURGE_INACTIVE_TITLE', "Inaktive Accounts l&ouml;schen");
+define('ADMIN_AUTOPURGE_UNCONFIRMED_TITLE', "Unbest&auml;tigte Accounts l&ouml;schen");
+define('ADMIN_AUTOPURGE_TASKS_TITLE', "Veraltete Aufgaben l&ouml;schen");
+define('ADMIN_AUTOPURGE_NOTIFICATION_TITLE', "Benachtigung an Admin bei Auto-L&ouml;schung");
+define('ADMIN_AUTOPURGE_NOTIFY_INACTIVE', "Benachrichtigung bei inaktive Accounts l&ouml;schen");
+define('ADMIN_AUTOPURGE_NOTIFY_UNCONFIRMED', "Benachrichtigung bei unbest&auml;tigte Accounts l&ouml;schen");
+define('ADMIN_AUTOPURGE_NOTIFY_TASKS', "Benachrichtigung bei veraltete Aufgaben l&ouml;schen");
+define('AUTOPURGE_NOTIFIED', "Benachrichtigt");
+
+define('ADMIN_AUTOPURGE_DEL_MAILS_TITLE', "Mails von gel&ouml;schten Mitgliedern l&ouml;schen");
+define('ADMIN_AUTOPURGE_DEL_MAILS', "Sollen die Mailbuchungen von be bnreits gel&ouml;schten Mitgliedern gel&ouml;scht werden?");
+define('ADMIN_AUTOPURGE_DEL_MAILS_TIME', "Dauer bis Mails gel&ouml;scht werden");
+define('ADMIN_AUTOPURGE_NOTIFY_DEL_MAILS', "Benachrichtigen bei L&ouml;schung von Mails");
+
+// Moved from other extensions
+define('ADMIN_OPTION_AUTOPURGE_ACTIVE', "Auto-L&ouml;schung von Best&auml;tigungslink ist aktiviert?");
+define('ADMIN_OPTION_MAIL_LIFETIME', "G&uuml;tigkeitsdauer der Best&auml;tigungslinks (0 = Best&auml;tigungslinks laufen nie ab)");
+define('ADMIN_AUTOPURGE_MAILID_TITLE', "Mailbest&auml;tigungslinks l&ouml;schen");
+
+//
+?>
diff --git a/inc/language/bank_de.php b/inc/language/bank_de.php
new file mode 100644 (file)
index 0000000..f08218a
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/01/2007 *
+ * ===============                              Last change: 06/01/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : bank.php                                         *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_ADD_BANK_PACKAGE_TITLE', "Neues Angebotspaket hinzuf&uuml;gen");
+define('ADMIN_BANK_PACKAGE_TITLE', "Titel des Angebotspaketes");
+define('ADMIN_BANK_PACKAGE_DESCRIPTION', "Kurze Beschreibung des Paketes");
+define('ADMIN_BANK_PACKAGE_ACCOUNT_FEE', "Monatliche Grundgeb&uuml;hr (Kontof&uuml;hrung)");
+define('ADMIN_BANK_PACKAGE_FREE_TRANSFERS', "Anzahl kostenlose &Uuml;berweisungen pro Monat");
+define('ADMIN_BANK_PACKAGE_OUTPUT_MODE', "Abrufm&ouml;glichkeiten der Kontoausz&uuml;ge");
+define('ADMIN_BANK_PACKAGE_FREE_MONTHS_FEE', "Anzahl grundgeb&uuml;hrfreier Monate");
+define('ADMIN_BANK_PACKAGE_INTEREST_PLUS', "Zinssatz f&uuml;r Haben");
+define('ADMIN_BANK_PACKAGE_INTEREST_MINUS', "Zinssatz f&uuml;r Soll");
+define('ADMIN_BANK_PACKAGE_FIRST_PAYMENT', "H&ouml;he der ersten Einzahlung");
+define('ADMIN_BANK_PACKAGE_FREE_ACCOUNT_INCOME', "H&ouml;he der monatlichen Einnahmen, um Konto kostenlos zu erhalten");
+define('ADMIN_BANK_PACKAGE_FREE_ACCOUNT_STUFF', "Freitext f&uuml;r Dinge, die kostenlos sein werden.");
+define('ADMIN_BANK_PACKAGE_TAN_LOCK', "Anzahl Versuche richtige (i)TAN einzugeben, bis (i)TAN-Liste gesperrt wird.");
+define('ADMIN_BANK_PACKAGE_ACTIVE', "Ist dieses Angebotspaket vom Mitglied einsehbar, also aktiviert?");
+define('ADMIN_BANK_PACKAGE_TRANSFER_FEE', "Geb&uuml;hr f&uuml;r &Uuml;berweisung");
+define('ADMIN_BANK_PACKAGE_EDIT_TAN_LOCK', "Anzahl Versuche bis (i)TAN-Liste gesperrt ist.");
+define('ADMIN_BANK_PACKAGE_EDIT_ACTIVE', "Aktiviert/Erwerbbar");
+define('ADMIN_ADD_BANK_PACKAGE', "Angebotspaket einstellen");
+define('ADMIN_BANK_FOOTER_NOTE', "Bitte beachten Sie, dass keine Mail zu den Mitgliedern unterwegs ist. Seien Sie bei Titel, Beschreibung und Freitext kreativ und schreiben Sie aussagekr&auml;ftige Texte!");
+define('ADMIN_BANK_NO_PACKAGES_FOUND', "Keine Angebotspakete zum Auflisten gefunden!");
+define('ADMIN_LIST_BANK_PACKAGES', "Angebotspakete f&uuml;r Ihre Bank auflisten");
+define('ADMIN_LIST_BANK_PACKAGES_TITLE', "Pakettitel");
+define('ADMIN_LIST_BANK_PACKAGES_DESCR', "Paketbeschreibung");
+define('ADMIN_LIST_BANK_PACKAGES_ACCOUNT_FEE', "Grundgeb&uuml;hr");
+define('ADMIN_LIST_BANK_PACKAGES_STATUS', "Erwerbbar?");
+define('ADMIN_LIST_BANK_PACKAGES_ACCOUNT_INTEREST_PLUS', "Zinsen f. Haben");
+define('ADMIN_LIST_BANK_PACKAGES_ACCOUNT_INTEREST_MINUS', "Zinsen f. Soll");
+define('ADMIN_STATUS_CHANGED_1', "Es wurden <U>");
+define('ADMIN_STATUS_CHANGED_2', "</U> von <U>");
+define('ADMIN_STATUS_CHANGED_3', "</U> Eintr&auml;gen ge&auml;ndert.");
+define('ADMIN_DELETE_BANK_PACKAGES', "Angebotspakete entg&uuml;ltig entfernen");
+define('ADMIN_DELETE_BANK_PACKAGES_NOTES', "<STRONG>Hinweis:</STRONG> Wenn Sie die aufgelisteten Angebotspakete entg&uuml;ltig l&ouml;schen, kann eventuell Ihre Bank nicht korrekt funktionieren, da eventuell einige Mitglieder dieses Paket ausgew&auml;hlt haben. Bitte schauen Sie unter <EM>Konten auflisten</EM> vorher nach!");
+define('ADMIN_EDIT_BANK_PACKAGES', "Angebotspakete &auml;ndern");
+define('ADMIN_EDIT_BANK_PACKAGES_NOTES', "<STRONG>Hinweis:</STRONG> Derzeit keine Tipps f&uuml;r diese Aktion.");
+
+// Output modes
+define('BANK_OUTPUT_MODE_LOGIN', "Nur im Mitgliedsbereich");
+define('BANK_OUTPUT_MODE_EMAIL', "Per EMail&amp;Mitgliedsbereich");
+define('BANK_OUTPUT_MODE_DISABLED', "Keinen Zugriff");
+
+//
+?>
diff --git a/inc/language/beg_de.php b/inc/language/beg_de.php
new file mode 100644 (file)
index 0000000..2b25ea2
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/09/2005 *
+ * ===============                              Last change: 01/09/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : beg_de.php                                       *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_EDIT_BEG_SETTINGS', "Einstellungen am Bettel-Link");
+define('ADMIN_BEG_POINTS', "{!POINTS!}-Gutschrift bei Klick auf Bettel-Link");
+define('ADMIN_CONFIG_BEG_TIMEOUT', "Zeitsperre global");
+define('ADMIN_CONFIG_BEG_UID_TIMEOUT', "Zeitsperre gegen eine Mitglieder-ID");
+define('ADMIN_CONFIG_BEG_REMOTE_IP_TIMEOUT', "Zeitsperre gegen eine IP-Nummer");
+define('BEG_LINK_BY_1', "Bettel-Link bei ");
+define('BEG_LINK_BY_2', "");
+define('BEG_LINK_USERID_1', "Unser Mitglied ");
+define('BEG_LINK_USERID_2', " hat {!POINTS!} gebettelt!");
+define('BEG_UID_STEAL_1', "Das Mitglied ");
+define('BEG_UID_STEAL_2', " hat soeben ");
+define('BEG_UID_STEAL_3', " {!POINTS!} bei Ihnen erbettelt!");
+define('BEG_CLICKS_1', "Dies war insgesamt der ");
+define('BEG_CLICKS_2', ". Klick auf sein Bettel-Link.");
+define('BEG_THANKS_FOR_CLICK', "Danke f&uuml;r Ihre Spende!");
+define('BEG_CONTINUE_REGISTER', "Und weiter geht es zur Anmeldung bei {--MAIN_TITLE--} ...");
+define('BEG_SORRY_ANOTHER_WAS_HERE_1', "Oh schade! Es war vor kurzem schon einer hier! Das Mitglied ");
+define('BEG_SORRY_ANOTHER_WAS_HERE_2', " hat von Ihnen auch keine ");
+define('BEG_SORRY_ANOTHER_WAS_HERE_3', " {!POINTS!} erhalten.");
+define('BEG_THANKS_FOR_CLICK_AGAIN', "Danke dennoch f&uuml;r den erneuten Klick!");
+define('BEG_MEMBER_YOUR_LINK', "Hier ist Ihr pers&ouml;nlicher Bettel-Link");
+define('BEG_MEMBER_CLICKS_TOTAL', "Anzahl Gesamtklicks auf Ihren Bettel-Link");
+define('BEG_MEMBER_EARN_1', "Sie erhalten von");
+define('BEG_MEMBER_EARN_2', "bis");
+define('BEG_MEMBER_EARN_3', "f&uuml;r jeden Klick auf Ihren Bettellink.");
+define('BEG_MEMBER_TIMEOUT_1', "Die Zeitsperre ist derzeit eingestellt auf ");
+define('BEG_MEMBER_TIMEOUT_2', ". Innerhalb dieser Zeit erhalten Sie keine erneute Verg&uuml;tung!");
+define('BEG_MEMBER_HAVE_FUN', "Viel Spass beim {!POINTS!}-Betteln.");
+define('BEG_GUEST_TRAILER', "{!POINTS!} erbetteln bei...");
+define('BEG_GUEST_EARN_1', "Betteln macht sich bezahlt! F&uuml;r jeden Klick erhalten Sie von");
+define('BEG_GUEST_EARN_2', "bis");
+define('BEG_GUEST_EARN_3', "auf Ihr Mitgliedskonto direkt gutgeschrieben. Zuddem verdienen Sie an den erbettelteten {!POINTS!} Ihrer Refferal mit.");
+define('BEG_GUEST_TIMEOUT_1', "Sie k&ouml;nnen derzeit alle ");
+define('BEG_GUEST_TIMEOUT_2', " {!POINTS!} betteln.");
+define('BEG_GUEST_HAVE_FUN', "Heute noch anmelden und Spass haben!");
+define('ADMIN_BEG_POINTS_MAX', "Maximale erbettelbare {!POINTS!} bei Klick auf Bettellink");
+define('ADMIN_BEG_USERID', "Mitglied-Account zum Abbuchen der erbettelten {!POINTS!}");
+define('ADMIN_SELECT_BEG_MODE', "Verg&uuml;tungsmodus der erbettelten {!POINTS!}");
+define('BEG_MODE_DIRECT', "Nur direktem Mitglied gutschreiben.");
+define('BEG_MODE_REF', "Auch dem Werber des Mitgliedes gutschreiben.");
+define('BEG_SORRY_YOURE_LOGGED_IN_1', "Oh schade! Sie haben vermutlich auf Ihren eigenen Bettel-Link mit der User-ID ");
+define('BEG_SORRY_YOURE_LOGGED_IN_2', " geklickt. Sie haben somit auch keine ");
+define('BEG_SORRY_YOURE_LOGGED_IN_3', " {!POINTS!} erhalten!");
+define('BEG_SAME_UID_AS_OWN', "Mitglieder-ID des Webmasters benutzt!");
+
+// Begging rallye
+define('BEG_RANK', "Bettel-Rank");
+define('BEG_TOTAL', "Gesamt erbettelt");
+define('BEG_POINTS', "Erbettelt");
+define('BEG_MEMBER_TOTAL', "Erbettelte {!POINTS!} aller Mitglieder");
+define('ADMIN_BEG_TIMEOUT_1', "Es werden nur Mitglieder ausgewertet und hier aufgelistet, die sp&auml;testens am ");
+define('ADMIN_BEG_TIMEOUT_2', "noch aktiv waren. Alle anderen Mitglieder erhalten die Verg&uuml;tung nicht!");
+define('ADMIN_EDIT_BEG_RALLYE_SETTINGS', "Einstellungen an der Bettel-Rallye");
+define('ADMIN_BEG_RALLYE_ACTIVE', "Ist die Bettel-Rallye aktiv? (Mails k&ouml;nnen optional versendet werden!)");
+define('ADMIN_BEG_RALLYE_ONLY_ACTIVE', "Nur aktive Mitglieder nehmen dran?<br /><FONT class=\"admin_note\">(Nur in Verbindung mit der Erweiterung <STRONG>autopurge</STRONG>!)</FONT>");
+define('ADMIN_BEG_NO_RALLYE', "Niemand nimmt an der Bettel-Rallye dran teil!");
+define('ADMIN_BEG_WITHDRAW_NOW', "Jetzt Verg&uuml;tung Bettel-Rallye verg&uuml;ten");
+define('ADMIN_BEG_WITHDRAW_NOTE', "Es wird nur die Verg&uuml;tung vorbereitet. Die eigentliche Verg&uuml;tung erfolgt beim T&auml;glichen Reset um 00:00 Uhr!");
+define('ADMIN_BEG_WITHDRAW_PREPARED', "Verg&uuml;tung der Bettel-Rallye vorbereitet.");
+define('ADMIN_BEG_WINNER_HIGLIGHTED', "M&ouml;gliche Gewinner der Bettel-Rallye sind dick marktiert.");
+define('ADMIN_BEG_ALREADY_WITHDRAW', "Manuelle Verg&uuml;tungvorbereitung bereits bet&auml;tigt!");
+define('BEG_RALLYE_NOTE', "Hinweis: Unter <STRONG>{--BEG_POINTS--}</STRONG> finden Sie Ihre gesamt erbettelten {!POINTS!} wieder!");
+define('BEG_RALLYE_CONDITIONS', "Wer alles an der Bettel-Rallye teilnehmen kann");
+define('BEG_RALLYE_CONDITION_1', "Es werden nur aktive und freigeschaltete Mitglieder ber&uuml;cksichtig.");
+define('BEG_RALLYE_CONDITION_2', "Es kann jeder dran teilnehmen, der Mitglied bei diesem {!MT_WORD!} (<STRONG>{--MAIN_TITLE--}</STRONG>) und freigegeben ist.");
+define('BEG_RALLYE_CONDITION_3', "Zur Erstellung des Rallye-Ergebnisses werden alle erbettelten {!POINTS!} ber&uuml;cksichtig.");
+define('BEG_RALLYE_CONDITION_4', "Der Rechtsweg ist ausgeschlossen.");
+define('BEG_MEMBER_HERE_IS_THE_LIST', "Hier finden Sie die aktuelle Liste mit den m&ouml;glichen Gewinnern!");
+define('BEG_LINK_HERE', "Betteln Sie am Besten gleich los! Hier ist der Link dazu!");
+define('ADMIN_BEG_RANKS', "Anzahl Gewinner der Bettel-Rallye");
+define('BEG_MONTHLY_RALLYE', "GEWONNEN: Monatliche Bettel-Rallye");
+define('BEG_RALLYE_NO_ONE_JOINED', "Niemand nimmt an der Bettel-Rallye dran teil, oder sie ist administrativ deaktiviert worden!");
+define('ADMIN_BEG_RALLYE_DEACTIVATED', "Bettel-Rallye nicht aktiviert.");
+define('ADMIN_EDIT_BEG_RALLYE_NOTIFICATIONS', "Benachrichtungen per Mail zur Bettel-Rallye");
+define('ADMIN_BEG_RAL_EN_NOTIFY', "Benachtigen, wenn Bettel-Rallye aktiviert wurde?");
+define('ADMIN_BEG_RAL_DI_NOTIFY', "Benachtigen, wenn Bettel-Rallye deaktiviert wurde?");
+define('ADMIN_BEG_NOTIFY_BONUS', "Bonus-Mail mit Anzahl {!POINTS!} aussenden, wenn Bettel-Rallye aktiviert wurde. <FONT class=\"admin_note\">(0 = Unverg&uuml;tete Benachrichtigung aussenden; nur in Verbindung mit der Erweiterung <STRONG>bonus!</STRONG>)</FONT>");
+define('ADMIN_BEG_NEW_MEMBER_NOTIFY', "Sollen neue Mitglieder mit selber Mail &uuml;ber eine laufende Bettel-Rallye benachrichtigt werden?");
+define('ADMIN_BEG_NOTIFY_WAIT', "Wie lange soll die Wartezeit der Bonus-Mail sein?");
+define('BEG_NO_LIMITATION', "Keine IP-Sperre eingerichtet!!!");
+define('ADMIN_BEG_INCLUDE_OWN', "Soll Ihre Mitglieder-ID an der Bettel-Rallye dran teilnehmen?");
+
+// Task overview
+define('TASK_ADMIN_LIST_BEG', "Bettel-Rallye-Teilnehmer");
+define('TASK_ADMIN_LIST_BEG_TITLE', "Es nehmen Mitglieder an der Bettel-Rallye dran teil!");
+
+// Subject lines
+define('BEG_RALLYE_EN_NOTIFY', "HINWEIS: Eine Bettel-Rallye ist am Laufen!");
+define('BEG_RALLYE_DI_NOTIFY', "HINWEIS: Eine Bettel-Rallye wurde gestoppt!");
+
+//
+?>
diff --git a/inc/language/birthday_de.php b/inc/language/birthday_de.php
new file mode 100644 (file)
index 0000000..17733a4
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/23/2004 *
+ * ===============                              Last change: 05/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : birthday_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('HAPPY_BIRTHDAY', "Herzlichen Glueckwunsch zum Geburtstag!");
+define('ADMIN_CONFIG_BIRTHDAY_HEADER', "Einstellungen zu Geburtstagsmails");
+define('ADMIN_BIRTHDAY_POINTS', "{!POINTS!} als &quot;Geburtstagsgeschenk&quot;");
+define('ADMIN_BIRTHDAY_POINTS_NOTE', "Wert <STRONG>0</STRONG> deaktiviert die Extragutschrift!");
+define('BIRTHDAY_CANNOT_STATUS_1', "Kann keine {!POINTS!} gutschreiben! Status Ihres Accounts: <STRONG>");
+define('BIRTHDAY_CANNOT_STATUS_2', "</STRONG>");
+define('BIRTHDAY_CANNOT_LOAD_DATA', "Entweder haben Sie bereits Ihr Geburtsgeschenk erhalten oder Sie haben heute keinen Geburtstag!");
+define('ADMIN_SELECT_BIRTHDAY_MODE', "Verg&uuml;tungsmodus der {!POINTS!}");
+define('BIRTHDAY_MODE_DIRECT', "Nur direktem Mitglied gutschreiben.");
+define('BIRTHDAY_MODE_REF', "Auch dem Werber des Mitgliedes gutschreiben.");
+define('ADMIN_BIRTHDAY_ONLY_ACTIVE', "Nur aktive Mitglieder erhalten die Geburtstagsgutschrift?<br /><FONT class=\"admin_note\">(Nur in Verbindung mit der Erweiterung <STRONG>autopurge</STRONG>!)</FONT>");
+
+//
+?>
diff --git a/inc/language/bonus_de.php b/inc/language/bonus_de.php
new file mode 100644 (file)
index 0000000..aa873c6
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ===============                              Last change: 11/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : bonus_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('BONUS_LOGIN_TOTAL', "Login-Bonus");
+define('BONUS_TURBO_TOTAL', "Aktiv-Bonus beim Best.");
+define('ADMIN_EDIT_BONUS_SETTINGS', "Einstellungen an Verg&uuml;tungen");
+define('ADMIN_BONUS_LOGIN_BONUS', "Bonus f&uuml;r Login");
+define('ADMIN_BONUS_TURBO_BONUS', "Rang-Bonus f&uuml;r Erst-Klicker");
+define('ADMIN_BONUS_TURBO_RATES', "Bonus f&uuml;r Klicker 2 bis x");
+define('ADMIN_BONUS_TURBO_RATES_NOTE1', "Hinweise");
+define('ADMIN_BONUS_TURBO_RATES_NOTE2', "Lassen Sie den letzten Eintrag frei, damit kein weiterer Eintrag hingef&uuml;gt wird.");
+define('ADMIN_BONUS_TURBO_RATES_NOTE3', "Eintr&auml;ge l&ouml;schen, um Bonus zu entfernen (alle unteren r&uuml;cken beim Speichern nach!)");
+define('ADMIN_BONUS_TURBO_RATES_NOTE4', "Wenn Sie alle Eintr&auml;ge gel&ouml;scht haben, werden Platz 2 und 3 automatisch neu berechnet.");
+define('ADMIN_CONFIG_LOGIN_TIMEOUT', "Zeitspanne zwischen zwei Logins");
+define('ADMIN_BONUS_TURBO_RANKS', "Wie viele Mitglieder sollen die monatliche Auszahlung der Aktiv-Verg&uuml;tung gewinnen k&ouml;nnen?");
+define('ADMIN_BONUS_NO_ACTIVE_RALLYE', "Niemand nimmt an der Aktiv-Rallye dran teil!");
+define('BONUS_SHOW_TURBO_BONUS', "Sehen Sie hier nach, wer alles schon best&auml;tigt hat...");
+define('BONUS_SHOW_WRONG_CALL', "Falscher Aufruf des Scriptes, bitte nur aus dem Best&auml;tigungsframe aufrufen!");
+define('BONUS_SHOW_WRONG_TYPE', "Falscher Typ an das Script &uuml;bergeben! Bitte melden Sie sich <A href=\"mailto:{!WEBMASTER!}\">beim Webmaster</A> !");
+define('BONUS_SHOW_NO_DATA', "Entweder haben Sie f&uuml;r diese Mail keine Aktiv-Verg&uuml;tung erhalten oder der Link ist nicht mehr g&uuml;ltig.");
+define('BONUS_NO_RANKS_1', "Es hat noch niemand {!POINTS!} zur Mail <U>");
+define('BONUS_NO_RANKS_2', "</U> gewonnen! Sie k&ouml;nnten der erste sein! :-)");
+define('BONUS_LOGIN_TURBO_NOTE', "Der Login-, Referral-, Klickrate-, Mailbuchungs-  und Best&auml;tigungsbonus wird Ihnen nicht sofort verg&uuml;tet, sondern erst am Ende jeden Monats in Form einer Aktiv-Rallye. Den Mailbuchungsbonus erhalten Sie erst bei Freischaltung Ihrer Mail auf das Bonus-Konto gutgeschrieben.");
+define('BONUS_POINTS_TITLE', "Sonderbonus-{!POINTS!}");
+define('BONUS_RANK_YOU_ARE_NOT_FOUND', "Sie haben bis jetzt noch keine Aktiv-Verg&uuml;tung erhalten!");
+define('BONUS_RANK', "Platz");
+define('BONUS_SHOW_FOOTER_NOTE_1', "Wir w&uuml;nschen allen Gewinnern viel Gl&uuml;ck bei der monatlichen Aktiv-Rallye!");
+define('BONUS_SHOW_FOOTER_NOTE_2', "Es k&ouml;nnen nur die ersten {!__BONUS_TOTAL_RANKS!} die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.");
+define('BONUS_SHOW_HEADER_LINE_1', "Hier sehen Sie eine &Uuml;bersicht, wer alles");
+define('BONUS_SHOW_HEADER_LINE_2', "f&uuml;r die Mail");
+define('BONUS_SHOW_HEADER_LINE_3', "erhalten hat");
+define('BONUS_SHOW_YOU_HAVE_CONFIRMED', "Sie haben diese Mail am");
+define('BONUS_SHOW_CONFIRMED_BONUS_IS', "Stelle best&auml;tigt. Ihre Gutschrift f&uuml;r diese eMail");
+define('BONUS_TOTAL', "Gesamtbonus");
+define('BONUS_RALLYE_NO_ONE_JOINED', "Niemand nimmt an unserer Aktiv-Rallye dran teil. :-(");
+define('BONUS_RALLYE_NOTE', "Bitte beachten Sie, dass Ihr Login-Bonus hier nicht mit angezeigt wird. Bei der monatlichen Auswertung wird er Ihnen jedoch gutgeschrieben.");
+define('BONUS_RALLYE_CONDITIONS', "Wer alles an der Aktiv-Rallye teilnehmen kann");
+define('BONUS_RALLYE_CONDITION_1', "Es werden nur aktive und freigeschaltete Mitglieder ber&uuml;cksichtig.");
+define('BONUS_RALLYE_CONDITION_2', "Der Login-Bonus wird bei der Auswertung nicht beachtet, aber dem Mitglied gutgeschrieben.");
+define('BONUS_RALLYE_CONDITION_3', "Es kann jeder dran teilnehmen, der Mitglied bei diesem {!MT_WORD!} (<STRONG>{--MAIN_TITLE--}</STRONG>) und freigegeben ist.");
+define('BONUS_RALLYE_CONDITION_4', "Zur Erstellung des Rallye-Ergebnisses wird nur die Aktiv-Verg&uuml;tung ber&uuml;cksichtig, welche Sie beim Best&auml;tigen von Mails erhalten k&ouml;nnen.");
+define('BONUS_RALLYE_CONDITION_5', "Der Rechtsweg ist ausgeschlossen.");
+define('BONUS_START_CONFIRMING_MAILS', "Hier sind Ihre unbest&auml;tigten Mails...");
+define('BONUS_MEMBER_HERE_IS_THE_LIST', "Hier finden Sie die aktuelle Liste mit den m&ouml;glichen Gewinnern!");
+define('BONUS_MONTHLY_ONLINE_BONUS', "Gewonnen: Monatliche Aktiv-Rallye");
+define('BONUS_TURBO_TOTAL2', "Aktiv-Bonus");
+define('ADMIN_BONUS_WITHDRAW_NOW', "Jetzt Aktiv-Bonus verg&uuml;ten");
+define('ADMIN_BONUS_WITHDRAW_NOTE', "Es wird nur die Verg&uuml;tung vorbereitet. Die eigentliche Verg&uuml;tung erfolgt beim T&auml;glichen Reset um 00:00 Uhr!");
+define('ADMIN_BONUS_WITHDRAW_PREPARED', "Verg&uuml;tung des Aktiv-Bonuses vorbereitet.");
+define('ADMIN_BONUS_WINNER_HIGLIGHTED', "M&ouml;gliche Gewinner der Aktiv-Rallye sind dick marktiert.");
+define('ADMIN_BONUS_ALREADY_WITHDRAW', "Manuelle Verg&uuml;tungvorbereitung bereits bet&auml;tigt!");
+define('ADMIN_BONUS_TIMEOUT_1', "Es werden nur Mitglieder ausgewertet und hier aufgelistet, die sp&auml;testens am ");
+define('ADMIN_BONUS_TIMEOUT_2', "noch aktiv waren. Alle anderen Mitglieder erhalten die Verg&uuml;tung nicht!");
+define('ADMIN_BONUS_USERID', "Mitgliedskonto zum Abbuchen der {!POINTS!}");
+define('ADMIN_CONFIG_BONUS_TIMEOUT', "Verweildauer von Aktiv-Bonus-Eintr&auml;gen");
+define('ADMIN_BONUS_TURBO_LINES', "Anzahl angezeigter Aktiv-Bonus-Empf&auml;nger in <STRONG>show_bonus.php</STRONG>");
+define('ADMIN_SEND_BONUS_MAILS', "Versenden von Bonus-Mails");
+define('ADMIN_SEND_BONUS_NORMAL', "Text-Mail versenden");
+define('ADMIN_SEND_BONUS_HTML', "HTML-Mail versenden");
+define('ADMIN_SEND_BONUS_NORMAL_NOTES', "Standart Text-Mail an Ihre Mitglieder aussenden.");
+define('ADMIN_SEND_BONUS_HTML_NOTES', "HTML-Mail an Ihre Mitglieder versenden. Dazu muss die Erweiterung html_mail jedoch installiert sein!");
+define('ADMIN_BONUS_ORDER_BONUS', "Bonus f&uuml;r eine Mailbuchung");
+define('ADMIN_BONUS_REF_BONUS', "Bonus f&uuml;r das Werben eines weiteren Mitgliedes");
+define('ADMIN_BONUS_STATS_BONUS', "Einmalige Bonus bei Erreichen von 100% Klickrate auf eine Mailbuchung (=<STRONG class=\"tiny\">Statistik-Bonus</STRONG>)");
+define('ADMIN_BONUS_TURBO_BONUS_TITLE', "Bonus-{!POINTS!} f&uuml;r best&auml;tigte Mails");
+define('ADMIN_BONUS_TURBO_TIMEOUT_TITLE', "Zeitabst&auml;nde und Aufbewahrungszeiten");
+define('ADMIN_BONUS_TURBO_MISC_TITLE', "Sonstige Einstellungen zur Bonus-Erweiterung");
+define('BONUS_REF_TOTAL', "Referral-Bonus");
+define('BONUS_ORDER_TOTAL', "Mailbestellungsbonus");
+define('BONUS_STATS_TOTAL', "100%-Klickratebonus");
+define('BONUS_POINTS_DISABLED', "Aktiv-Rallye derzeit nicht aktiv.");
+define('BONUS_MEMBER_STATS_SUBJECT', "Ihr Aktiv-Bonus wegen 100% Klickrate");
+define('BONUS_LOGIN_BONUS_ADDED_1', "Login-Bonus mit");
+define('BONUS_LOGIN_BONUS_ADDED_2', "verg&uuml;tet!");
+define('BONUS_LOGIN_BONUS_NOT_ADDED', "Login-Bonus nicht verg&uuml;tet!");
+define('LIST_UNCONFIRMED_BONUS_LINKS', "Unbest. Bonus-Mail");
+define('ADMIN_BONUS_MAIL_ALREADY_DELETED', "Bonus-Mail bereits gel&ouml;scht!");
+define('ADMIN_ACTIVATE_BONUS_SETTINGS', "Einstellungen an der Aktiv-Rallye");
+define('BONUS_MEMBER_TOTAL', "Gesamtbonus aller teilnehmenden Mitglieder");
+define('ADMIN_BONUS_RALLYE_DEACTIVATED', "Aktiv-Rallye deaktiviert.");
+define('ADMIN_BONUS_RALLYE_NOTIFTICATIONS', "Benachrichtigungen per Mail &uuml;ber Bonus-Rallye");
+define('ADMIN_BONUS_RALLYE_EN_NOTIFY', "Sollen die Mitglieder bei Aktivierung benachtichtigt werden?");
+define('ADMIN_BONUS_RALLYE_DI_NOTIFY', "Sollen die Mitglieder bei Deaktivierung benachtichtigt werden?");
+define('ADMIN_BONUS_RALLYE_NOTIFY_POINTS', "Bonus-Mail mit Anzahl {!POINTS!} aussenden, wenn Bonus-Rallye aktiviert wurde. <FONT class=\"admin_note\">(0 = Unverg&uuml;tete Benachrichtigung aussenden)</FONT>");
+define('ADMIN_BONUS_RALLYE_NEW_MEMBER_NOTIFY', "Sollen neue Mitglieder mit selber Mail &uuml;ber eine laufende Bonus-Rallye benachrichtigt werden?");
+define('ADMIN_BONUS_RALLYE_NOTIFY_WAIT', "Wie lange soll die Wartezeit der Bonus-Mail sein?");
+define('ADMIN_BONUS_INCLUDE_OWN', "Soll Ihre Mitglieder-ID an der Aktiv-Rallye dran teilnehmen?");
+
+// Switches
+define('ADMIN_BONUS_RALLYE_IS_ACTIVE'    , "Ist die Aktiv-Rallye aktiv?");
+define('ADMIN_BONUS_RALLYE_LOGIN_INCLUDE', "Login-Bonus in monatlicher Auswertung mit einschliessen?");
+define('ADMIN_BONUS_RALLYE_ORDER_INCLUDE', "Mailbuchungsbonus in monatlicher Auswertung mit einschliessen?");
+define('ADMIN_BONUS_RALLYE_STATS_INCLUDE', "Statistik-Bonus in monatlicher Auswertung mit einschliessen?");
+define('ADMIN_BONUS_RALLYE_CLICK_INCLUDE', "Mailbest&auml;tigungsbonus in monatlicher Auswertung mit einschliessen?");
+define('ADMIN_BONUS_RALLYE_REF_INCLUDE'  , "Referral-Bonus in monatlicher Auswertung mit einschliessen?");
+
+// Subject lines
+define('BONUS_RALLYE_EN_NOTIFY', "HINWEIS: Aktiv-Rallye ist am Laufen!");
+
+//
+?>
diff --git a/inc/language/cache_de.php b/inc/language/cache_de.php
new file mode 100644 (file)
index 0000000..66f0b04
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2004 *
+ * ===============                              Last change: 10/11/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : cache_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('CACHE_PROBLEMS_DETECTED', "Probleme mit dem Cache-Subsystem erkannt!");
+define('CACHE_CANNOT_LOAD_1', "Kann nicht Cache-Datei <STRONG><U>");
+define('CACHE_CANNOT_LOAD_2', "</U></STRONG> laden!");
+define('CACHE_CANNOT_INITIALIZE', "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation <STRONG>DOCS/de/cache/README.txt</STRONG> lesen!");
+define('ADMIN_CACHE_STATS_TITLE', "Statistiken des Caching-Systems");
+define('ADMIN_CACHE_DB_HITS', "Zugriffe auf die Datenbank");
+define('ADMIN_CACHE_HITS', "Zugriffe auf den Cache");
+define('ADMIN_CACHE_PERCENTS', "Prozentual (*)");
+define('ADMIN_CACHE_NOTES', "(*): Sollten bei Ihnen die Prozente unter 50&#37; liegen und Sie nicht vor September 2008 das Script *neu* installiert haben, so ist dies kein Grund zur Besorgnis. Im Normalfall sollten die Prozente seit eigenen Revisionen im September 2008 (R300+) &uuml;ber 50&#37; liegen.");
+define('ADMIN_TOTAL_HITS', "Gesamtzugriffe");
+define('CACHE_CANNOT_UNLINK_1', "Kann nicht die Cache-Datei <STRONG><U>");
+define('CACHE_CANNOT_UNLINK_2', "</U></STRONG> vom Server entfernen!");
+
+// Administrative settings
+define('ADMIN_CONFIG_CACHE_SETTINGS', "Caching-Einstellung");
+define('ADMIN_CACHE_ADMINS', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_admins</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_ACLS', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_admins_acls</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_EXTS', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_extensions</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_CONFIG', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_config</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_MODREG', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_mod_reg</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_REFDEPTH', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_refdepths</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_REFSYS', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_refsystem</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_THEMES', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_themes</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_ADMIN_MENU', "Soll der Aufbau des Administratormen&uuml;s beschleunigt werden (EXPERIMENTELL!)?");
+define('ADMIN_CACHE_PATH', "Relativer Pfad f&uuml;r alle Cache-Dateien zum Pfad <STRONG>inc</STRONG>");
+
+//
+?>
diff --git a/inc/language/country_de.php b/inc/language/country_de.php
new file mode 100644 (file)
index 0000000..ebb1d03
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/30/2005 *
+ * ===============                              Last change: 04/30/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : country_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_ADD_COUNTRY_CODE', "L&auml;ndercode hinzuf&uuml;gen");
+define('ADMIN_ENTER_COUNTRY_CODE', "Zweistelligen L&auml;dercode eingeben (z.B. PL)");
+define('ADMIN_ENTER_COUNTRY_NAME', "L&auml;ndernamen eingeben (z.B. Polen)");
+define('ADMIN_COUNTRY_CODE_ACTIVE', "Soll der L&auml;ndercode angezeigt werden?");
+define('ADD_COUNTRY', "Land hinzuf&uuml;gen");
+define('ADMIN_COUNTRY_NO_CODES_SETUP', "Noch keine L&auml;ndercodes eingerichtet!");
+define('ADMIN_LIST_COUNTRIES', "L&auml;ndercodes auflisten");
+define('ADMIN_COUNTRY_CODE', "Code");
+define('ADMIN_COUNTRY_NAME', "Name");
+define('ADMIN_COUNTRY_STATUS', "Anzeigen?");
+define('ADMIN_COUNTRY_ALREADY_1', "L&auml;ndercode <U>");
+define('ADMIN_COUNTRY_ALREADY_2', "</U> existiert bereits!");
+define('ADMIN_COUNTRY_ADDED_1', "L&auml;ndercode f&uuml;r Land <U>");
+define('ADMIN_COUNTRY_ADDED_2', "</U> hinzugef&uuml;gt.");
+define('ADMIN_COUNTRY_EDIT_NOW', "L&auml;ndercodes &auml;ndern");
+define('ADMIN_COUNTRY_DELETE_NOW', "L&auml;ndercodes l&ouml;schen");
+define('ADMIN_COUNTRY_EDIT_TITLE', "L&auml;ndercodes &auml;ndern");
+define('ADMIN_COUNTRY_DELETE_TITLE', "L&auml;ndercodes l&ouml;schen");
+define('ADMIN_COUNTRIES_MODIFIED', "L&auml;ndercode(s) ge&auml;ndert.");
+define('ADMIN_COUNTRIES_REMOVED', "L&auml;ndercode(s) gel&ouml;scht.");
+define('COUNTRY_NOT_FOUND', "Land nicht gefunden!");
+
+//
+?>
diff --git a/inc/language/de.php b/inc/language/de.php
new file mode 100644 (file)
index 0000000..170057c
--- /dev/null
@@ -0,0 +1,1180 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/26/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : de.php                                           *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterst&uuml;tzung                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language identifier
+define('__LANG_ID', "Deutsch (Dtl.)");
+
+// Installation/setup
+define('CONFIG_IS_WRITE_PROTECTED', "Die Konfigurationsdatei <strong>inc/config.php</strong> ist schreibgesch&uuml;tzt. Bitte setzen Sie CHMOD 666 auf die Datei!");
+define('DUMMY_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis!");
+define('SECRET_IS_WRITE_PROTECTED', "In dem Verzeichnis <strong>inc/.secret/</strong> kann keine Datei erzeugt werden. Bitte setzen Sie CHMOD 777 auf das Verzeichnis oder probieren Sie auch 770 aus!");
+
+// Language constants
+define('_TABLE', "Tabelle");
+define('_SIZE', "Gr&ouml;&szlig;e");
+define('_STATUS', "Status");
+define('_SPACESAVED', "Freigegeben");
+define('_ORESULT', "Optimization Resultat");
+define('_OJETZT', "Jetzt freigegeben");
+define('_ONR', "Sie haben bereits ");
+define('_ONRR', "mal die Tabellen optimiert");
+define('_OGESAMT', "KiloByte Gesamt optimiert");
+define('_WOPT', "wurde bereits optimiert");
+define('_OKOPT', "Optimiert!");
+define('LANG_DOWN_MAINTAINCE', "System wegen Wartungsarbeiten geschlossen!");
+define('LANG_MOD_REG_404_1', "Modul <U>");
+define('LANG_MOD_REG_404_2', "</U> existiert nicht!");
+define('LANG_MOD_NOT_REG', " ist nicht registriert!");
+define('LANG_UNKNOWN_MODULE', "Unbekanntes Modul");
+define('META_YOUR_NAME_1', "Ihr Name hier");
+define('META_YOUR_NAME_2', "Ihr Name nochmal");
+define('META_DESCRIPTION', "Beschreibung Ihrer Webseite hier");
+define('META_KEYWORDS', "mailtausch, mailversand, kostenlos, kostenloser, mailexchange, werbemail, werbemailversand, exchange, werbepunkte, punkte, auktion, auktionen, umsonst, sms kostenlos, produkte, produktproben, gewinn, gewinnspiel, gratis sms, promotion, besucher, werbung, linkliste, geldverdienen, verdienen, traffic, hits");
+define('LANG_WARNING', "Warnung");
+define('DIE_CONFIG_CHANGED_YOU', "Sie haben Ihre Config-Datei editiert! Auf Wiedersehen...");
+define('DIE_RUN_INSTALL_MYSQL', "Bitte rufen Sie http://your-domain.com/install.php auf, um Ihre MySQL-Daten einzurichten!");
+define('WARN_NULL_PASSWORD', "Sie haben kein Passwort eingegeben! Bitte lesen Sie in der <strong>inc/config.php</strong> nach, wie Sie diese Warnung abschalten k&ouml;nnen.");
+define('FATAL_CONFIG_WRITABLE', "Ihre Datei inc/config.php ist beschreibbar! Dies ist ein m&ouml;gliches Sicherheitsrisiko!");
+define('FATAL_CANNOT_WRITE_CONFIG', "Kann Konfigurationsdaten nicht speichern, da ich keinen Schreibzugriff auf inc/config.php habe!");
+define('FATAL_CANNOT_CREATE_TMP', "Kann eine tempor&auml;re Datei nicht erzeugen! Bitte setzen Sie CHMOD 777 auf Verzeichnis inc!");
+define('FATAL_ERROR', "Fataler Fehler");
+define('LANG_NO_RENDER_DIRECT', "Sie haben weder 'render' noch 'direct' als Ausgabe-Modus eingestellt!");
+define('INSTALLATION', "Installation des Scriptes");
+define('INSTALL_PROBLEMS_DETECTED', "Es wurden bei der Initialisierung des Installationsvorganges Probleme festgestellt!");
+define('FATAL_NO', "Fataler Fehler Nr. #");
+define('FATAL_CORRECT_ERRORS', "Kann nicht fortsetzen! Bitte korregieren Sie erst die obrigen Probleme und versuchen Sie es dann erneut!");
+define('YES', "Ja");
+define('NO', "Nein");
+define('RETURN_MYSQL_PAGE', "Zur&uuml;ck zu den MySQL-Einstellungen");
+define('INSTALL_FINALIZER_FAILED', "W&auml;hrend der Installation ist ein unerwarteter Fehler aufgetreten! Der Finalizer konnte die Installation nicht abschliessen!");
+define('INSTALL_MAYBE_DONE', "Die Installation ist m&ouml;glicherweise abgeschlossen oder es ist ein unerwarteter Fehler aufgetreten!");
+define('INSTALL_FINISHED', "Die Installation ist abgeschlossen! :-)");
+define('INSTALL_FIN_SECU', "<strong><U>Sicherheitshinweise:</U></strong><br />Installieren Sie eine .htaccess Datei in alle Unterverzeichnisse ab dem Verzeichnis inc!");
+define('CONTINUE_ADMIN', "Weiter zum Administrationsbereich...");
+define('RUNTIME_PROBLEMS_DETECTED', "Laufzeit-Problem erkannt!");
+define('FATAL_INC_WRITABLE', "Das Verzeichnis inc ist beschreibbar! Bitte setzen Sie die Zugriffsrechte auf 755 oder 555.");
+define('LANG_WRITE_FOOTER', "Scriptname, -version und -author anzeigen?");
+define('LANG_FRAMESET_ACTIVE', "Soll das Frameset aktiviert werden? (Wenn nein wird ein Table-Set aktiviert)");
+define('MYSQL_ERRORS', "Es sind MySQL-Fehler aufgetreten! Bitte korregieren Sie diese!");
+define('LANG_MOD_UNKNOWN_1', "Der Return-Code <U>");
+define('LANG_MOD_UNKNOWN_2', "</U> ist unbekannt!");
+define('LANG_MOD_LOCKED_1', "Das Modul <U>");
+define('LANG_MOD_LOCKED_2', "</U> wurde gesperrt!");
+define('ADMIN_UNKNOWN_ACTION_1', "Unbekannte Admin-Aktion <U>");
+define('ADMIN_UNKNOWN_ACTION_2', "</U> erkannt! Bitte das Modul richtig aufrufen!");
+define('ADMIN_ACTION_404_1', "Admin-Modul f&uuml;r Aktion <U>");
+define('ADMIN_ACTION_404_2', "</U> nicht gefunden!");
+define('ADMIN_NOT_REGISTERED', "Es ist noch kein Administrator-Account angelegt worden.");
+define('ADMIN_REGISTER_NOW', "Legen Sie jetzt das Administrator-Account an:");
+define('ADMIN_LOGIN', "Geben Sie ein Administrator-Login ein");
+define('ADMIN_PASS', "Geben Sie das Passwort ein");
+define('CLEAR_FORM', "Nochmal eingeben");
+define('ADMIN_REG_SUBMIT', "Admin-Account erstellen");
+define('ADMIN_NO_LOGIN', "Sie haben keinen Loginnamen eingegeben!");
+define('ADMIN_NO_PASS', "Sie haben kein Passwort eingegeben!");
+define('ADMIN_SHORT_PASS', "Das Passwort ist zu kurz! Mindestens 4 Zeichen!");
+define('ADMIN_LOGIN_ALREADY_REG', "Das von Ihnen eingegebene Admin-Login existiert bereits!");
+define('ADMIN_REGISTER_FAILED', "Bei der Registrierung eines Admin-Accounts ist ein unerwarteter Fehler unterlaufen!");
+define('ADMIN_REGISTER_DONE', "Das Admin-Account wurde soeben erstellt. Sie k&ouml;nnen sich nun mit den eingegeben Login-Daten einloggen.");
+define('ADMIN_CANNOT_COMPLETE', "Kann die Regsitrierung des Admin-Accounts nicht abschliessen!");
+define('ADMIN_LOGIN_NOW', "Sie k&ouml;nnen sich nun in den Administratorbereich einloggen.<br />Geben Sie dazu Ihren Admin-Login (nicht Mitglied-Login!) und das Passwort dazu ein.");
+define('ENTER_ADMIN_LOGIN', "Administrator-Login");
+define('ENTER_ADMIN_PASS', "Passwort zum Admin-Account");
+define('ADMIN_LOGIN_SUBMIT', "Einloggen zum Admin-Bereich");
+define('WRONG_PASS', "Falsches Passwort!");
+define('ADMIN_NOT_FOUND', "Administrator-Account wurde nicht gefunden!");
+define('ADMIN_LOGIN_FAILED', "Einloggen in den Administrator-Bereich fehlgeschlagen!");
+define('CANNOT_REGISTER_SESS', "Konnte eine Sitzungsvariable nicht setzen! Vermutlich sind bei Ihnen Cookies deaktiviert.");
+define('SELECT_TIMEOUT', "G&uuml;tigkeitsdauer des Auto-Logins");
+define('TIMEOUT_ONE_DAY', "1 Tag");
+define('TIMEOUT_TWO_DAYS', "2 Tage");
+define('TIMEOUT_THREE_DAYS', "3 Tage");
+define('TIMEOUT_ONE_WEEK', "1 Woche");
+define('TIMEOUT_TWO_WEEKS', "2 Wochen");
+define('TIMEOUT_ONE_MONTH', "1 Monat");
+define('TIMEOUT_HALF_YEAR', "1/2  Jahr");
+define('TIMEOUT_FULL_YEAR', "1 Jahr");
+define('ADMIN_LOGOUT_DONE', "Ausloggen aus dem Admin-Bereich abgeschlossen!");
+define('ADMIN_LOGOUT_FAILED', "Konnte nicht aus dem Admin-Bereich ausloggen! :-(");
+define('ADMIN_RELOGIN_LINK', "Klicken Sie hier, um sich erneut einzuloggen.");
+define('ADMIN_404_ACTION', "Admin-Modul nicht gefunden!");
+define('ADMIN_404_ACTION_1', "Das aufgerufe Admin-Modul <U>");
+define('ADMIN_404_ACTION_2', "</U> ist zwar g&uuml;ltig, konnte aber nicht auf dem Server gefunden werden.");
+define('ALREADY_INSTALLED', "Dieses Script ist bereits auf diesem Server installiert worden Bitte l&ouml;schen Sie install.php inc/install-inc.php und install.sql von Ihrem Server! (Keine Sorge, Sie k&ouml;nnen es tun...)");
+define('ADMIN_MAIN_TITLE', "Willkommen zum Administrationsbereich");
+define('YOU_ARE_HERE', "Sie sind hier:");
+define('ID_SELECT', "ID:");
+define('DISPLAY_ACTION', "Aktion");
+define('DISPLAY_WHAT', "Unteraktion");
+define('DISPLAY_TITLE', "Titel");
+define('UNDO_SELECTIONS', "Auswahl zur&uuml;cknehmen");
+define('EDIT_MENUS', "Men&uuml;s bearbeiten");
+define('DEL_MENUS', "Men&uuml;s l&ouml;schen");
+define('EDIT_ADMIN_MENU', "Admin-Men&uuml;eintr&auml;ge &auml;ndern");
+define('EDIT_MENU_1', "Es soll/sollen <strong>");
+define('EDIT_MENU_2', "</strong> Men&uuml;eintrag/-eintr&auml;ge ge&auml;ndert werden:");
+define('ENTRY_MODIFY', "Eintrag");
+define('SUBMIT_CHANGES', "&Auml;nderungen durchf&uuml;hren");
+define('ENTRY_404_1', "Eintrag <I>");
+define('ENTRY_404_2', "</I> wurde nicht gefunden!");
+define('EDIT_UNKNOWN_OKAY', "Es wurde eine unbekannte Aktion durchgef&uuml;hrt!");
+define('SAVING_DATA', "Speichere Daten ab");
+define('SAVING_DONE', "Speicherung beendet!");
+define('DEL_ADMIN_MENU', "Admin-Men&uuml;eintr&auml;ge l&ouml;schen");
+define('DEL_MENU_1', "Es soll/sollen <strong>");
+define('DEL_MENU_2', "</strong> Men&uuml;eintrag/-eintr&auml;ge gel&ouml;scht werden:");
+define('DEL_ENTRIES', "Eintr&auml;ge unwiederruflich l&ouml;schen");
+define('EDIT_ACTION', "Aktionswert &auml;ndern");
+define('EDIT_WHAT', "Unteraktionswert &auml;ndern");
+define('EDIT_TITLE', "Linktitel &auml;ndern");
+define('ADMIN_ADD_MENU', "Men&uuml; hinzuf&uuml;gen");
+define('ENTER_TITLE', "Geben Sie den Linktitel zum neuen Men&uuml;punkt ein");
+define('SELECT_PARENT_MENU', "W&auml;hlen Sie das &uuml;bergeordnete Hauptmen&uuml; aus");
+define('IS_TOP_MENU', "Ist ein Hauptmen&uuml;");
+define('SELECT_WHAT_NAME', "W&auml;hlen Sie den passenden Suffix aus der Liste aus");
+define('ENTER_DESCR', "Geben Sie eine kurze aussagekr&auml;ftige Beschreibung des Men&uuml;punktes ein");
+define('SELECT_BELOW_MENU', "W&auml;hlen Sie den Men&uuml;punkt aus, unterhalb dem der neue Punkt erscheinen soll");
+define('EDIT_DESCR', "Beschreibung &auml;ndern");
+define('CREATE_WHAT_FIRST', "Bitte erstellen Sie zuerst die what-xxxxx.php Datei. Dann k&ouml;nnen Sie sie hier ausw&auml;hlen.");
+define('MENU_IS_VISIBLE', "Men&uuml;punkt ist sichtbar");
+define('MENU_IS_ACTIVE', "Men&uuml;punkt ist aktiviert");
+define('CREATE_ACTION_FIRST', "Bitte erstellen Sie zuerst die action-xxxxx.php Datei. Dann k&ouml;nnen Sie sie hier ausw&auml;hlen.");
+define('IS_FIRST_MENU', "Ist das erste Hauptmen&uuml;");
+define('NO_DB_LINK', "Keine Verbindung zur Datenbank!");
+define('MYSQL_DATA_MISSING', "Die Konfiguration Ihrer Datenbankverbindung ist unnvollst&auml;ndig. Bitte in inc/config.php mindestens den Hostnamen, Datenbanknamen und Login zur Datenbank eingeben.");
+define('REGISTER_PERSONAL_DATA', "Pers&ouml;nliche Daten");
+define('REGISTER_CATEGORIES', "Interessengebiete");
+define('REGISTER_MISC', "Passwort, maximale Mails pro Tag etc.");
+define('SURNAME', "Vorname");
+define('FAMILY_NAME', "Nachname");
+define('STREET_NR', "Stra&szlig;e + Hausnummer");
+define('COUNTRY', "Land");
+define('ZIP', "Postleitzahl");
+define('CITY', "Wohnort");
+define('ADDY', "Email-Adresse");
+define('BIRTHDAY', "Geburtstag (TT.MM.JJJJ)");
+define('PASS_1', "Passwort");
+define('PASS_2', "Passwortbest&auml;tigung");
+define('ADD_NEW_CATEGORY', "Neue Kategorie hinzuf&uuml;gen");
+define('ENTER_CATNAME', "Kategoriebezeichnung");
+define('SELECT_PARENT', "Unter welcher Kategorie soll diese eingeblendet werden?");
+define('IS_TOP_CATEGORY', "Ist oberste Kategorie");
+define('ADD_NEW_CAT', "Neue Kategorie dazuf&uuml;gen");
+define('CAT_IS_VISIBLE', "Kategorie wird eingeblendet?");
+define('CATEGORY_ADDED', "Kategorie wurde hinzugef&uuml;gt");
+define('CATEGORY_ALREADY_EXISTS', "Kategorie existiert bereits!");
+define('EDIT_DEL_CATEGORIES', "Aufgelistete Kategorien bearbeiten / l&ouml;schen");
+define('CATNAME', "Kategoriebezeichnung:");
+define('EDIT_CATS', "Kategorien bearbeiten");
+define('DEL_CATS', "Kategorien l&ouml;schen");
+define('NO_CATEGORIES_VISIBLE', "Derzeit sind keine Kategorien anzeigbar!");
+define('MAX_RECEIVE', "Wie viel Mails sollen Ihre Mitglieder maximal empfangen k&ouml;nnen? F&uuml;gen Sie bitte mehrere Werte hinzu, damit sich die Mitglieder dies individuell einstellen k&ouml;nnen.");
+define('ADD_MAX_RECEIVE', "Hinzuf&uuml;gen");
+define('SAVE_SETTINGS', "Einstellungen speichern");
+define('ENTER_MAX_VALUE', "Neuen Maximal-Wert (0 bis 9999)");
+define('ENTER_MAX_COMMENT', "Optionaler Hinweis (erscheint in Klammern hinter dem Wert!)");
+define('MAX_VALUE_SAVED', "Maximal-Wert gespeichert");
+define('MAX_VALUE_ALREADY', "Maximal-Wert existiert bereits!");
+define('EDIT_DEL_MAX_VALUES', "Maximal-Werte bearbeiten / l&ouml;schen");
+define('MAX_VALUE', "Maximal zu empfangene Mails");
+define('MAX_COMMENT', "Hinweis zum Maximal-Wert");
+define('EDIT_MAX_V', "Bearbeiten");
+define('DEL_MAX_V', "L&ouml;schen");
+define('NO_MAX_VALUES', "Derzeit klappt die Anmeldung nicht, da Sie keine maximal zu empfangenen Mails einstellen k&ouml;nnen!");
+define('MAX_PER_DAY', "Maximale Mitgliedermails/Tag");
+define('PER_DAY', "Mails");
+define('REFID_BY', "Sie wurden geworben von");
+define('TERMS_OF_USAGE', "AGBs zustimmen und absenden");
+define('YOU_FINALIZE', "Sie haben es gleich geschafft!");
+define('AGREE_TO_THIS', "Stimmen Sie unseren [<A href=\"".URL."/modules.php?module=index&amp;what=agb\" class=\"register_term\" target=\"_blank\">AGBs</A>] zu?");
+define('SUBMIT_REGISTER', "Anmeldedaten abschicken");
+define('HAVE_TO_AGREE', "Sie m&uuml;ssen unseren AGBs zustimmen, damit Sie an diesem {!MT_WORD!} teilnehmen k&ouml;nnen!");
+define('ENTER_BOTH_PASSWORDS', "Bitte geben Sie ein Passwort und das selbe Passwort noch einmal ein!");
+define('ENTER_PASS1', "Bitte geben Sie ein Passwort ein!");
+define('ENTER_PASS2', "Bitte geben Sie noch die Best&auml;tigung Ihres Passwortes ein!");
+define('ENTER_EMAIL', "Bitte geben Sie Ihre Email-Adresse ein! Diese muss auch erreichbar sein!");
+define('ENTER_SURNAME', "Bitte geben Sie Ihren Vornamen ein!");
+define('ENTER_FAMILY', "Bitte geben Sie Ihren Nachnamen ein!");
+define('EDIT_SECURITY_SETTINGS', "&Auml;ndern von sicherheits-relevanten Einstellungen");
+define('MIN_PASS_LENGTH', "Minimale Passwortl&auml;nge");
+define('SETTINGS_NOT_SAVED', "Einstellungen NICHT gespeichert / ge&auml;ndert!");
+define('SETTINGS_SAVED', "Einstellungen gespeichert.");
+define('FATAL_CANNOT_LOAD_CONFIG', "Kann die Konfigurationsdaten nicht laden! Vermutlich richtet der Webmaster diesen {!MT_WORD2!} gerade das Script erst ein! Bitte schauen Sie sp&auml;ter noch einmal vorbei!");
+define('ADMIN_INVALID_ACTION', "Ung&uuml;ltige action/what-Kombination erkannt! Bitte rufen Sie das Admin-Men&uuml; richtig auf!");
+define('ADMIN_INVALID_ACTION_1', "Die action/what-Kombination <U>");
+define('ADMIN_INVALID_ACTION_2', "</U> ist ung&uuml;ltig!");
+define('SHORT_PASS', "Das eingegebene Passwort ist nach unseren Sicherheitseinstellungen zu kurz. Mindestl&auml;nge ist");
+define('EDIT_POINTS_SETTINGS', "&Auml;ndern der Willkommensgutschrift und anderer {!POINTS!}");
+define('POINTS_REGISTER', "Willkommensgutschrift");
+define('POINTS_REF', "Einmalige Referral-Gutschrift");
+define('EDIT_REGFORM_SETTINGS', "Einstellungen am Anmeldeformular");
+define('LEAST_CATS', "Mindestens auszuw&auml;hlende Kategorieanzahl");
+define('CATS_LEAST', "Bitte w&auml;hlen Sie mehr Kategorien aus! Minimum ist");
+define('EMAIL_ALREADY_DB', "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.");
+define('REJECT_DOUBLE_EMAIL', "Doppelt angemeldete Email-Adressen ablehnen?");
+define('REJECT_DOUBLE_PASS', "Gleiche Passw&ouml;rter bei der Anmeldung ablehnen? (Wird nicht angezeigt!)");
+define('ADMIN_EDIT_POINTS', "Willkommensgutschrift und andere Festbetr&auml;ge editieren");
+define('ADMIN_EDIT_REFDEPTHS', "Referral-Ebenen editieren / l&ouml;schen / hinzuf&uuml;gen");
+define('ADD_NEW_REFDEPTH', "Neue Referral-Ebene hinzuf&uuml;gen");
+define('ADD_DEPTH', "Referral-Ebene hinzuf&uuml;gen");
+define('ENTER_REF_LVL', "Referral-Ebene");
+define('ENTER_REF_PERCENTS', "Prozentuale Verg&uuml;tung");
+define('EDIT_DEL_REFDEPTH', "Referral-Ebenen editieren / l&ouml;schen");
+define('REF_LEVEL', "Referral-Ebene");
+define('REF_PERCENT', "Prozentuale Verg&uuml;tung");
+define('EDIT_LVL', "Ref-Ebene editieren");
+define('DEL_LVL', "Ref-Ebene l&ouml;schen");
+define('HELLO', "Hallo");
+define('GUEST_YOU_REGISTERED_WITH_US', "vielen Dank, dass Sie sich f&uuml;r unseren {!MT_WORD!} entschieden haben! Sollten Sie dies nicht gewesen sein, so melden Sie sich bitte bei uns!");
+define('GUEST_YOUR_PERSONA_DATA', "Hier sind nochmals zur &Uuml;berpr&uuml;fung Ihre pers&ouml;nlichen Daten");
+define('GUEST_SURNAME', "Vorname");
+define('GUEST_FAMILY', "Nachname");
+define('GUEST_STREET_NR', "Stra&szlig;e und Hausnummer");
+define('GUEST_COUNTRY', "L&auml;ndercode");
+define('GUEST_ZIPCODE', "Postleitzahl");
+define('GUEST_CITY', "Wohnort");
+define('GUEST_ADDY', "Email-Adresse");
+define('GUEST_BIRTHDAY', "Geburtsdatum");
+define('GUEST_REF', "Geworben von");
+define('GUEST_YOUR_REFLINK', "Hier ist Ihr pers&ouml;nlicher Referral-Link, mit dem Sie bereits jetzt schon neue Mitglieder werben k&ouml;nnen:");
+define('GUEST_CONFIRM_LINK', "Ihr Best&auml;tigungslink");
+define('THANX', "Vielen Dank.\n\nMit freundlichem Gruss,");
+define('YOUR', "Ihr");
+define('TEAM', "Team");
+define('HELLO_ADMIN', "Hallo Administrator");
+define('ADMIN_GUEST_REGISTERED_WITH_US', "Ein Gast hat sich soeben bei uns angemeldet.");
+define('ADMIN_GUEST_PERSONA_DATA', "Hier sind zur &Uuml;berpr&uuml;fung nochmals seine pers&ouml;nlichen Daten");
+define('ADMIN_THANX', "Mit freundlichem Gruss,");
+define('SCRIPT', "Script");
+define('ADMIN_NEW_ACCOUNT', "Neue Anmeldung zu Ihrem {!MT_WORD!}");
+define('REGISTRATION_DONE', "Vielen Dank f&uuml;r die Anmeldung. Ein Best&auml;tigungslink ist zur angemeldeten EMail-Adresse unterwegs!");
+define('GUEST_404_ACTION_1', "Das angegeben Aktionsmodul <U>");
+define('GUEST_404_ACTION_2', "</U> existiert leider nicht, oder dieses Script hat einen Fehler gemacht!");
+define('GUEST_LOCKED_ACTION', "Aktionsmodul wurde gesperrt!");
+define('FATAL_REPORT_ERRORS', "Es wurde ein Problem w&auml;hrend der Abarbeitung von Anweisungen festgestellt. Wenn ein Modul gesperrt sein sollte, so wird vermutlich gerade dran gearbeitet, anderfalls melden Sie sich bitte bei uns!");
+define('TEMPLATE_404', "Template nicht gefunden!");
+define('EDIT_GUEST_MENU', "G&auml;stemen&uuml; bearbeiten");
+define('EDIT_MEMBER_MENU', "Mitgliedsmen&uuml; bearbeiten");
+define('DEL_GUEST_MENU', "G&auml;stemen&uuml; l&ouml;schen");
+define('DEL_MEMBER_MENU', "Mitgliedsmen&uuml; l&ouml;schen");
+define('GUEST_PASSWORD', "Ihr Passwort");
+define('GUEST_THANX_CONFIRMATION', "Sie haben soeben Ihre Email-Adresse best&auml;tigt und sind somit f&uuml;r den {!MT_WORD!} ".MAIN_TITLE." freigeschaltet!");
+define('GUEST_MAY_LOGIN_HERE', "Sie k&ouml;nnen sich nun hier einloggen:");
+define('HAPPY_MAILING', "Wir w&uuml;nschen Ihnen viel Spass und Erfolg beim Mail-Versand!\n\nMit freundlichem Gruss,");
+define('GUEST_THANX_CONFIRM', "Email-Adresse best&auml;tigt");
+define('GUEST_CONFIRMED_TWICE', "Sie haben bereits Ihre Email-Adresse best&auml;tigt oder Ihr Account ist derzeit gesperrt.");
+define('TOP', "Nach oben");
+define('YOUR_LOGIN', "Ihre Login-ID lautet");
+define('LOGIN_URL', "URL zum Login");
+define('GUEST_WELCOME_MEMBER', "Willkommen zum Login-Bereich f&uuml;r Mitglieder");
+define('GUEST_ENTER_LOGIN', "Login-ID");
+define('GUEST_ENTER_PASSWORD', "Passwort");
+define('LOGIN_SUBMIT', "Einloggen");
+define('GUEST_GET_NEW_PASS', "Neues Passwort zuschicken");
+define('GUEST_ENTER_EMAIL', "Angemeldete Email-Adresse");
+define('NEW_PASSWD', "Jetzt zuschicken!");
+define('GUEST_WRONG_ID_EMAIL', "Konnte Account-Daten nicht auffinden! Vermutlich haben Sie eine falsche Login-ID oder Email-Adresse eingegeben! Bitte probieren Sie es nochmal!");
+define('GUEST_NEW_PASS_1', "Sie oder ein anderes Mitglied");
+define('GUEST_NEW_PASS_2', "haben soben ein neues Passwort angefordert. Hier ist Ihr neues Passwort:");
+define('YOUR_NEW_PASS', "Neues Passwort");
+define('GUEST_NOT_THIS_REPORT', "Sollten Sie dies nicht gewesen sein, so melden Sie sich bitte bei uns!\n\nMit freundlichem Gruss,");
+define('GUEST_NEW_PASSWORD', "Ihre Passwortanfrage");
+define('LOGIN_UNKNOWN_CODE', "Unbekannter R&uuml;ckgabewert!");
+define('LOGIN_WRONG_PASS', "Falsches Passwort eingegben!");
+define('LOGIN_WRONG_ID', "Die Login-ID ist nicht mehr g&uuml;ltig!");
+define('LOGIN_ID_LOCKED', "Ihr Account wurde gesperrt!");
+define('LOGIN_ID_UNCONFIRMED', "Bitte best&auml;tigen Sie erst Ihre Email-Adresse!<br />Haben Sie den Best&auml;tigungslink verloren? Links im Men&uuml; k&ouml;nnen Sie ihn erneut anfordern.");
+define('LOGIN_NO_COOKIES', "Sie haben in Ihrem Browser entweder die Cookies ausgeschaltet, oder die Sicherheitsstufe ist zu hoch eingestellt!");
+define('GUEST_REG_POINTS_1', "F&uuml;r Ihre Anmeldung haben wir Ihnen als Willkommensgutschrift");
+define('GUEST_REG_POINTS_2', "{!POINTS!} gutgeschrieben. Sie k&ouml;nnen bereits jetzt schon Mails an die anderen Mitglieder verschicken - solange Empf&auml;nger auch erreichbar sind.");
+define('GUEST_SELECT_LIFETIME', "Wie lange soll Auto-Login aktiv sein?");
+define('LIFE_CLOSE_BROWSER', "Browser wurde geschlossen");
+define('LIFE_HOURS', "Stunde(n)");
+define('LIFE_DAYS', "Tag(e)");
+define('LIFE_WEEKS', "Woche(n)");
+define('LIFE_MONTHS', "Monat(e)");
+define('LIFE_YEARS', "Jahr(e)");
+define('LANG_MEM_ONLY_1', "Auf das ausgew&auml;hlte Modul <U>");
+define('LANG_MEM_ONLY_2', "</U> d&uuml;rfen nur eingeloggte Mitglieder zugreifen!");
+define('MEMBER_404_ACTION_1', "Das Mitgliedsaktionsmodul <U>");
+define('MEMBER_404_ACTION_2', "</U> ist nicht auffindbar!");
+define('_GUEST', "Gast");
+define('_UNKNOWN', "Name ist nicht ladbar");
+define('_ADMIN', "Administrator");
+define('_ADMIN_SHORT', "Admin");
+define('LAST_ONLINE', "Sie waren als letztes Online am");
+define('LAST_MODULE', "Ihr zuletzt ausgew&auml;hltes Modul");
+define('MEMBER_EDIT_PROFILE', "Profildaten &auml;ndern");
+define('GENDER', "Geschlecht");
+define('GUEST_GENDER', "Geschlecht");
+define('GENDER_M', "Herr");
+define('GENDER_F', "Frau");
+define('GENDER_C', "&quot;Firma&quot;");
+define('SAVE_CHANGES', "&Auml;nderungen speichern");
+define('MYDATA_NOTE', "Geben Sie nur bei <strong>Passwort</strong> Ihr aktuelles Passwort ein, wenn Sie nur Daten &auml;ndern wollen. Geben Sie bei <strong>Passwortbest&auml;tigung</strong> das neue Passwort erneut ein, wenn Sie Ihr aktuelles Passwort &auml;ndern wollen.");
+define('MEMBER_UPDATE_PWD_WRONG', "Bitte geben Sie Ihr aktuelles Passwort zum &Auml;ndern Ihrer Einstellungen ein. Wir haben dies zur Sicherheit unserer Mitglieder eingebaut.");
+define('MEMBER_HAVE_CHANGED_DATA', "Sie haben heute Ihr Mitgliedsprofil ge&auml;ndert.");
+define('YOUR_NEW_DATA', "Hier sind Ihre neuen Profildaten");
+define('PLEASE_NOTIFY_ABUSE_MYDATA', "Sollten Sie diese &auml;nderungen nicht durchgef&uuml;hrt haben, benachrichten Sie uns bitte! (".WEBMASTER.")");
+define('MEMBER_UNKNOWN_MODE', "Unbekannter Modus erkannt");
+define('MEMBER_CHANGED_EMAIL', "Sie haben Ihre Email-Adresse ge&auml;ndert! Alte Adresse war");
+define('MEMBER_CHANGED_PASS', "Sie haben Ihr Passwort ge&auml;ndert.");
+define('MEMBER_CHANGED_DATA', "&auml;nderung Ihrer Profildaten");
+define('MYDATA_MAIL_SENT', "Es ist eine Email zu Ihnen unterwegs.");
+define('ADMIN_CHANGED_DATA', "Profildaten geaendert");
+define('ADMIN_MEMBER_CHANGED_PROFILE', "Eines Ihrer Mitglieder hat seine Profildaten ge&auml;ndert!");
+define('MEMBER_UID', "Seine Login-ID lautet");
+define('LOGOUT_DONE', "Ausloggen abgeschlossen!");
+define('LOGOUT_FAILED', "Ausloggen fehlgeschlagen!");
+define('MEMBER_NO_CATS', "Es wurden bis jetzt noch keine Kategorien eingerichtet!");
+define('SELECT_CAT', "Mails aus Kategorie empfangen?");
+define('MEMBER_CATS_SAVED', "Kategorien gespeichert.");
+define('YOUR_PERSONAL_REFLINK', "Ihr pers&ouml;nlicher Ref-Link zum Werben neuer Mitglieder lautet");
+define('YOUR_REFCLICKS', "Klicks auf Ihren Referral-Link");
+define('CLICKS', "Klicks");
+define('YOU_REFERRAL_ONE', "Sie haben heute ein neues Mitglied f&uuml;r unseren {!MT_WORD!} geworben!\n\nHier sehen Sie genau, in welcher Ebene Sie ihn geworben haben:");
+define('YOU_THANX_REFERRAL', "Sie werden nun auch weiterhin {!POINTS!} &uuml;ber diese geworbene Person erhalten.\n\nVielen Dank f&uuml;r Ihr Mitwerben! Wir w&uuml;nschen Ihnen noch weiterhin viele neue Referrals!\n\nMit freundlichem Gruss,");
+define('POINTS_REF_REGISTER', "Referral-Pauschale und prozentual vom Anmeldebonus!");
+define('NO_REFLEVEL_LEFT', "Keine Referral-Ebenen mehr verf&uuml;gbar! Bitte melden Sie sich bei uns.");
+define('ENGINE', "{!MT_WORD!}-Engine");
+define('ADD_NEW_PAYMENT', "Neue Mailverg&uuml;tung hinzuf&uuml;gen");
+define('ENTER_PAY_TIME', "Wartezeit");
+define('ENTER_PAY_PAYMENT', "Verg&uuml;tete {!POINTS!}");
+define('ENTER_PAY_PRICE', "{!POINTS!}-Kosten");
+define('ENTER_PAY_TITLE', "Mailname");
+define('ADD_PAYMENT', "Mailverg&uuml;tung hinzuf&uuml;gen");
+define('EDIT_DEL_PAYMENT', "Mailverg&uuml;tung editieren / l&ouml;schen");
+define('PAY_TIME', "Wartezeit");
+define('PAY_PAYMENT', "Verg&uuml;tete {!POINTS!}");
+define('PAY_PRICE', "{!POINTS!}-Kosten");
+define('PAY_TITLE', "Mailname");
+define('EDIT_PAY', "Editeren");
+define('DEL_PAY', "L&ouml;schen");
+define('ADD_NEW_REFBANNER', "Neuen Banner hinzuf&uuml;gen");
+define('ENTER_URL', "Banner-URL");
+define('ENTER_ALTERNATE', "Alternativen Text");
+define('SELECT_VISIBLE', "Ist der Banner aktiv?");
+define('ADD_REFBANNER', "Banner hinzuf&uuml;gen");
+define('EDIT_DEL_REFBANNER', "Werbebanner editieren / l&ouml;schen");
+define('VIEWS', "Views");
+define('REF_URL', "Banner");
+define('REF_TITLE', "Alternativer Text");
+define('REF_CNTR', "Views");
+define('REF_VIS', "Aktiv?");
+define('POINTS_USED', "Verbrauchte {!POINTS!}");
+define('MEMBER_NO_POINTS', "Sie haben keine {!POINTS!} mehr zum Versenden &uuml;brig!");
+define('MEMBER_NO_PAYMENTS', "Der Admin diesen {!MT_WORD2!} hat noch keine Mailarten definiert!");
+define('MEMBER_POINTS_LEFT', "{!POINTS!}-Guthaben zum Mailversand &uuml;brig");
+define('SELECT_MAIL_TYPE', "Mailart ausw&auml;hlen");
+define('PLEASE_SELECT', "Bitte ausw&auml;hlen");
+define('PER_MAIL', "{!POINTS!} / Mail");
+define('PAYMENT', "{!POINTS!} Verg&uuml;tung");
+define('SELECT_CATEGORY', "Zielkategorie");
+define('USER_IN_CAT', "Empf&auml;nger");
+define('ENTER_RECEIVER', "Empf&auml;ngeranzahl");
+define('ENTER_SUBJECT', "Betreffzeile");
+define('ENTER_TEXT', "Werbetext");
+define('MEMBER_PLEASE_NOTE', "Bitte beachten Sie vor dem Absenden:");
+define('MEMBER_ENTER_URL', "URL");
+define('CONTINUE_FRAMETESTER', "Weiter zum Framekiller-Test");
+define('MEMBER_URL_TIME_LOCK', "Sie hatten bereits die selbe URL gebucht:");
+define('MEMBER_LAST_TLOCK', "Ihre letzte Buchung war am");
+define('CONFIG_URL_TLOCK', "Selbe URLs sind buchbar in");
+define('_AND', "und");
+define('UNKNOWN_CODE_1', "Es ist w&auml;hrend der Ausf&uuml;hrung ein unbekannter Fehler-Code <strong>");
+define('UNKNOWN_CODE_2', "</strong> enstanden, f&uuml;r den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns &uuml;ber diese Meldung!");
+define('MEMBER_TEXT_CONTAINS_URL', "Ihr Werbetext enth&auml;lt eine URL, dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrem Text und versuchen Sie es erneut.");
+define('MEMBER_TEXT_OVERLENGTH', "Ihr Text hat die maximale Textl&auml;nge &uuml;berschritten. Bitte fassen Sie ihn etwas k&uuml;rzer.");
+define('MEMBER_SUBJ_CONTAINS_URL', "Ihre eingegebe Betreffzeile enth&auml;lt eine URL,  dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrer Betreffzeile und versuchen Sie es erneut.");
+define('MEMBER_URL_BLACK_LISTED', "Ihre eingegebene URL wurde in unsere Ausschlussliste aufgenommen!");
+define('MEMBER_BLIST_TIME', "Datum der Sperrung war");
+define('MEMBER_SELECTED_MORE_RECS', "Sie haben f&uuml;r diese Kategorie zu viele Empf&auml;nger eingegeben!");
+define('MEMBER_GO_BACK', "Zur&uuml;ck zum Buchungsformular");
+define('MEMBER_DO_ORDER', "Mailbuchung so aufgeben!");
+define('LOADER_NOT_WORKING', "Falls die Weiterleitung nicht automatisch in einer Sekunde klappen sollte,");
+define('LOADER_CLICK_HERE', "so kommen Sie hier zur externen Seite weiter");
+define('ADMIN_NEW_MAIL_IN_QUEUE', "Ein Mitglied hat soeben eine Mailbuchung durchgef&uuml;hrt!\n\nSeine Buchung befindet sich nun im Sende-Pool und wird automatisch in 100-Mail-Bloecken versand.\n\nHier sind nochmals seine Daten, gebuchter Text und URL zur Verifizierung");
+define('ADMIN_SECOND_MAIL', "Sie werden bald nochmals benachrichtig, sobald der Versand vollstaendig beendet wurde.");
+define('_CATEGORY_404', "Kategorie nicht gefunden!");
+define('_PAYMENT_404', "Payment-Typ nicht gefunden!");
+define('ORDERED_CATEGORY', "Gebuchte Kategorie");
+define('MEMBER_MAILTYPE', "Gebuchter Payment-Typ");
+define('MEMBER_SUBJECT', "Betreffzeile in den Mails");
+define('MEMBER_URL', "Gebuchte URL");
+define('MEMBER_NEW_MAIL_IN_QUEUE', "Ihre Mailbuchung befindet sich derzeit in Warteschleife und wird bald ausgesendet!\n\nHier sind nochmals Ihre Daten aus dem Buchungsformular");
+define('MEMBER_SECOND_MAIL', "Sobald Ihre Mailbuchung vollst&auml;ndig gesendet wurde, erhalten Sie eine zweite Mail! Sie k&ouml;nnen bereits eine weitere Mailbuchung durchf&uuml;hren!");
+define('ADMIN_NEW_QUEUE', "Mailbuchung in Ihrem {!MT_WORD!}");
+define('MEMBER_NEW_QUEUE', "Vielen Dank fuer die Mailbuchung!");
+define('MEMBER_CONTINUE_AREA', "Weiter zum Mitgliedsbereich");
+define('MEMBER_THANX_ORDER', "Vielen Dank f&uuml;r Ihre Mailbuchung! Es ist eine Mail zu Ihnen unterwegs.");
+define('ADMIN_NO_MAILS_IN_POOL', "Es wurden noch keine Mailbuchungen aufgegeben, kann somit keine Mails anzeigen!");
+define('ADMIN_POOL_CONTENT', "Mailbuchungen im Sende-Pool");
+define('POOL_TYPE_UNKNOWN', "Unbekannt (%s)");
+define('POOL_TYPE_TEMP', "Neuer Auftrag");
+define('POOL_TYPE_SEND', "Gesendet");
+define('POOL_TYPE_NEW', "Wartet auf Versand");
+define('POOL_TYPE_ACTIVE', "Wird versendet");
+define('POOL_TYPE_ADMIN', "Wartet auf Freischaltung");
+define('EMAIL_ID', "Email-ID");
+define('EMAIL_SENDER', "Versender");
+define('EMAIL_SUBJECT', "Betreffzeile");
+define('EMAIL_TEXT', "Gebuchter Text");
+define('EMAIL_PAYMENT', "Mailart");
+define('EMAIL_CATEGORY', "Gebuchte Kategorie");
+define('EMAIL_RECEIVERS', "Anzahl Empf&auml;nger");
+define('EMAIL_RUIDS', "User-IDs");
+define('EMAIL_POOL_TYPE', "Derzeitiger Status");
+define('EMAIL_TSEND', "Noch zu sendene Mails");
+define('EMAIL_URL', "Beworbene URL");
+define('EMAIL_TYPE', "Sendestatus");
+define('EMAIL_ZIP', "PLZ");
+define('ADMIN_TEST_URL', "URL testen");
+define('EMAIL_TIMESTAMP', "Gebucht am");
+define('GUEST_FRAMETESTER_TOP', "Sollte dieser Text verschwinden, enth&auml;lt Ihre Webseite einen Frame-Killer!");
+define('ADMIN_SELECT_EMAIL_EDIT', "Email ausw&auml;hlen, um diese zu editieren");
+define('RESET_SELECT', "Auswahl zur&uuml;cknehmen");
+define('ADMIN_EDIT_EMAIL', "Mailbuchung bearbeiten");
+define('ADMIN_CHANGE_EMAIL', "&Auml;nderungen speichern");
+define('EDIT_URL', "URL bearbeiten");
+define('EMAIL_EDIT_SUBJ', "Betreff bearbeiten");
+define('EMAIL_EDIT_TEXT', "Werbetext bearbeiten");
+define('ADMIN_UNLOCK_EMAILS', "Neue Mailbuchungen freischalten");
+define('EMAIL_ACCEPT', "Annehmen");
+define('EMAIL_REJECT', "Ablehnen und umleiten");
+define('CANNOT_RE_REGISTER_SESS', "Kann Sitzungs-Cookies nicht doppelt registrieren oder es liegt ein Script-Fehler vor!");
+define('ADMIN_MAILS_ACTIVATED', "Die Mailbuchungen wurden in den Sende-Pool &uuml;bertragen und werden bald versand.");
+define('ADMIN_REJECTED_URLS', "URLs ausw&auml;hlen, die in die Black-List aufgenommen werden sollen:");
+define('ADMIN_LOCK_URLS', "URLs in die Black-List aufnehmen");
+define('ADMIN_URLS_BLOCKED', "URLs wurden in die Black-List aufgenommen!");
+define('ADMIN_SENDING_DONE', "Eine gebuchte Mail wurde soeben vollstaendig ausgesendet. Das werbende Mitglied wurde darueber in Kenntnis gesetzt.");
+define('ADMIN_NOTIFY_DONE', "Sollte diese Buchung nicht Ihren AGBs entsprechen, loggen Sie sich bitte in den Admin-Bereich ein und aendern die Mail.");
+define('ADMIN_SUBJ_SEND_DONE', "Vollstaendig: Aussendung einer Werbebbuchung!");
+define('MEMBER_SENDING_DONE', "Ihre gebuchte Mail wurde soeben vollstaendig von unserem System versendet! Wir wuenschen Ihnen viel Erfolg mit Ihrer Werbebuchung!");
+define('MEMBER_NOTIFY_DONE', "Den weiteren Verlauf dieser Werbebuchung koennen Sie im Mitgliedsbereich unter Statistiken verfolgen!");
+define('MEMBER_SUBJ_SEND_DONE', "Ihre Werbebuchung wurde versandt");
+define('GUEST_SELECT_LEAST_CATS_1', "Bitte w&auml;hlen Sie mindestens <strong><BIG>");
+define('GUEST_SELECT_LEAST_CATS_2', "</BIG></strong> Kategorien aus. Anderfalls erfolgt keine Anmeldung!");
+define('MEMBER_POOL_CONTENT', "Ihre Mails im Sende-Pool");
+define('MEMBER_STATS_CONTENT', "Statistiken versandter Mails");
+define('EMAIL_END_SEND', "Vollst&auml;ndig versendet");
+define('EMAIL_CONFIRMED', "Best&auml;tigt");
+define('EMAIL_PERCENT', "Klickrate");
+define('MEMBER_NO_MAILS_TO_CONFIRM', "Keine Mails &uuml;brig zum Best&auml;tigen!");
+define('MEMBER_SID', "Mail-ID");
+define('CONFIRM_LINK', "Best&auml;tigungslink");
+define('MAIL_ALREADY_CONFIRMED', "Mail bereits verg&uuml;tet oder Link ist nicht mehr g&uuml;ltig!");
+define('MAIL_STATS_404', "Konnte Daten aus der Statistik-Tabelle nicht laden!");
+define('USER_NOT_FOUND', "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?");
+define('UNKNOWN_STATUS', "Unbekannter Account-Status");
+define('ADMIN_UNCONFIRMED_ACCOUNTS', "Hier alle Accounts, deren Email-Adresse nicht best&auml;tigt ist");
+define('_UID', "User-ID");
+define('REMOTE_IP', "IP-Nummer");
+define('REF_UID', "Werber-ID");
+define('UNKNOWN_STATUS_1', "Unbekannter Status <strong>");
+define('UNKNOWN_STATUS_2', "</strong> erkannt!");
+define('ACCOUNT_STATUS', "Account-Status");
+define('ACCOUNT_UNCONFIRMED', "<SPAN class=\"admin_failed\">Unbest&auml;tigt</SPAN>");
+define('ACCOUNT_CONFIRMED', "<SPAN class=\"admin_green\">Best&auml;tigt</SPAN>");
+define('ACCOUNT_LOCKED', "Gesperrt");
+define('ACCOUNT_DELETED', "Gel&ouml;scht");
+define('ADMIN_ALL_ACCOUNTS', "Alle Mitglieder-Accounts auflisten");
+define('ADMIN_LIST_LOCKED_ACCOUNTS', "Alle gesperrten Mitglieder-Accounts auflisten");
+define('ADMIN_LIST_CONFIRMED_ACCOUNTS', "Alle best&auml;tigten Mitglieder-Accounts auflisten");
+define('ADMIN_NO_NONE_REGISTERED', "Ihre Suchkriterieren ergaben keine Treffer in der Mitgliederliste. ");
+define('ADMIN_MEMBER_404', "Mitglieds-Account <strong>%s</strong> existiert nicht!");
+define('ADMIN_LAST_ONLINE', "Zuletzt aktiv");
+define('ADMIN_LAST_MODULE', "Letzte Aktion");
+define('RECEIVE_MAILS', "Kann Mails empfangen");
+define('REF_CLICKS', "Klicks auf Ref-Link");
+define('TOTAL_LOGINS', "Logins gesamt");
+define('USED_POINTS', "Verwendete {!POINTS!}");
+define('MAILS_SENT', "Mails versendet");
+define('HAS_JOINED', "Beigetreten am");
+define('TOTAL_POINTS', "{!POINTS!} gesamt");
+define('TOTAL_REFERRALS', "Referrals gesamt");
+define('ADMIN_MEMBER_FUNCTIONS', "Administrative Funktionen");
+define('ADMIN_DEL_USER', "L&ouml;schen");
+define('ADMIN_LOCK_USER', "Sperren");
+define('ADMIN_UNLOCK_USER', "Entsperren");
+define('ADMIN_ADD_POINTS', "{!POINTS!} aufbuchen");
+define('ADMIN_EDIT_USER', "&Auml;ndern");
+define('ADMIN_ALL_REFS', "Alle Refs auflisten");
+define('BIRTHDAY2', "Geburtstag");
+define('TOTAL_CATS', "Ausgew&auml;hlte Kategorien");
+define('ADMIN_GOTO_USERLIST', "Dieser Men&uuml;punkt kann nicht direkt aufgerufen werden. Bitte rufen Sie stattdessen <I><U>User auflisten</U></I> auf.");
+define('ADMIN_USER_UPDATED', "Das Mitgliedsaccount wurde aktualisiert!");
+define('ADMIN_LOCKED_YOUR_ACCOUNT', "Ihr Account wurde von einem unserer Administratoren gesperrt! Bitte halten Sie sich an unsere AGBs.");
+define('REASON_LOCKED', "Grund der Sperrung war");
+define('MEMBER_PLEASE_RESPECT', "Sollten Sie damit nicht einverstanden sein, so melden Sie sich bitte bei uns. Wir kommen dann in Kontakt mit Ihnen.");
+define('ADMIN_LOCKED_SUBJ', "Ihr Account wurde gesperrt!");
+define('ADMIN_UNLOCKED_SUBJ', "Ihr Account wurde wieder freigegeben!");
+define('ADMIN_UNLOCKED_YOUR_ACCOUNT', "Einer unserer Administratoren hat soeben Ihren Account wieder freigeben! Sie koennen sich nun wieder unter folgender URL einloggen:\n\n".URL."/login.php");
+define('REASON_UNLOCKED', "Nachricht vom Admin");
+define('ADMIN_WELCOME_BACK', "Bitte beachten Sie beim naechsten Mal auf unsere AGBs, damit Ihnen diese Unangenehmlichkeiten erspart bleiben.");
+define('ADMIN_DEL_ACCOUNT', "Loeschung Ihres Accounts!");
+define('ADMIN_DELETED_YOUR_ACCOUNT', "Einer unserer Administratoren hat soeben Ihren Account geloescht!");
+define('REASON_DELETE', "Grund der Loeschung war folgender");
+define('ADMIN_BYE_BYE', "Wir wuenschen Ihnen weiterhin noch alles Gute und koennen Sie vielleicht irgentwann einmal wieder begruessen.");
+define('ADMIN_ALL_CONFIRMED_EMAIL', "Alle Ihre Mitglieder haben ihre Email-Adresse best&auml;tigt! Keine Neuanmeldungen vorhanden.");
+define('GUEST_CONFIRM_SUBJ', "Bitte Ihre Email-Adresse bestaetigen!");
+define('MEMBER_ORDER_ACCEPTED', "Ihre Mailbuchung wurde freigeschaltet");
+define('MEMBER_ORDER_REJECTED', "Ihre Mailbuchung wurde abgelehnt");
+define('THANX_REFERRAL_ONE', "Vielen Dank fuer die Referral-Werbung!");
+define('ADMIN_SEND_MAIL', "Bonusmail versenden");
+define('ADMIN_BONUS_SEND', "Bonusmail wurde in den Sende-Pool eingef&uuml;gt!");
+define('ENTER_POINTS', "Verg&uuml;tung");
+define('ENTER_SECONDS', "Wartezeit");
+define('ADMIN_MORE_SELECTED', "Sie haben mehr Empf&auml;nger eingegeben, als das empfangsbereit sind!");
+define('ADMIN_BONUS_CONTENT', "Versendete Bonus-Mails");
+define('EMAIL_POINTS', "Verg&uuml;tung");
+define('EMAIL_SECONDS', "Wartezeit");
+define('POOL_ACTIVE', "Wird gerade versendet");
+define('ALL_MEMBERS', "Alle Mitglieder");
+define('ADMIN_SELECT_USER', "Mitglied ausw&auml;hlen");
+define('ENTER_POINTS_ADD', "{!POINTS!} zum Aufbuchen");
+define('ENTER_ADD_REASON', "Grund der Aufbuchung");
+define('ADMIN_ADDED_POINTS_1', "Einer unserer Administratoren hat Ihnen soeben");
+define('ADMIN_ADDED_POINTS_2', " {!POINTS!} gutgeschrieben!");
+define('ADMIN_ADDED_REASON', "Grund dazu war folgender");
+define('ADMIN_ADD_SUBJ', "{!POINTS!}-Gutschrift durch unsere Admins!");
+define('ADMIN_POINTS_ADDED', "{!POINTS!} wurden gutgeschrieben. Das Mitglied hat eine Mail erhalten!");
+define('MAILS_PER_DAY', "Mails / Tag");
+define('GUEST_CONFIRMED_DONE', "Danke f&uuml;r die Best&auml;tigung Ihrer Email-Adresse! Es ist eine Mail mit den Login-Daten zu Ihnen unterwegs.");
+define('VALIDATING_LOGIN', "Logindaten werden gepr&uuml;ft . . .");
+define('MEMBER_ACCOUNT_LOCKED_UNC', "Kann keine {!POINTS!} gutschreiben, da Ihr Account gesperrt wurde!");
+define('MAIL_POSSIBLE_INVALID', "Konnte keine {!POINTS!} gutschreiben: Daten moeglicherweise beschaedigt!");
+define('MEMBER_COOKIES_DISABLED', "Kann nicht einloggen, da Cookies bei Ihnen deaktiviert sind.");
+define('ADMIN_DEL_COMPLETED', "Account wurde gel&ouml;scht! Die {!POINTS!} werden immer in den Jackpot transferiert!");
+define('NORMAL_MAIL_PROBLEM', "Mail vom Mitgliedern bereits gel&ouml;scht");
+define('BONUS_MAIL_PROBLEM', "Bonus-Mail bereits gel&ouml;scht");
+define('MEMBER_BACK_JACKPOT', "{!POINTS!}-Rueckgutschrift");
+define('ADMIN_BACK_JACKPOT', "{!POINTS!}-Aufbuchung fuer Jackpot");
+define('MEDIA_DATA', "Mediendaten");
+define('USERS_TOTAL', "Mitglieder gesamt");
+define('USERS_MAX_MAILS', "Erreichbare Mitglieder");
+define('USERS_REC_PER_DAY', "Heute noch erreichbar");
+define('USERS_LINKS', "Unbest&auml;tigte Mails");
+define('USERS_STATS', "Werbebuchungen");
+define('USERS_SENT_MAILS', "Gesendete Mails");
+define('USERS_MAX_PER_DAY', "Versendbare Mails pro Tag");
+define('USERS_MAX_REC', "Heute versendbare Mails");
+define('EDIT_CATEGORIES', "Kategorien &auml;ndern");
+define('CATEGORY_ID', "Kategorie-ID");
+define('CAT_DESCRIPTION', "Kategoriebeschreibung");
+define('CHANGE_CATS', "&Auml;ndern");
+define('SORT_KEY', "Sortierung");
+define('CATEGORIES_SAVED', "Kategorien gespeichert...");
+define('CATEGORIES_DELETED', "Kategorien gel&ouml;scht...");
+define('DELETE_CATEGORIES', "Kategorien l&ouml;schen");
+define('REMOVE_CATS', "L&ouml;schen");
+define('EDIT_MRECEIVE', "Maximal-Werte editieren");
+define('DELETE_MRECEIVE', "Maximal-Werte l&ouml;schen");
+define('MRECEIVE_ID', "Max-Wert ID");
+define('MREC_VALUE', "Mails pro Tag");
+define('MREC_COMMENT', "Kommentar");
+define('CHANGE_MREC', "&Auml;ndern");
+define('REMOVE_MREC', "L&ouml;schen");
+define('MRECEIVE_SAVED', "Maximal-Werte gespeichert...");
+define('MRECEIVE_DELETED', "Maximal-Werte gel&ouml;scht...");
+define('EDIT_REF_DEPTHS', "Referral-Ebenen editieren");
+define('DELETE_REF_DEPTHS', "Referral-Ebenen l&ouml;schen");
+define('REF_DEPTHS_ID', "Ref-Level ID");
+define('CHANGE_REF', "&Auml;ndern");
+define('REMOVE_REF', "L&ouml;schen");
+define('REF_DEPTHS_SAVED', "Referral-Ebenen gespeichert...");
+define('REF_DEPTHS_DELETED', "Referral-Ebenen gel&ouml;scht...");
+define('EDIT_PAYMENT', "Mailverg&uuml;tungen editieren");
+define('PAYMENT_ID', "Verg&uuml;tungs-ID");
+define('CHANGE_PAY', "&Auml;ndern");
+define('REMOVE_PAY', "L&ouml;schen");
+define('REFERRALS', "Referrals");
+define('POINTS_SUM', "Gesamtsumme");
+define('NEW_VERSION_AVAILABLE', "Neue Version verf&uuml;gbar!");
+define('YOUR_VERSION_IS', "Installierte Version");
+define('ONLINE_VERSION_IS', "Verf&uuml;gbare Version");
+define('UPDATE_CREATE_TIME', "Update wurde erstellt");
+define('DOWNLOAD_NEW_VERSION', "Jetzt neue Version herunterladen!");
+define('NO_UPDATES_AVAILABLE', "Keine neuen Updates verf&uuml;gbar!");
+define('NEW_PATCHES_AVAILABLE', "Neue Entwickler-Patches verf&uuml;gbar!");
+define('PATCH_FNAME', "Download-Link");
+define('PATCH_CTIME', "Patch erstellt");
+define('PATCH_FSIZE', "Downloadgr&ouml;sse");
+define('KBYTES', "KBytes");
+define('DEFAULT_SUBJECT_LINE', "Klick-Mail von ".TITLE);
+define('MEBER_UPDATE_PWD_WRONG', "Sie haben das falsche Passwort eingegeben! Bitte nochmal versuchen!");
+define('ADMIN_MEM_NO_CATS_1', "Das Mitglied <U>");
+define('ADMIN_MEM_NO_CATS_2', "</U> hat keine Kategorien ausgew&auml;hlt!");
+define('USER_ID', "Mitglied");
+define('UNCONFIRMED_LINKS', "Unbest&auml;tigte Mails");
+define('ADMIN_MEMBER_LINKS_1', "Das Mitglied <U>");
+define('ADMIN_MEMBER_LINKS_2', "</U> hat alle seine Mails best&auml;tigt.");
+define('MEMBER_TOTAL_LINKS_1', "Es m&uuml;ssen noch <strong>");
+define('MEMBER_TOTAL_LINKS_2', "</strong> Mails von diesem Mitglied best&auml;tigt werden!");
+define('ADMIN_DEL_UNCONFIRMED_LINKS', "Alle unbest&auml;tigten Mails l&ouml;schen");
+define('ADMIN_LINKS_DELETED', "Links f&uuml;r unbest&auml;tigte Mails wurden gel&ouml;scht!");
+define('ADMIN_DEL_LINK_SUBJ', "Ihr unbestaetigen Mails wurden geloescht!");
+define('MEMBER_LINKS_LEFT_1', "Sie haben <strong>");
+define('MEMBER_LINKS_LEFT_2', "</strong> unbest&auml;tigte Mails. Bitte best&auml;tigen Sie diese zuerst. Wenn Sie weniger als <strong>");
+define('MEMBER_LINKS_LEFT_3', "</strong> Mails im Account haben, k&ouml;nnen Sie auch wieder buchen.");
+define('TODAY', "Heute");
+define('MEMBER_PROFILE_LOCKED_1', "Sie k&ouml;nnen Ihren Account erst am <strong>");
+define('MEMBER_PROFILE_LOCKED_2', "</strong> wieder &auml;ndern!");
+define('MEMBER_HAS_ZERO_MMAILS', "Sie haben Ihren Empfang auf <strong>Urlaub</strong> stehen! Bitte stellen Sie unter &quot;Profildaten &auml;ndern&quot; den Empfang h&ouml;her ein!");
+define('REF_CLIX', "Clicks");
+define('REF_VIEWS', "Views");
+define('REFBANNER_TOTALS', "Gesamt");
+define('DAYS', "Tage");
+define('GUESTS_ONLINE', "G&auml;ste");
+define('MEMBERS_ONLINE', "Mitglieder");
+define('ADMINS_ONLINE', "Administratoren");
+define('USER_NOW_ONLINE', "User Online");
+define('ADMIN_ONLINE_DETAILS', "Detailierte Statistik f&uuml;r alle Besucher");
+define('_REFID', "Ref-ID");
+define('_MODULE', "Modul");
+define('MENU_ACTION', "Hauptmen&uuml;");
+define('MENU_WHAT', "Untermen&uuml;");
+define('_IS_ADMIN', "Administrator");
+define('_IS_GUEST', "Gast");
+define('LAST_SEEN', "Zuletzt gesehen");
+define('ADMIN_TOTAL_PATCH_SIZES', "Gesamtgr&ouml;sse aller Patches");
+define('ADMIN_DELETE_BONUS_MAIL', "Obrige Bonus-Mail l&ouml;schen");
+define('ADMIN_DELETE_NORMAL_MAIL', "Obrige Normal-Mail l&ouml;schen");
+define('ADMIN_REALLY_DELETE_ALL_MAILS', "Wollen Sie wirklich alle Mails l&ouml;schen?");
+define('SURNAME_FAMILY', "Vor- und Nachname");
+define('ADMIN_TOTAL_REFS_1', "Das Mitglied <strong>");
+define('ADMIN_TOTAL_REFS_2', "</strong> hat bereits <strong>");
+define('ADMIN_TOTAL_REFS_3', "</strong> weitere(s) Mitglied(er) geworben, davon sind <strong>");
+define('ADMIN_TOTAL_REFS_4', "</strong> gesperrt oder nicht best&auml;tigt!");
+define('REFS_COUNT', "Refs");
+define('MEMBER_JOINED', "Beigetreten");
+define('ADMIN_EMAIL_DELETED', "E-Mail wurde aus dem System gel&ouml;scht.");
+define('_ALL', "alle");
+define('PROFILE_LAST_CHANGE', "Letzte &Auml;nderung");
+define('PROFILE_OUTDATED', "Haben Sie Neuigkeiten fuer uns?");
+define('PROFILE_NEVER_CHANGED', "Sie haben noch nie eine Aenderung durchgefuehrt!");
+define('PROFILE_UPDATED', "Profildaten wurden ge&auml;ndert!");
+define('NEW_PATCHES_AVAILABLE_1', "Neue Entwickler-Patches f&uuml;r Version <strong>");
+define('NEW_PATCHES_AVAILABLE_2', "</strong> verf&uuml;gbar!");
+define('SORT_BY', "Sortieren:");
+define('_OTHERS', "Andere");
+define('_ALL2', "Alle");
+define('WE_HAVE', "Wir haben");
+define('MEMBER_TEST_URL', "Zur beworbenen Seite");
+define('ADMIN_LOGS_DIR_404_1', "Das Verzeichnis mit den Zugriffslogb&uuml;chern konnte nicht gefunden werden! (<strong>");
+define('ADMIN_LOGS_DIR_404_2', "</strong>)");
+define('ADMIN_USAGE_DIR_404_1', "Das Verzeichnis mit den Webalizer-Statistiken konnte nicht gefunden werden! (<strong>");
+define('ADMIN_USAGE_DIR_404_2', "</strong>)");
+define('ADMIN_ENTER_REDIRECT_URL', "URL eingeben, wenn abgelehnt werden soll");
+define('ADMIN_ID_404_1', "ID <strong>");
+define('ADMIN_ID_404_2', "</strong> nicht gefunden!");
+define('ADMIN_ASSIGNED_ADMIN', "Zugewiesener Admin-Login");
+define('ADMIN_MEMBER_UID', "ID des Mitgliedes");
+define('ADMIN_TASK_TYPE', "Aufgabenbereich");
+define('ADMIN_TASK_CREATED', "Task erstellt");
+define('ADMIN_NO_ADMIN_ASSIGNED', "Kein Admin-Login zugewiesen!");
+define('ADMIN_TASK_IS_MEMBER_SUPPORT', "Support-Anfrage eines Mitgliedes");
+define('ADMIN_UNKNOWN_TASK_TYPE_1', "Unbekannter Task-Typ <strong>");
+define('ADMIN_UNKNOWN_TASK_TYPE_2', "</strong> im Task <strong>");
+define('ADMIN_UNKNOWN_TASK_TYPE_3', "</strong> erkannt!");
+define('ADMIN_TASK_SYSTEM_WELCOME', "Task-Management Ihres {!MT_WORD2!}");
+define('ADMIN_UNSELECT_ALL', "Alles abw&auml;hlen");
+define('ADMIN_ASSIGN_TASKS', "Bearbeiten");
+define('ADMIN_UNASSIGN_TASKS', "Zuweisung aufheben");
+define('ADMIN_REDIRECT_TASKS', "An uns weiterleiten");
+define('PATCHES_APPLIED', "Patches an der Datenbank durchgef&uuml;hrt!");
+define('PATCH_NOTES', "Bitte beachten Sie, dass wenn bei der Installation die SQL-Dateien nicht automatisch eingespielt werden konnten, dass sie auch hier nicht eingespielt worden sind! Sie m&uuml;ssen sie dann manuell einspielen.");
+define('LATEST_PATCH_INSTALLED', "Es wurde bereits die Datenbank aktualisiert!");
+define('PATCH_LISTED', "Anbei eine Liste der noetigen Dateien:");
+define('NO_PATCHES_APPLIED', "Keine Patches wurden ausgef&uuml;hrt!");
+define('LOAD_URL_ERROR_1', "Konnte nicht weiterleiten, da bereits Kopfinformationen gesendet wurden! <A href=\"");
+define('LOAD_URL_ERROR_2', "\">Bitte klicken Sie hier</A>, um zur URL zu kommen.<br />\n<br />\nDanke.");
+define('GUEST_STATS', "Statistiken unseres {!MT_WORD2!}");
+define('GUEST_STATS_MONTHLY', "Mitgliederverteilung auf Kalendermonate");
+define('GUEST_STATS_CATS', "Mitgliederverteilung auf Mail-Kategorien");
+define('GUEST_STATS_MALES', "Angemeldete M&auml;nner");
+define('GUEST_STATS_FEMALES', "Angemeldete Frauen");
+define('GUEST_STATS_TONLINE', "Heute Online gewesen");
+define('GUEST_STATS_YONLINE', "Gestern Online gewesen");
+define('GUEST_STATS_TREGISTER', "Heutige Anmeldungen");
+define('GUEST_STATS_YREGISTER', "Gestrige Anmeldungen");
+define('CHANGE_MENUS', "&Auml;ndern");
+define('CHANGE_MEMBER_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmen&uuml;s");
+define('CHANGE_MENU_1', "&Auml;ndern von <strong>");
+define('CHANGE_MENU_2', "</strong> Men&uuml;eintr&auml;gen");
+define('IS_VISIBLE', "Wird angezeigt");
+define('IS_ACTIVE', "Aktiviert");
+define('CHANGE_ENTRIES', "&Auml;nderungen durchf&uuml;hren");
+define('BASE_URL_NOTE', "Ohne abschliessendem /!");
+define('ADMIN_WRONG_CALL', "Falscher Aufruf einer Aktion oder des Scriptes. Bitte navigieren Sie links weiter.");
+
+// Description of all months
+$MONTH_DESCR = array(
+       '01' => "Januar",
+       '02' => "Februar",
+       '03' => "M&auml;rz",
+       '04' => "April",
+       '05' => "Mai",
+       '06' => "Juni",
+       '07' => "Juli",
+       '08' => "August",
+       '09' => "September",
+       '10' => "Oktober",
+       '11' => "November",
+       '12' => "Dezember",
+);
+//
+define('ADMIN_IS_SYSTEM_TASK', "System-Task");
+define('ADMIN_TASK_IS_EXTENSION', "Erweiterung-Management");
+define('ADMIN_NEW_EXT_SUBJ', "Neue Erweiterung gefunden");
+define('ADMIN_TASK_SUBJECT', "Aufgabenbetreff");
+define('ADMIN_TASK_TEXT', "Aufgabentext");
+define('ADMIN_REGISTER_EXTENSION', "Registrieren");
+define('ADMIN_SELECTED_TASKS_ASSIGN', "Zum Bearbeiten ausgew&auml;hlte Tasks");
+define('ADMIN_REG_FAILED_INVALID', "Registrierung fehlgeschlagen: Ung&uuml;tige ID &uuml;bermittelt!");
+define('ADMIN_REG_FAILED_ID_404', "Registrierung fehlgeschlagen: Erweiterung-ID nicht auffindbar!");
+define('ADMIN_REG_FAILED_404', "Registrierung fehlgeschlagen: Erweiterung nicht auffindbar!");
+define('ADMIN_REG_FAILED_ASSIGED', "Registrierung fehlgeschlagen: Sie sind nicht zugewiesen oder Task ist veraltet!");
+define('ADMIN_REG_FAILED_ALREADY', "Registrierung fehlgeschlagen: Erweiterun bereits installiert.");
+define('ADMIN_NO_EXTENSION_REGISTERED', "Derzeit haben Sie keine Erweiterung in Ihrem {!MT_WORD!} registriert.");
+define('ADMIN_EXTENSION_REGISTERED', "Erweiterung wurde in Ihrem {!MT_WORD!} registriert.");
+define('ADMIN_EXT_ALREADY_REGISTERED', "Erweiterung bereits registriert!");
+define('ADMIN_DELETE_ENTRIES', "L&ouml;schen");
+define('ADMIN_REGISTERED_EXTENSIONS', "Registrierte Erweiterungen");
+define('ADMIN_EXT_NAME', "Erweiterungsname");
+define('ADMIN_EXT_LANG', "Sprachdatei");
+define('ADMIN_EXT_ADMIN', "Admin-Bereich?");
+define('ADMIN_EXT_ACTIVE', "Aktiviert?");
+define('ADMIN_DE_ACTIVATE', "De-/Aktivieren");
+define('ADMIN_SEARCH_NEW_EXTENSIONS', "Nach neuen Erweiterungen suchen...");
+define('JACKPOT_POINTS', "{!POINTS!} im Jackpot");
+define('CLICK_RATE', "Klickrate");
+define('GUEST_STATS_MODULES', "Klicks in allen Modulen (TOP-10)");
+define('GUEST_STATS_MEMBERS', "Statistiken &uuml;ber unsere Mitglieder");
+define('EDIT_REFBANNER', "Werbebanner editieren");
+define('REQUEST_CONFIRM_LINK_TITLE', "Best&auml;tigungslink erneut anfordern");
+define('GUEST_CONFIRM_LINK_NOTE', "Sie haben Ihren Best&auml;tigungslink verlegt? Kein Problem, hier k&ouml;nnen Sie ihn erneut anfordern. Geben Sie dazu einfach Ihre angemeldete eMail-Adresse an. Der Link wird Ihnen dann per Mail zugesandt.");
+define('REQUEST_CONFIRM_LINK', "Erneut anfordern");
+define('LOGIN_ID_CONFIRMED', "Sie haben bereits Ihre E-Mail Adresse best&auml;tigt!");
+define('CONFIRM_LINK_SENT', "Der Best&auml;tigungslink wurde an Ihre E-Mail Adresse ausgesandt.");
+define('REQUEST_CONFIRM_LINK_SUBJ', "Anforderung Ihres Bestaetigunglinkes");
+define('EMAIL_ADDY_404', "Unter der angegebenen E-Mail Adresse konnten wir keinen Account finden! Bitte versuchen Sie es erneut.");
+define('SELECT_NONE', "Keine/s/r");
+define('ADMIN_SETUP_STATS_TITLE', "Einstellungen an den Gast-Statistiken");
+define('ADMIN_GSTATS_MEMBERS', "Mitglieder-Statistik zuerst");
+define('ADMIN_GSTATS_MODULES', "TOP10-Modul-Statistik zuerst");
+define('ADMIN_GSTATS_INACTIVE', "Gast-Statistik deaktivieren");
+define('ADMIN_GSTATS_MEMBERS_NOTE', "Die Mitglieder-Statistik zeigt an, wie viele Mitglieder Ihr {!MT_WORD!} hat und wie viele Mitglieder welche Kategorien ausgew&auml;hlt haben.");
+define('ADMIN_GSTATS_MODULES_NOTE', "Zeigt Klicks in den 10 am h&auml;ufigsten angeklickten Gast- und Mitgliedsmodulen an.");
+define('ADMIN_GSTATS_INACTIVE_NOTE', "Deaktiviert die Gast-Statistiken komplett.");
+define('DELETE_PAYMENT', "Verg&uuml;tungen l&ouml;schen");
+define('REF_PAYOUT', "Wie viele Mails m&uuml;ssen die Mitglieder mindestens best&auml;tigen, um den Willkommensbonus, einmaliger Referral-Bonus usw. gutgeschrieben bekommen?");
+define('ADMIN_EXT_NO_INFO_FOUND', "Keine Informationen zu dieser Erweiterung gefunden!");
+define('ADMIN_EXT_NEW_FOUND_TITLE', "Neue Erweiterungen gefunden");
+define('ADMIN_EXT_DOWNLOAD_LINK', "Download-Link");
+define('ADMIN_EXT_FILE_SIZE', "Downloadgr&ouml;&szlig;e");
+define('ADMIN_EXT_FILE_CTIME', "Erweiterung erstellt am");
+define('ADMIN_EXT_FILE_VERSION', "Version (alt)");
+define('ADMIN_EXT_TOTAL_FSIZE', "Downloadgesamtgr&ouml;sse");
+define('ADMIN_EXT_TOTAL_FOUND', "Gesamt gefundene Erweiterungen");
+define('ADMIN_EXT_ALREADY_INSTALLED_1', "Alle <strong><U>");
+define('ADMIN_EXT_ALREADY_INSTALLED_2', "</U></strong> gefundenen Erweiterungen sind bereits installiert!");
+define('ADMIN_EXT_NOTHING_FOUND', "Keine Erweiterungen auf dem Server gefunden!");
+define('ADMIN_EXT_VERSION', "Version");
+define('ADMIN_TASK_IS_EXTENSION_UPDATE', "Erweiterung-Update");
+define('ADMIN_EXTENSION_UPDATED', "Erweiterung aktualisiert!");
+define('ADMIN_UPDATE_EXT_SUBJ', "Erweiterung-Update installiert");
+define('MEMBER_ORDER_PAGE1_INTRO', "Mailbuchung - Schritt 1 von 4: PLZ eingeben");
+define('MEMBER_ORDER_PAGE2_INTRO', "Mailbuchung - Schritt 2 von 4: Daten eingeben");
+define('MEMBER_ORDER_PAGE3_INTRO', "Mailbuchung - Schritt 3 von 4: Frame-Killer Test und Absenden");
+define('MEMBER_ORDER_PAGE4_INTRO', "Mailbuchung - Schritt 4 von 4: Vielen Dank!");
+define('MEMBER_ORDER_PAGE1_NOTE', "Geben Sie hier die ersten ein bis drei Stellen der Postleitzahl ein, in der gesendet werden soll.<br />
+<br />
+Beispiele:
+<UL>
+       <LI><strong>1</strong> : Sendet nur an Mitglieder, deren Postleitzahl mit 1 anf&auml;ngt.</LI>
+       <LI><strong>12</strong> : Sendet nur an Mitglieder, deren Postleitzahl mit 12 anf&auml;ngt.</LI>
+       <LI><strong>123</strong> : Sendet nur an Mitglieder, deren Postleitzahl mit 123 anf&auml;ngt.</LI>
+</UL>
+<br />
+Oder geben Sie nichts ein, wenn Sie diese Option nicht w&uuml;nschen.");
+define('MEMBER_ENTER_ZIP_CODE', "PLZ eingeben");
+define('ORDER_PAGE_2', "Weiter zur Seite 2");
+define('UNCONFIRMED_USERIDS', "Unbest./Gesperrte Accounts");
+define('LOCKED_POINTS', "Nicht verg&uuml;tete {!POINTS!}");
+define('LAST_UPDATE', "Letzte Profil&auml;nderung");
+define('LAST_PROFILE_SENT', "Erinnerung gesendet");
+define('USER_REF_PAYOUT', "Noch zu best. Mails");
+define('DISPLAY_REFID', "Ref-ID anzeigen");
+define('SORT_NAVIGATION', "Sortieren");
+define('HIGHER', "H&ouml;her");
+define('LOWER', "Niedriger");
+define('MEMBER_SETTINGS_SAVED', "Einstellungen gespeichert.");
+define('REMOTE_ADDR_TIMEOUT', "Ein Mitglied ist mit Ihrer IP-Nummer <U>".GET_REMOTE_ADDR()."</U> bereits registriert! Bitte kontaktieren Sie uns, wenn dies ein Fehler sein sollte!");
+define('IP_TIMEOUT', "IP-Zeitsperre");
+define('ADMIN_PAYOUT_NOT_INSTALLED', "payout-Erweiterung nicht installiert!");
+define('ADMIN_WERNIS_NOT_INSTALLED', "wernis-Erweiterung nicht installiert!");
+define('ADMIN_ADD_MAX_VALUE', "Neuen Maximal-Wert hinzuf&uuml;gen");
+define('ADMIN_CANNOT_CHECK_VERSION', "Konnte Versionsnummer nicht abgleichen! (Fehlende Internet-Verbindung? Server ist down?)");
+define('GUEST_STATS_DEACTIVATED', "Statistiken sind deaktiviert.");
+define('GUEST_TOPTEN_STATS', "Die am h&auml;ufigsten angeklickten Men&uuml;s");
+define('GUEST_TOP_GUEST_STATS', "Gastmen&uuml;");
+define('GUEST_TOP_MEMBER_STATS', "Mitgliedmen&uuml;");
+define('ADMIN_EDIT_BANNER_URL', "Banner-URL &auml;ndern");
+define('ADMIN_EDIT_ALTERNATE', "Alternativen Text &auml;ndern");
+define('ADMIN_EDIT_POINT_SETTINGS', "Einstellungen an {!POINTS!}verg&uuml;tungen");
+define('ADMIN_CONFIG_DIRECT_PAY', "Sollen die eingestellte Anzahl an mindest zubest&auml;tigener Mails bei {!POINTS!}gutschriften ber&uuml;cksichtig werden oder immer gutgeschrieben werden?");
+define('CHANGE_PROFILE', "Profil &auml;ndern");
+define('ADMIN_PASS1', "Passwort eingeben");
+define('ADMIN_PASS2', "Passwortbest&auml;tigung");
+define('ADMIN_EDIT_USER_PROFILE', "Editieren eines Mitgliederaccountes");
+define('ADMIN_EDIT_USER_PASSWORD_NOTE', "Geben Sie nur zweimal das Passwort ein, wenn Sie es &auml;ndern wollen. Wollen Sie nur Daten &auml;ndern, geben Sie bitte keines ein.");
+define('POINTS_LOCKED', "Noch wartende {!POINTS!}");
+define('ADMIN_TASK_INFOS', "Infos");
+define('NICKNAME', "Nickname");
+define('EXT_NICKNAME_404', "<FONT class=\"note\">nickname-Erweiterung fehlt!</FONT>");
+define('ADMIN_PROBLEM_NO_MENU', "Konnte keine Men&uuml;eintr&auml;ge finden!");
+define('USER_REF_404', "Dieses Mitglied hat keine Referals gemacht.");
+define('USER_NICKNAME', "Nickname");
+define('ADMIN_EXT_AUTOPURGE_404', "autopurge nicht installiert!");
+define('ADMIN_EXT_BONUS_OUTDATED_1', "Ihre Bonus-Erweiterung ist veraltet! Version <U>");
+define('ADMIN_EXT_BONUS_OUTDATED_2', "</U> oder h&ouml;her wird ben&ouml;tigt!");
+define('ADMIN_EXT_BONUS_404', "bonus nicht installiert!");
+define('ADMIN_CONFIG_POINTS_DIRECT', "{!POINTS!} immer gutgeschreiben.");
+define('ADMIN_CONFIG_POINTS_MAILS', "Anzahl zu best. Mails ber&uuml;cksichtigen.");
+define('MEMBER_MORE_POINTS_NEEDED', "Sie haben nicht ausreichend {!POINTS!} &uuml;brig, um die Buchung durchzuf&uuml;hren! Bitte stellen Sie weniger Empf&auml;nger oder eine kleinere Mailart ein.");
+define('CANNOT_SEND_ADMIN_MAILS', "Fehler bei Mailversand an Admin!");
+define('MAILID_CLICK_BUTTON', "Einmal den Button anklicken");
+define('ADMIN_ADD_POINTS_TO_ALL', "Allen Mitgliedern {!POINTS!} gutschreiben");
+define('ADMIN_ALL_POINTS_ADDED', "Allen Mitgliedern wurden die {!POINTS!} gutgeschrieben!");
+define('EMAILS_PAGENAV', "Seite");
+define('_IS_CURRENT_HOME', "Liegt in Home");
+define('_IS_NEW_HOME', "In Home setzen");
+define('ADMIN_CONFIG_HOME', "Legen Sie hier die neue Home-Seite fest");
+define('HOME_ACTION', "Funktion");
+define('HOME_BOTTOM_NOTE', "Es werden nur aktive Men&uuml;punkte aus dem Gasthauptmen&uuml; (main) angezeigt.");
+define('ADMIN_EXT_CSSFILE', "CSS?");
+define('ADMIN_EDIT', "&Auml;ndern");
+define('ADMIN_EDIT_EXTENSIONS', "&Auml;ndern von Erweiterungen");
+define('ADMIN_EXT_CHANGED', "Erweiterungen ge&auml;ndert.");
+define('POOL_DELETED', "Bereinigt");
+define('ONLINE_TIMEOUT_IS_1', "Die Liste zeigt die Besucher der letzten <strong>");
+define('ONLINE_TIMEOUT_IS_2', "</strong> an.");
+define('ADMIN_CONFIG_EXTENSIONS_SETTINGS', "Erweiterungs-Management konfigurieren");
+define('ADMIN_VERBOSE_SQL', "SQL-Anweisungen beim Registrieren/Updates/Entfernen ausgeben");
+define('ADMIN_REMOVING_THESE_EXTENSIONS', "Diese Erweiterungen werden deinstalliert");
+define('ADMIN_REMOVE_EXTENSIONS', "Erweiterungen jetzt entfernen");
+define('ADMIN_SQLS_EXECUTED_ON_REMOVAL', "Beim Entfernen ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_NO_ADDIONAL_SQLS', "Keine weiteren SQL-Anweisungen zum Ausf&uuml;hren!");
+define('ADMIN_SQLS_EXECUTED_ON_UPDATE', "Beim Aktualisieren ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_SQLS_EXECUTED_ON_REGISTER', "Beim Registrieren ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_UNKNOWN_FIELD_TYPE_1', "Unbekannter Datentyp <strong>");
+define('ADMIN_UNKNOWN_FIELD_TYPE_2', "</strong> erkannt!");
+define('ADMIN_ADD_POINTS_TO_USER', "Einem Mitglied {!POINTS!} gutschreiben");
+define('MEMBER_ORDER_DELETED', "Ihre Mailbuchung wurde soeben geloescht");
+define('ADMIN_CALL_NOT_DIRECTLY', "Bitte diesen Men&uuml;punkt nicht direkt aufrufen!");
+define('ADMIN_UNCONFIRMED_POOL_MISSING_1', "Es fehlen Daten im Sende-Pool zur Mail-ID <U>");
+define('ADMIN_UNCONFIRMED_POOL_MISSING_2', "</U> !");
+define('ADMIN_UNCONFIRMED_STATS_MISSING_1', "Es fehlen Daten in der User-Statistik zur Mail-ID <U>");
+define('ADMIN_UNCONFIRMED_STATS_MISSING_2', "</U> !");
+define('ADMIN_UNCONFIRMED_INVALID_LINK', "Ung&uuml;tigen Link aufgerufen oder Mail ist nicht mehr vorhanden!");
+define('ADMIN_UNCONFIRMED_NO_LINK_LEFT', "Diese Mailbuchung wurde komplett best&auml;tigt!");
+define('ADMIN_CONFIG_REFMODE', "Soll die einmalige Referral-Gutschrift dem Werber alleine oder auch seinem Werber (usw.) gutgeschrieben werden?");
+define('ADMIN_CONFIG_REFMODE_REF', "Werber und seinen Werbern gutschreiben.");
+define('ADMIN_CONFIG_REFMODE_DIRECT', "Nur dem direkten Werber gutschreiben.");
+define('ADMIN_HEADER_LOCK_ACCOUNT_1', "Mitgliedsaccount <u>");
+define('ADMIN_HEADER_LOCK_ACCOUNT_2', "</u> sperren");
+define('ADMIN_HEADER_UNLOCK_ACCOUNT_1', "Mitgliedsaccount <u>");
+define('ADMIN_HEADER_UNLOCK_ACCOUNT_2', "</u> freigeben");
+define('ADMIN_HEADER_DEL_ACCOUNT_1', "Mitgliedsaccount <u>");
+define('ADMIN_HEADER_DEL_ACCOUNT_2', "</u> l&ouml;schen");
+define('ADMIN_TEXT_DEL_ACCOUNT_1', "M&ouml;chten Sie den User <strong>");
+define('ADMIN_TEXT_DEL_ACCOUNT_2', "</strong> nun <strong>unwiederruflich</strong> l&ouml;schen? Bitte geben Sie einen Grund der L&ouml;schung mit an!");
+define('ADMIN_TEXT_LOCK_ACCOUNT_1', "M&ouml;chten Sie den User <strong>");
+define('ADMIN_TEXT_LOCK_ACCOUNT_2', "</strong> nun sperren? Bitte geben Sie einen Grund der Sperrung mit an!");
+define('ADMIN_TEXT_UNLOCK_ACCOUNT_1', "M&ouml;chten Sie den User <strong>");
+define('ADMIN_TEXT_UNLOCK_ACCOUNT_2', "</strong> nun freischalten? Sie k&ouml;nnen auch optional einen Text mit angeben.");
+define('ADMIN_EDIT_HOME_TARGET', "Home-Seite festlegen");
+define('ADMIN_EDIT_HOME_SETTINGS', "Einstellungen an Eingangsseite");
+define('ADMIN_CONFIG_HOME_TITLE', "Einstellungen an der Home-Seite");
+define('ADMIN_CONFIG_INDEX_DELAY', "Verz&ouml;gerung bevor weitergeleitet wird");
+define('ADMIN_INDEX_MANUAL_FORWARD', "Klicken leitet weiter");
+define('ADMIN_INDEX_NO_DELAY', "Sofort weiterleiten");
+define('ADMIN_CONTINUE_TO_CONFIG', "Weiter zu den Einstellungen");
+define('ADMIN_CONFIG_INDEX_COOKIE', "Wie lange soll der Besucher die Eingangsseite nicht mehr sehen?");
+define('BONUS_EXTENSION_UPGRADE_1', "Bitte aktualisieren Sie Ihre Bonus-Erweiterung auf Version <U>");
+define('BONUS_EXTENSION_UPGRADE_2', "</U> oder neuer!");
+define('_ON', "an");
+define('CLICK_STATISTICS', "Mail-Statistik");
+define('ADMIN_SELECT_DEF_REFID', "Standart Referral-ID bei Anmeldung &uuml;ber keinen Ref-Link");
+define('ADMIN_SELECT_REFID_TARGRT', "Ziel-Seite des Referral-Linkes");
+define('ADMIN_REF_TARGET_REGISTER', "Zur Anmeldeseite");
+define('ADMIN_REF_TARGET_INDEX', "Zur Eingangsseite");
+define('ADMIN_THEME_ALREADY_INSTALLED', "Theme bereits installiert.");
+define('ADMIN_INSTALL_THEME', "Theme importieren");
+define('ADMIN_NO_THEMES_FOUND', "Keine Themes gefunden!");
+define('THEME_UNIX', "Uni*-Name");
+define('THEME_NAME', "Theme-Titel");
+define('THEME_AUTHOR', "Author");
+define('THEME_URL', "Download-URL");
+define('THEME_VERSION', "Versionsnummer");
+define('THEME_INSTALL', "Import-Status");
+define('THEME_ACTIVE', "Aktiviert?");
+define('ADMIN_THEME_LIST_NOTE', "Diese Liste zeigt alle auf Ihrem Server abgelegten Themes sortiert nach dem Uni*-Namen an.");
+define('ADMIN_CHANGE_STATUS_THEME', "Themes de-/aktivieren");
+define('ADMIN_THEME_NO_OUTPUT', "Problem: Kein Text zum Ausgeben!");
+define('ADMIN_THEMES_UPDATED', "Themes wurden aktualisiert.");
+define('ADMIN_THEMES_DELETED', "Themes wurden gel&ouml;scht.");
+define('ADMIN_THEME_IMPORTED_1', "Theme <U>");
+define('ADMIN_THEME_IMPORTED_2', "</U> wurde importiert.");
+define('CURR_THEME_IS_1', "Aktuelles Design: <strong>");
+define('CURR_THEME_IS_2', "</strong>");
+define('ADMIN_NO_THEME_INSTALLED_WARNING', "Kein Design installiert!");
+define('CHANGE_THEME', "Design &auml;ndern");
+define('ADMIN_SET_AS_NEW_THEME', "Dieses Theme als Standart-Theme setzen");
+define('ADMIN_THEME_NEW_DEFAULT_THEME', "Durch Anklicken des Uni*-Names wird das jeweilige Theme als Standart-Theme gesetzt, welches Ihre Besucher sofort sehen werden.");
+define('ENTRY_DELETE', "Eintrag l&ouml;schen");
+define('ADMIN_NO_MENUS_FOUND', "Keine Men&uuml;s gefunden!");
+define('ADMIN_CONFIG_TITLE_SETTINGS', "Einstellungen am Seitentitel");
+define('ADMIN_CONFIG_TITLE_DECORATIONS', "Titeldekorationen");
+define('ADMIN_TITLE_ENABLE_DECORATIONS', "Dekorationen aktivieren");
+define('ADMIN_TITLE_ENABLE_MODULE_TITLE', "Modul-Titel in Seiten titel einblenden");
+define('ADMIN_TITLE_ENABLE_WHAT_TITLE', "Titel vom Men&uuml;punkt einblenden");
+define('ADMIN_TITLE_LEFT', "Linke Seite");
+define('ADMIN_TITLE_MIDDLE', "Mittleres Trennzeichen");
+define('ADMIN_TITLE_RIGHT', "Rechte Seite");
+define('ADMIN_MENU_PROBLEM_TITLE', "Problem im Admin-Men&uuml;system erkannt");
+define('CONFIRM_ACCOUNT', "Account best&auml;tigen");
+define('CONFIRMATION_LINK', "Hier best&auml;tigen");
+define('CLICK_NOW', "Klick!");
+define('MAILID_LINK', "Best.-Link");
+define('UNKNOWN_MAILID_CODE_1', "Unbekannter Fehler-Code <strong>");
+define('UNKNOWN_MAILID_CODE_2', "</strong> erkannt!");
+define('EXTENSION_PROBLEM_EXT_INACTIVE', "Erweiterung <strong>%s</strong> deaktiviert! Fehler: Kann nicht fortfahren!");
+define('CHANGE_GUEST_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmen&uuml;s");
+define('IS_LOCKED', "Ist gesperrt");
+define('ADMIN_REMOVE_STATS_ENTRY', "Hier klicken, um Mitgliederstatistik zu entfernen!");
+define('ADMIN_USER_STATS_REMOVED', "Mitgliederstatistiken entfernt.");
+define('MAIL_WILL_NEVER_EXPIRE', "Bestaetigungslink verfaellt nicht.");
+define('MEMBER_ENTER_MORE_RECEIVERS', "Geben Sie mindestens ein Empf&auml;nger ein!");
+define('MEMBER_NO_MORE_RECEIVERS_FOUND', "Es konnten nicht ausreichend genug empfangsbereite Mitglieder gefunden werden.");
+define('ADMIN_USER_PROFILE_TITLE', "Mitgliedsprofil aufrufen");
+define('LIST_UNCONFIRMED_MEMBER_LINKS', "Unbest&auml;tigte Maillinks eines Mitgliedes auflisten");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS_1', "Geben Sie mehr als <U>");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS_2', "</U> Empf&auml;nger ein!");
+define('NO_TEMPLATE_SUPPLIED', "Keinen Template-Namen uebergeben! Fehler im Script erkannt. Bitte den Webmaster (".WEBMASTER.") verstaendigen!");
+define('_OR', "oder");
+define('GUEST_NEW_PASSWORD_SEND', "Neues Passwort ist zu Ihrem Postfach unterwegs!");
+define('UNDER_CONSTRUCTION', "Funktion noch im Aufbau!");
+define('ADMIN_SUB_SUBJ', "{!POINTS!}-Abzug durch unsere Admins");
+define('ADMIN_POINTS_SUBTRACTED', "{!POINTS!} wurden erfolgreich abgezogen!");
+define('ADMIN_ALL_POINTS_SUBTRACTED', "Allen Mitgliedern wurden {!POINTS!} abgezogen!");
+define('ADMIN_SUB_POINTS_FROM_USER', "Abzug von {!POINTS!} eines Mitgliedes");
+define('ENTER_POINTS_SUB', "Abzuziehende {!POINTS!}");
+define('ENTER_SUB_REASON', "Grund des Abzuges");
+define('ADMIN_SUB_POINTS', "{!POINTS!} abziehen");
+define('ADMIN_SUB_POINTS_FROM_ALL', "Allen Mitgliedern {!POINTS!} abziehen");
+define('PATCH_DESCRIPTION', "Beschreibung zum Patch");
+define('DOWNLOAD_SVN', "SVN-Version herunterladen");
+define('SVN_REPOSITORY', "SVN-Repository");
+define('SVN_CHECKOUT_COMMAND', "SVN auschecken mit:");
+define('DOWNLOAD_NOW', "Jetzt downloaden!");
+define('ADMIN_MEMBER_STATS_TITLE', "Einstellungen an der Mitglieder-Statistik");
+define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite");
+define('MEMBER_NO_THEMES_FOUND', "Keine Design gefunden!");
+define('MEMBER_THEME_LIST_NOTE', "Wenn Sie Fragen zu einem der Designs haben, wenden Sie sich bitte an den jeweiligen Autor!");
+define('MEMBER_SAVE_THEME', "Design speichern");
+define('MEMBER_THEME_LIST_USAGE', "W&auml;hlen Sie unten ein neues Design aus und klicken Sie auf <strong>Theme abspeichern</strong>, das Design wird dann nur f&uuml;r Sie dauerhaft ge&auml;ndert.");
+define('MEMBER_THEME_SAVED', "Design gespeichert.");
+define('TASK_NO_TITLE', "Aufgabe ohne SQL-Anweisungen");
+define('UNCONFIRMED_LOCKED', "Anzahl zu best. Mails f&uuml;r Willkommensgutschrift");
+define('CONFIRMED_MAILS', "Bereits best. Mails");
+define('_YEARS'  , "Jahre");
+define('_MONTHS' , "Monate");
+define('_WEEKS'  , "Wochen");
+define('_DAYS'   , "Tage");
+define('_HOURS'  , "Stunden");
+define('_MINUTES', "Minuten");
+define('_SECONDS', "Sekunden");
+define('SORT_ASCENDING', "Aufsteigend");
+define('SORT_DESCENDING', "Absteigend");
+define('INVALID_EMAIL_ADDRESS_ENTERED', "Ung&uuml;tige EMail-Adresse eingegeben!");
+define('NEVER_HAPPENED', "Nie");
+define('WRONG_DB_SELECTED', "Falsche oder fehlende Datenbank ausgew&auml;hlt!");
+define('NO_CONFIG_FOUND', "Keine Konfigurationsdaten gefunden! (Leere Datenbank? Oder haben Sie die SQL-Dateien in andere Datenbank eingespielt?)");
+define('NO_CONFIG_FOUND_TITLE', "Keine Konfigurationsdaten gefunden!");
+define('SORTING_KEY', "Sortierung");
+define('ADMIN_ADD_BANNER', "Neuen Banner hinzuf&uuml;gen");
+define('ADMIN_ENTER_BANNER_URL', "Banner-URL");
+define('ADMIN_ENTER_ALTERNATE_TEXT', "Alternativen Text");
+define('ADMIN_SELECT_BANNER_ACTIVE', "Ist der Banner aktiv?");
+define('ADMIN_SUBMIT_BANNER', "Banner hinzuf&uuml;gen");
+define('ADMIN_LIST_REFERRALS_1', "Referral-&Uuml;bersicht des Mitgliedes ");
+define('ADMIN_LIST_REFERRALS_2', " in allen Ebenen:");
+define('ADMIN_LIST_REFERRALS_LEVEL_1', "Referrals in Ebene ");
+define('ADMIN_LIST_REFERRALS_LEVEL_2', ":");
+define('ADMIN_LIST_REFERRALS_NOTE', "<strong>&Auml;nderung:</strong> Klicken Sie die User-ID an und gelangen Sie zum Mitgliederprofil. Klicken Sie Anzahl Referrals an, werden die Referrals des jeweiligen Mitgliedes aufgelistet.");
+define('ADMIN_NORMAL_MAIL_ALREADY_DELETED', "Mitglieder-Mail bereits gel&ouml;scht!");
+define('INITIAL_RELEASE', "Erste Alpha-Version");
+define('NO_UPDATE_NOTES', "Keine Update-Hinweise gefunden!");
+define('MYSQL_QUERY_STRING', "MySQL-Abfragebefehl war:");
+// Until this line goes en.ph (please translate it to english!)
+define('MEMBER_NO_MAILS_IN_POOL', "Sie haben noch keine Mailbuchungen aufgegeben! Es k&ouml;nnen somit Ihnen auch keine angezeigt werden.");
+define('ADMIN_CONFIG_ADMIN_MENU_HEADER', "Einstellungen am Adminmen&uuml;");
+define('ADMIN_SELECT_MENU_TYPE', "Men&uuml;typ ausw&auml;hlen");
+define('ADMIN_MENU_NEW', "Neues Men&uuml;system mit &quot;logischen Bereichen&quot;");
+define('ADMIN_MENU_OLD', "Herk&ouml;mliches Men&uuml;system links im Browser");
+define('ADMIN_BACK_TO_GUEST_MENU', "Zum Gastmen&uuml; zur&uuml;ck...");
+define('ADMIN_LOGOUT_NOW', "Aus dem Admin-Bereich ausloggen");
+define('ADMIN_LOGOUT_NOTE', "Loggen Sie sich immer aus dem Admin-Bereich aus, wenn Sie beabsichten, ihn nicht mehr zu benutzen. Auch sollten Sie dies <strong>auf jedem Fall</strong> in einem Internet-Cafe vor Verlassen des Platzes tun!");
+define('ADMIN_LOGOUT_QUESTION', "Wollen Sie sich jetzt ausloggen?");
+define('ADMIN_LA_MODE', "Men&uuml;typ");
+define('ADMIN_ACCOUNT_NOREFS_404', "Es wurden keine Mitgliederaccounts ohne Werber gefunden, oder ver&auml;ndern Sie die Aussortierung!");
+define('ADMIN_SALT_LENGTH', "L&auml;nge des Zufallshashes f&uuml;r alle Passw&ouml;rter");
+define('MEMBER_PASS_SALTED', "Passwort wegen Update geaendert");
+define('MEMBER_PASSWORD_ERROR', "Fehler beim Abgleichen der Passw&ouml;rter!");
+define('ADMIN_PASS_SALTED', "Admin-Password wegen Update geaendert");
+define('ADMIN_SALT_LENGTH_NOTE', "Um f&uuml;r alle Accounts (Mitglieder/Admins derzeit) neue Passw&ouml;rter zu generieren, lassen Sie das Eingabefeld <strong>{--ADMIN_SALT_LENGTH--}</strong> leer oder geben Sie eine <strong>0</strong> ein! <strong>Vorsicht!</strong> Sie m&uuml;ssen sich dann anschliessend erneut einloggen!");
+define('LOGIN_FAILED_GENERAL', "Genereller Loginfehler! Bitte kontaktieren Sie den Webmaster!");
+define('DEFAULT_MT_WORD', "Mailtausch");
+define('DEFAULT_MT_WORD2', "Mailtausches");
+define('DEFAULT_POINTS', "Punkte");
+define('EXTENSION_PROBLEM_NOT_INSTALLED', "Erweiterung <u>%s</u> nicht installiert.");
+define('PROBLEM_POINTS_OVERVIEW_UNAVAILABLE', "{!POINTS!}-&Uuml;bersicht derzeit nicht verf&uuml;gbar.");
+define('ADMIN_NOTHING_SELECTED_CHANGE', "Sie haben nichts zum &Auml;ndern des Status ausgew&auml;hlt.");
+define('TEMPLATE_CONTENT', "Template-Content:");
+define('TEMPLATE_DATA', "Template-Daten:");
+define('ADMIN_LINK_DEL_USER_TITLE', "Mitglied l&ouml;schen (mit Abfrage)");
+define('ADMIN_LINK_EDIT_USER_TITLE', "Mitglied editieren");
+define('ADMIN_LINK_LOCK_USER_TITLE', "Mitglied sperren");
+define('ADMIN_LINK_UNLOCK_USER_TITLE', "Mitglied entsperren");
+define('ADMIN_LINK_ADD_POINTS_TITLE', "{!POINTS!} aufbuchen");
+define('ADMIN_LINK_SUB_POINTS_TITLE', "{!POINTS!} abziehen");
+define('LOGFILE_NOT_READABLE_1', "Das Logbuch <u>");
+define('LOGFILE_NOT_READABLE_2', "</u> konnte nicht geladen werden.");
+define('UNKNOWN_LOGFILE_FORMAT_1', "Das Logbuch <u>");
+define('UNKNOWN_LOGFILE_FORMAT_2', "</u> hat ein ung&uuml;ltiges oder nicht unterst&uuml;tztes Format.");
+define('MESSAGE_HEADER', "Hinweis");
+define('ADMIN_ALPHA_SELCTION', "Alphabetische Suche:");
+define('CATEGORY_NOT_SAVED', "Kategorie <u>%d</u> nicht gespeichert.");
+define('USER_ACCOUNT_404', "User-Account <u>%d</u> nicht gefunden.");
+define('ADMIN_CONTACT_USER', "Mitglied kontaktieren");
+define('CONTACT_USER', "Mitglied kontaktieren");
+define('ADMIN_USER_CONTACTED', "Das Mitglied wurde per EMail kontaktiert.");
+define('ADMIN_CONTACT_USER_SUBJECT', "Nachricht vom {!MT_WORD!} {!MAIN_TITLE!}");
+define('MEMBER_CANNOT_LOAD_PROFILE', "Fehler beim Laden des Mitgliederprofiles. Bitte Support benachrichten.");
+define('SHOW_TIMINGS_RUNTIME', "Laufzeit:");
+define('SHOW_TIMINGS_SQL_QUERIES', "SQL-Abfragen:");
+define('SHOW_TIMINGS_NUM_TEMPLATES', "Templates:");
+define('SHOW_TIMINGS_SECS', "Sek.");
+define('ADMIN_OPTION_SHOW_TIMINGS', "Skript-Statistiken im Seitenfuss einblenden (n&uuml;tzlich zum Debuggen)");
+define('ADMIN_OPTION_MAILID_REDIRECT', "Soll bei fehlerhafter/gel&ouml;schter Mailbuchung beim Best&auml;tigen die Mail auf die Hauptseite oder Ablehnungsseite weitergleitet werden?");
+define('ADMIN_CONFIG_MAILID_REDIRECT_INDEX', "Auf Hauptseite weiterleiten.");
+define('ADMIN_CONFIG_MAILID_REDIRECT_REJECT', "Auf Ablehnungsseite umleiten.");
+define('REASON_DIRECT_PAYMENT', "Direkte Gutschrift (siehe evtl. vorangegangene Mail)");
+define('SUBJECT_DIRECT_PAYMENT', "Direkte {!POINTS!}-Gutschrift durch das System");
+define('ADMIN_LOGOUT_SQL_PATCHES_DONE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung <strong>sql_patches</strong> installiert haben und dabei das Passort-Hashing ge&auml;ndert/verbessert wurde. Bitte erneut einloggen!");
+define('ADMIN_LOGOUT_SQL_PATCHES_REMOVE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung <strong>sql_patches</strong> entfernt haben. Bitte klicken Sie weiter, um jetzt das Passwort neu zu setzen.");
+define('ADMIN_POINTS_REPAYED', "Es wurden dem Mitglied <u>%s</u> {!POINTS!} zur&uuml;ckgeschrieben.");
+define('ADMIN_POINTS_TO_JACKPOT', "Es wurden <u>%s</u> {!POINTS!} in den Jackpot gelegt.");
+define('ADMIN_NO_POINTS_REPAYED', "Die Mailbuchung hatte keine {!POINTS!} zum zur&uuml;ckbuchen!");
+define('ADMIN_POINTS_SHREDDED', "Es wurden <u>%s</u> {!POINTS!} geschrettert.");
+define('EXTENSION_WARNING_EXT_INACTIVE', "Die Erweiterung <u>%s</u> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
+define('EXTENSION_WARNING_USER_LIMIT', "Die Erweiterung <u>user</u> ist nicht aktiv. Die Anzahl User pro Seite wurde auf 100 gesetzt. Bitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
+define('ADMIN_PROXY_SETTINGS_INVALID', "Ihre Proxy-Einstellungen scheinen ung&uuml;ltig zu sein!");
+define('ADMIN_EDIT_PROXY_SETTINGS', "Proxy-Einstellungen &auml;ndern");
+define('ADMIN_CONFIG_PROXY_HOST', "Hostname oder IP-Nummer:");
+define('ADMIN_CONFIG_PROXY_PORT', "Port-Nummer (z.B. 8085):");
+define('ADMIN_CONFIG_PROXY_USERNAME', "Benuztername (falls vorhanden):");
+define('ADMIN_CONFIG_PROXY_PASSWORD', "Passwort (falls vorhanden):");
+define('EDIT_ENTRIES', "Eintr&auml;ge &auml;ndern");
+define('_CATEGORY_NONE', "Keine Kategorie");
+define('__UNUSED', "Im Aufbau");
+
+define('ADMIN_SEND_RESET_LINK_TITLE', "1/4: Administratorkennwort zur&uuml;cksetzen");
+define('ADMIN_VALIDATE_HASH_TITLE', "2/4: Validierung Iher Logindaten");
+define('ADMIN_RESET_PASSWORD_TITLE', "3/4: Neues Passwort eingeben");
+define('ADMIN_RESET_PASS_DONE_TITLE', "4/4: Neues Passwort gesetzt");
+
+define('ADMIN_SEND_RESET_LINK_SUBMIT', "Passwort zur&uuml;cksetzen");
+define('ADMIN_VALIDATE_HASH_SUBMIT', "Adminlogindaten validieren");
+define('ADMIN_RESET_PASSWORD_SUBMIT', "Neues Kennwort setzen");
+
+define('ADMIN_SEND_RESET_LINK_NOTE', "Sobald Sie Ihre Email-Adresse eingegeben haben, wird Ihnen Ihr Loginname zugeschickt. Diesen geben Sie in dem n&auml;chsten Formular zusammen mit Ihrem neuen Passwort ein. Danach k&ouml;nnen Sie wieder in den Adminbereich einloggen.");
+define('ADMIN_VALIDATE_HASH_NOTE', "Sie haben diesen Link aus einer Mail angeklickt, die Ihnen zuvor zugesandt wurde. Daraus ben&ouml;tigen Sie Ihren Loginnamen, damit Ihre Daten validiert werden k&ouml;nnen. Nach Abesenden des Formulars k&ouml;nnen Sie dann Ihr Administratorkennwort &auml;ndern.");
+define('ADMIN_RESET_PASSWORD_NOTE', "Geben Sie nun zweimal ein neues Kennwort f&uuml;r das angezeigte Administratorlogin ein. Dabei sollten Sie Buchstaben, Zahlen und Sonderzeichen wie Slash, Strich, Unterstrich usw. verwenden, um die St&auml;rke des Passwortes zu maximieren.");
+
+define('ADMIN_ENTER_EMAIL', "Geben Sie Ihre Email-Adresse ein, die Ihrem Adminlogin hinterlegt ist:");
+define('ADMIN_ENTER_LOGIN', "Bitte geben Sie Ihr Administratorlogin ein, dass Sie in der Mail erhalten haben:");
+define('ADMIN_ENTER_PASSWORD1', "Geben Sie Ihr neues Administratorkennwort ein:");
+define('ADMIN_ENTER_PASSWORD2', "Wiederholen Sie das Passwort zur Best&auml;tigung:");
+
+define('ADMIN_RESET_PASS', "Ihr Administratorkennwort zur&uuml;cksetzen?");
+define('ADMIN_NO_LOGIN_WITH_EMAIL', "Kein Administrator-Account mit der angegebenen Email-Adresse gefunden!");
+define('ADMIN_RESET_PASS_LINK_SUBJ', "Zuruecksetzung Ihres Admin-Passwortes");
+define('ADMIN_RESET_LINK_SENT', "Der Reset-Link wurde soeben an Ihre eingegebene Email-Adresse ausgesendet.");
+define('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED', "Validierung Ihrer Logindaten fehlgeschlagen. Haben Sie auch den Link aus der Mail angeklickt und Ihren Loginnamen eingegeben?");
+define('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2', "Validierung Ihrer Logindaten fehlgeschlagen. Es liegt ein Fehler im Script vor. Bitte im <A href=\"http://forum.mxchange.org\">Support-Forum</A> den Fehler melden.");
+define('ADMIN_SHOW_LOGIN', "Ihr Administratorlogin:");
+define('ADMIN_CHANGE_LOGIN', "Anderes Adminlogin");
+define('ADMIN_PASSWORD_RESET_DONE', "Ihr Administratorkennwort wurde neu gesetzt. Sie k&ouml;nnen sich jetzt mit Ihren neuen Zugangsdaten im Adminbereich einloggen.");
+define('ADMIN_CONTINUE_LOGIN', "Weiter zum Administratorlogin");
+define('ADMIN_RESET_PASS_LINK', "Jetzt Ihr Administratorkennwort zur&uuml;cksetzen (n&ouml;tiger Schritt!)");
+define('ADMIN_SUPPORT_FORUM_LINK', "Direktlink zum Support-Forum (neues Fenster)");
+define('ADMIN_REFERAL_LEVEL_ZERO_NOTICE', "Die Referal-Ebene 0 ist das Mitglied selber und sollte daher auf 100% stehen. Sie sollte auch nicht ge&auml;ndert oder gel&ouml;scht werden! Dann erhalten Ihre Mitglieder keine {!POINTS!} gutgeschrieben.");
+define('ADMIN_ALL_ENTRIES_REMOVED', "Alle ausgew&auml;hlten Eintr&auml;ge sind gel&ouml;scht.");
+define('ADMIN_SOME_ENTRIES_NOT_DELETED', "Es wurden <u>%s</u> von <u>%s</u> ausgew&auml;hlten Eintr&auml;ge gel&ouml;scht.");
+define('ADMIN_ALL_ENTRIES_EDITED', "Alle ausgew&auml;hlten Eintr&auml;ge sind ge&auml;ndert.");
+define('ADMIN_SOME_ENTRIES_NOT_EDITED', "Es wurden <u>%s</u> von <u>%s</u> ausgew&auml;hlten Eintr&auml;ge ge&auml;ndert.");
+define('USER_NOT_REGISTERED', "Anmeldung hat nicht geklappt! :-( Ist unten eine Fehlermeldung eingeblendet? Bitte beim Support melden.");
+define('ADMIN_SELECTION_BOX_TITLE', "Mitglied f&uuml;r Aktion ausw&auml;hlen");
+define('ADMIN_DO_ACTION', "Aktion ausf&uuml;hren");
+define('MEMBER_ORDER_PLEASE_WAIT_TESTER', "Bitte warten Sie den Framekiller-Test ab!");
+define('MEMBER_ORDER_TEST_STARTED', "Framekiller-Test startet...");
+define('MEMBER_ORDER_PLEASE_WAIT_1', "Ihre Seite wird auf Framekiller getestet. Bitte noch ");
+define('MEMBER_ORDER_PLEASE_WAIT_2', " Sekunden warten.");
+define('ADMIN_LIST_NOREFS_ACCOUNTS', "Auflistung aller Accounts ohne Werber");
+define('ADMIN_NO_REF_LEVELS', "In Ihrem {!MT_WORD!} sind keine Referal-Ebenen eingerichtet! Ihre Mitglieder erhalten <u>keine</u> {!POINTS!} gutgeschrieben. Richten Sie mindestens Referal-Ebene 0 mit 100% Verg&uuml;tung ein.");
+define('ADMIN_SESSION_SAVE_PATH_INVALID', "Pfad f&uuml;r Sitzungsdateien ung&uuml;tig!");
+define('ADMIN_SESSION_SETTINGS_TITLE', "Einstellungen zum Sitzungsmanagement");
+define('ADMIN_CONFIG_SESSION_SAVE_PATH', "Speicherpfad f. Sitzungsdateien");
+define('ADMIN_BASE_PATH', "Absoluter Server-Pfad");
+define('ADMIN_SESSION_SAVE_PATH_NOTE', "Sie sollten f&uuml;r Sitzungsdateien einen Pfad w&auml;hlen der ausserhalb des Server-Pfades liegt, da sonst eventuell die Sitzungsdateien vom Web erreichbar sind, was ein hohes Sicherheitsrisiko darstellt.");
+
+//
+?>
diff --git a/inc/language/doubler_de.php b/inc/language/doubler_de.php
new file mode 100644 (file)
index 0000000..d54e12f
--- /dev/null
@@ -0,0 +1,144 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2005 *
+ * ===============                              Last change: 02/12/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : doubler_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_EDIT_DOUBLER_SETTINGS', "Einstellungen am {!POINTS!}-Verdoppler");
+define('ADMIN_DOUBLER_CHARGE', "Prozentuale Geb&uuml;hr zum Verdoppeln");
+define('ADMIN_DOUBLER_JACKPOT', "Soll der Jackpot zum Verdoppeln verwendet werden?");
+define('ADMIN_DOUBLER_SEND_MODE', "Aussendemodus der Benachrichtigungsmails");
+define('ADMIN_DOUBLER_SEND_DIRECT', "Aussenden, sobald gen&uuml;gend {!POINTS!} zur Auszahlung der Verdoppelung bereit stehen.");
+define('ADMIN_DOUBLER_SEND_RESET', "Erst beim t&auml;glichen Reset pr&uuml;fen, ob Verdoppelungen ausgezahlt werden k&ouml;nnen.");
+define('ADMIN_DOUBLER_TIMEOUT', "Verweildauer ausgezahlter Verdoppelungen in der Datenbank");
+define('ADMIN_DOUBLER_USERID', "Mitglieder-Account zur Verdoppelung verwenden");
+define('ADMIN_DOUBLER_DISPLAY_SETTINGS', "Anzeige-Einstellungen f&uuml;r Anzahl Eintr&auml;ge");
+define('ADMIN_DOUBLER_DISPLAY_NEW', "Anzahl ersten X neuen Eintr&auml;ge");
+define('ADMIN_DOUBLER_DISPLAY_PAY', "Anzahl ersten X vor Auszahlung stehender Verdoppelungen");
+define('ADMIN_DOUBLER_DISPLAY_OLD', "Anzahl ersten X bereits ausgezahlter Verdoppelungen");
+define('ADMIN_DOUBLER_REFERRAL', "Prozentuale Referral-Verg&uuml;tung");
+define('ADMIN_DOUBLER_MINIMUM', "Minimum {!POINTS!} die verdoppelt werden sollen");
+define('ADMIN_DOUBLER_MAXIMUM', "Maximum {!POINTS!} die verdoppelt werden sollen");
+define('ADMIN_DOUBLER_LEFT', "Auf dem Mitgliedsaccount nach Verdoppelung Minimum-{!POINTS!}-Guthaben");
+define('ADMIN_DOUBLER_OWN', "{!POINTS!}-Guthaben des Verdopplers zur Auszahlung verwenden");
+define('ADMIN_DOUBLER_GROUP_SENT', "Auf Anzahl durchf&uuml;hrbare Auszahlungen warten, damit an diese ausgezahlt werden kann. (Gruppenauszahlung!)");
+define('ADMIN_DOUBLER_MAX_SENT', "Pro Klick/Reset auf Auszahlungsf&auml;higkeit hin zu testende Verdopplungen");
+define('ADMIN_DOUBLER_SENT_ALL', "Soll anstelle der Gruppenauszahlung alle m&ouml;glichen Auszahlungen durchgef&uuml;hrt werden?");
+define('ADMIN_DOUBLER_LIST_OVERVIEW', "Auflistung der Verdoppelungen - &Uuml;bersichtsseite");
+define('ADMIN_DOUBLER_LIST_ALREADY', "Bereits get&auml;tigte Auszahlungen");
+define('ADMIN_DOUBLER_LIST_WAITING', "Wartene Auszahlungen");
+define('ADMIN_DOUBLER_ALREADY_ALL', "Gesamt Auszahlungen");
+define('ADMIN_DOUBLER_ALREADY_DIRECT', "Direkte Auszahlungen");
+define('ADMIN_DOUBLER_ALREADY_REF', "Referral-Auszahlungen");
+define('ADMIN_DOUBLER_WAITING_ALL', "Gesamt wartend");
+define('ADMIN_DOUBLER_WAITING_DIRECT', "Direkte w. Auszahlungen");
+define('ADMIN_DOUBLER_WAITING_REF', "W. Referral-Auszahlungen");
+define('ADMIN_DOUBLER_PAYMENT_TIMEMARK', "Eingezahlt");
+define('ADMIN_DOUBLER_LIST_ALREADY_ALL', "Alle bereits ausgezahlten {!POINTS!}");
+define('ADMIN_DOUBLER_LIST_ALREADY_DIRECT', "Direkt ausgezahlte {!POINTS!}");
+define('ADMIN_DOUBLER_LIST_ALREADY_REF', "Ausgezahlte Referral-{!POINTS!}");
+define('ADMIN_DOUBLER_LIST_WAITING_ALL', "Alle wartenden {!POINTS!}-Auszahlungen");
+define('ADMIN_DOUBLER_LIST_WAITING_DIRECT', "Wartende Direkt-Auszahlungen");
+define('ADMIN_DOUBLER_LIST_WAITING_REF', "Wartende Referral-Auszahlungen");
+
+define('DOUBLER_TITLE', "Verdoppler");
+define('DOUBLER_ENTER_LOGIN_DATA', "Geben Sie hier Ihre Zugangsdaten ein:");
+define('DOUBLER_NOTE_FOR_PASSWORD', "Das Passwort wird nicht gespeichert.");
+define('DOUBLER_ENTER_POINTS', "{!POINTS!} zum Verdoppeln");
+define('DOUBLER_NOW', "Verdoppeln!");
+define('DOUBLER_ALREADY_PAYED_1', "Es wurden bereits");
+define('DOUBLER_ALREADY_PAYED_2', "ausgezahlt.");
+define('DOUBLER_MINIMUM_IS', "Mindestens");
+define('DOUBLER_MAXIMUM_IS', "verdoppeln, maximal");
+define('DOUBLER_HAVE_FUN', "Viel Spa&szlig;!");
+define('DOUBLER_POINTS_1', "Wenn Sie {!POINTS!} verdoppeln, kommen Sie diese nach Abzug von");
+define('DOUBLER_POINTS_2', "Betriebergeb&uuml;hr in einen Topf; bei Erreichen einer Verdopplung wird diese der Einzahlungsreihe nach, automatisch ausgef&uuml;hrt.");
+define('DOUBLER_EXAMPLE_1', "Beispiel: Einzahlung");
+define('DOUBLER_EXAMPLE_2', "Auszahlung:");
+define('DOUBLER_EXAMPLE_3', ", sobald Sie an der Reihe sind, ohne(*) ein Risiko einzugehen!");
+define('DOUBLER_FULL_PAYOUT', "100% Auszahlung");
+define('DOUBLER_REFERRAL_1', "Refverdienst: Es gibt");
+define('DOUBLER_REFERRAL_2', "Refverdienst. Wenn Sie {!POINTS!} auf dem Refkonto durch Werbung erwirtschaftet haben,");
+define('DOUBLER_REFERRAL_3', "(Wichtig! Maximal Verdoppelung darf nicht &uuml;berschritten werden)");
+define('DOUBLER_REFERRAL_4', "werden diese bei Ihrer n&auml;chsten Verdoppelung aufgeschlagen.");
+define('DOUBLER_REFERRAL_5', "Beispiel: Sie haben");
+define('DOUBLER_REFERRAL_6', "Refverdienst und verdoppeln");
+define('DOUBLER_REFERRAL_7', ", Sie bekommen - sobald Sie an der Reihe sind -");
+define('DOUBLER_REFERRAL_8', "zur&uuml;ck.");
+define('DOUBLER_TIMEOUT_1', "Es werden Eintr&auml;ge nicht &auml;lter als");
+define('DOUBLER_TIMEOUT_2', "angezeigt.");
+define('DOUBLER_REFERRAL_LINK', "Den Reflink erfahren Sie nach jeder Verdoppelung.");
+define('DOUBLER_NOT_YET_REGISTERED', "Noch nicht angemeldet?");
+define('DOUBLER_REGISTER_NOW', "Weiter zur Anmeldung!");
+define('DOUBLER_YOUR_ADVERTISING_HERE', "Hier k&ouml;nnte auch Ihre Werbung stehen:");
+define('DOUBLER_CONTACT_US', "Fragen Sie uns nach unseren Konditionen!");
+define('DOUBLER_FORM_404_LOGIN', "Login nicht eingegeben!");
+define('DOUBLER_FORM_404_PASSWORD', "Password nicht eingeben!");
+define('DOUBLER_FORM_404_POINTS', "Keine {!POINTS!} zum Verdoppeln eingegeben!");
+define('DOUBLER_FORM_404_NICKNAME', "Unbekannter Nickname eingegeben oder falsches Passwort!");
+define('DOUBLER_FORM_404_MEMBER', "Mitgliedsaccount nicht gefunden oder falsches Passwort!");
+define('DOUBLER_FORM_STATUS_UNCONFIRMED', "Bitte best&auml;tigen Sie erst Ihre EMail-Adresse. Den Best&auml;tigungslink k&ouml;nnen Sie <A href=\"".URL."/modules.php?module=index&amp;what=confirm\">hier erneut per EMail anfordern</A> !");
+define('DOUBLER_FORM_STATUS_LOCKED', "Ihr Account wurde von einem Administrator oder durch Urlaub gesperrt. Bitte <A href=\"".URL."/modules.php?module=index&amp;what=impressum\">melden Sie sich bei uns</A>, damit wir Ihren Account freischalten k&ouml;nnen!");
+define('DOUBLER_FORM_WRONG_PASS', "Passwort ist falsch!");
+define('DOUBLER_FORM_POINTS_MIN', "Zu wenig {!POINTS!} zum Verdoppeln eingegeben!");
+define('DOUBLER_FORM_POINTS_MAX', "Zu viele {!POINTS!} zum Verdoppeln eingegeben!");
+define('DOUBLER_FORM_NO_POINTS_LEFT', "Sie haben nicht ausreichend {!POINTS!} &uuml;brig!");
+define('DOUBLER_MEMBER_SUBJECT', "Gutschrift durch Verdoppelung");
+define('DOUBLER_PAYOUT_TIME_DIRECT', "Die Auszahlung erfolgt unmittelbar, nachdem gen&uuml;gend {!POINTS!} zusammengekommen sind, um Ihnen die Verdoppelung auszuzahlen.");
+define('DOUBLER_PAYOUT_TIME_RESET', "Abends um 00:00 Uhr jeden Tages wird gepr&uuml;ft, ob gen&uuml;gend {!POINTS!} zusammengekommen sind, um Ihnen die Verdoppelung auszuzahlen.");
+define('DOUBLER_NO_ENTRIES_FOUND', "Keine Eintr&auml;ge gefunden!");
+define('DOUBLER_TIMEMARK', "Auszahlungstag");
+define('DOUBLER_GENERAL_INFOS', "Allgemeine Informationen zum Verdoppeln");
+define('DOUBLER_ALREADY_PAYOUT', "Bereits an unsere Mitglieder ausgezahlte Betr&auml;ge");
+define('DOUBLER_REGISTER_ADVERT', "Weiter zur Anmeldung / Werbebuchung");
+define('DOUBLER_NEXT_PAYOUT', "Die als n&auml;chstes anstehenden Auszahlungen");
+define('DOUBLER_WANNA_TRY', "Wollen Sie mal ausprobieren?");
+define('DOUBLER_GUEST_NO_ENTRIES_FOUND', "In dieser Kategorie hat noch kein Mitglied einen Eintrag!");
+define('DOUBLER_MEMBER_NO_ENTRIES_FOUND', "In dieser Kategorie haben Sie noch keine Eintr&auml;ge!");
+define('DOUBLER_MEMBER_ALREADY_PAYOUT', "An Sie bereits ausgezahlte Verdoppelungen");
+define('DOUBLER_MEMBER_NEXT_PAYOUT', "Sie erhalten bald folgende Verdoppelungen ausgezahlt");
+define('DOUBLER_MEMBER_REF_PAYOUT', "Ihr Refferal-Verdienst");
+define('DOUBLER_MEMBER_YOUR_LINK', "Hier ist Ihr Verdoppler-Link");
+define('DOUBLER_MEMBER_LINK_NOTE', "<STRONG>Tipp:</STRONG> Nutzen Sie diesen zum Werben unseres {!MT_WORD2!}, um die <STRONG>{!__REF_VALUE!}%</STRONG> Referral-Verg&uuml;tung zu erhalten!");
+define('DOUBLER_MEMBER_YOUR_REFLINK', "Ihr Referral-Link zum Verdoppeln");
+define('DOUBLER_POINTS_LEFT_1', "Es stehen noch");
+define('DOUBLER_POINTS_LEFT_2', "zum Verdoppeln zur Verf&uuml;gung.");
+define('DOUBLER_USAGE_COUNTER_1', "Der Verdoppler wurde bereits");
+define('DOUBLER_USAGE_COUNTER_2', "mal genutzt.");
+
+//
+?>
diff --git a/inc/language/en.ph b/inc/language/en.ph
new file mode 100644 (file)
index 0000000..465cd18
--- /dev/null
@@ -0,0 +1,744 @@
+define('GUEST_WRONG_ID_EMAIL', "Could not find account data. Possible reasons are a wrong Login ID or email address. Please try it again.");
+define('GUEST_NEW_PASS_1', "You or an other member");
+define('GUEST_NEW_PASS_2', "have requested a new password resently. Here is your new password:");
+define('YOUR_NEW_PASS', "New password");
+define('GUEST_NOT_THIS_REPORT', "If you have not requested this please contact us soon!\n\nBest regards,");
+define('GUEST_NEW_PASSWORD', "Your password request");
+define('LOGIN_UNKNOWN_CODE', "Unknown return code!");
+define('LOGIN_WRONG_PASS', "Wrong password entered.");
+define('LOGIN_WRONG_ID', "Your login ID is no longer valid.");
+define('LOGIN_ID_LOCKED', "Your account has been locked.");
+define('LOGIN_ID_UNCONFIRMED', "Please confirm your email address before proceding here!<BR>Have you lost your personal confirmation link? In left menu you can request it again!");
+define('LOGIN_NO_COOKIES', "Please switch on cookies for this mailer or lower your security settings in IE settings.");
+define('GUEST_REG_POINTS_1', "For your successfull registration we have added");
+define('GUEST_REG_POINTS_2', "{!POINTS!} to your account. As long as there are enough receivers left you can already send emails to other members.");
+define('GUEST_SELECT_LIFETIME', "How long do you want stay logged in?");
+define('LIFE_CLOSE_BROWSER', "Browser is closed");
+define('LIFE_HOURS', "Hour(s)");
+define('LIFE_DAYS', "Day(s)");
+define('LIFE_WEEKS', "Week(s)");
+define('LIFE_MONTHS', "Month(s)");
+define('LIFE_YEARS', "Year(s)");
+define('LANG_MEM_ONLY_1', "Only logged in members are allowed to access the module <U>");
+define('LANG_MEM_ONLY_2', "</U>.");
+define('MEMBER_404_ACTION_1', "The requested member action-module <U>");
+define('MEMBER_404_ACTION_2', "</U> was not found on this server.");
+define('_GUEST', "Guest");
+define('_UNKNOWN', "Unknown person");
+define('_ADMIN', "Administrator");
+define('LAST_ONLINE', "Your last online time was");
+define('LAST_MODULE', "Your last selected module was");
+define('MEMBER_EDIT_PROFILE', "Edit your profile");
+define('GENDER', "Gender");
+define('GUEST_GENDER', "Gender);
+define('GENDER_M', "Male");
+define('GENDER_F', "Female");
+define('GENDER_C', "Company");
+define('SAVE_CHANGES', "Save changes");
+define('MYDATA_NOTE', "Geben Sie nur bei <STRONG>Passwort</STRONG> Ihr aktuelles Passwort ein, wenn Sie nur Daten &auml;ndern wollen. Geben Sie bei <STRONG>Passwortbest&auml;tigung</STRONG> das neue Passwort erneut ein, wenn Sie Ihr aktuelles Passwort &auml;ndern wollen.");
+define('MEMBER_UPDATE_PWD_WRONG', "Bitte geben Sie Ihr aktuelles Passwort zum &Auml;ndern Ihrer Einstellungen ein. Wir haben dies zur Sicherheit unserer Mitglieder eingebaut.");
+define('MEMBER_HAVE_CHANGED_DATA', "Sie haben heute Ihr Mitgliedsprofil ge&auml;ndert.");
+define('YOUR_NEW_DATA', "Hier sind Ihre neuen Profildaten");
+define('PLEASE_NOTIFY_ABUSE_MYDATA', "Sollten Sie diese &Auml;nderungen nicht durchgef&uuml;hrt haben, benachrichten Sie uns bitte! (".WEBMASTER.")");
+define('MEMBER_UNKNOWN_MODE', "Unbekannter Modus erkannt");
+define('MEMBER_CHANGED_EMAIL', "Sie haben Ihre Email-Adresse ge&auml;ndert! Alte Adresse war");
+define('MEMBER_CHANGED_PASS', "Sie haben Ihr Passwort ge&auml;ndert.");
+define('MEMBER_CHANGED_DATA', "&Auml;nderung Ihrer Profildaten");
+define('MYDATA_MAIL_SENT', "Es ist eine Email zu Ihnen unterwegs.");
+define('ADMIN_CHANGED_DATA', "Profildaten geaendert");
+define('ADMIN_MEMBER_CHANGED_PROFILE', "Eines Ihrer Mitglieder hat seine Profildaten ge&auml;ndert!");
+define('MEMBER_UID', "Seine Login-ID lautet");
+define('LOGOUT_DONE', "Ausloggen abgeschlossen!");
+define('LOGOUT_FAILED', "Ausloggen fehlgeschlagen!");
+define('MEMBER_NO_CATS', "Es wurden bis jetzt noch keine Kategorien eingerichtet!");
+define('SELECT_CAT', "Mails aus Kategorie empfangen?");
+define('MEMBER_CATS_SAVED', "Kategorien gespeichert.");
+define('YOUR_PERSONAL_REFLINK', "Ihr pers&ouml;nlicher Ref-Link zum Werben neuer Mitglieder lautet");
+define('YOUR_REFCLICKS', "Klicks auf Ihren Referral-Link");
+define('CLICKS', "Klicks");
+define('YOU_REFERRAL_ONE', "Sie haben heute ein neues Mitglied f&uuml;r unseren {!MT_WORD!} geworben!\n\nHier sehen Sie genau, in welcher Ebene Sie ihn geworben haben:");
+define('YOU_THANX_REFERRAL', "Sie werden nun auch weiterhin {!POINTS!} &uuml;ber diese geworbene Person erhalten.\n\nVielen Dank f&uuml;r Ihr Mitwerben! Wir w&uuml;nschen Ihnen noch weiterhin viele neue Referrals!\n\nMit freundlichem Gruss,");
+define('POINTS_REF_REGISTER', "Referral-Pauschale und prozentual vom Anmeldebonus!");
+define('NO_REFLEVEL_LEFT', "Keine Referral-Ebenen mehr verf&uuml;gbar! Bitte melden Sie sich bei uns.");
+define('ENGINE', "{!MT_WORD!}-Engine");
+define('ADD_NEW_PAYMENT', "Neue Mailverg&uuml;tung hinzuf&uuml;gen");
+define('ENTER_PAY_TIME', "Wartezeit");
+define('ENTER_PAY_PAYMENT', "Verg&uuml;tete {!POINTS!}");
+define('ENTER_PAY_PRICE', "{!POINTS!}-Kosten");
+define('ENTER_PAY_TITLE', "Mailname");
+define('ADD_PAYMENT', "Mailverg&uuml;tung hinzuf&uuml;gen");
+define('EDIT_DEL_PAYMENT', "Mailverg&uuml;tung editieren / l&ouml;schen");
+define('PAY_TIME', "Wartezeit");
+define('PAY_PAYMENT', "Verg&uuml;tete {!POINTS!}");
+define('PAY_PRICE', "{!POINTS!}-Kosten");
+define('PAY_TITLE', "Mailname");
+define('EDIT_PAY', "Editeren");
+define('DEL_PAY', "L&ouml;schen");
+define('ADD_NEW_REFBANNER', "Neuen Banner hinzuf&uuml;gen");
+define('ENTER_URL', "Banner-URL");
+define('ENTER_ALTERNATE', "Alternativen Text");
+define('SELECT_VISIBLE', "Ist der Banner aktiv?");
+define('ADD_REFBANNER', "Banner hinzuf&uuml;gen");
+define('EDIT_DEL_REFBANNER', "Werbebanner editieren / l&ouml;schen");
+define('VIEWS', "Einblendungen");
+define('REF_URL', "Banner");
+define('REF_TITLE', "Alternativer Text");
+define('REF_CNTR', "Einblendungen");
+define('REF_VIS', "Banner aktiv?");
+define('POINTS_USED', "Verbrauchte {!POINTS!}");
+define('MEMBER_NO_POINTS', "Sie haben keine {!POINTS!} mehr zum Versenden &uuml;brig!");
+define('MEMBER_NO_PAYMENTS', "Der Admin diesen {!MT_WORD2!} hat noch keine Mailarten definiert!");
+define('MEMBER_POINTS_LEFT', "{!POINTS!}-Guthaben zum Mailversand &uuml;brig");
+define('SELECT_MAIL_TYPE', "Mailart ausw&auml;hlen");
+define('PLEASE_SELECT', "Bitte ausw&auml;hlen");
+define('PER_MAIL', "{!POINTS!} / Mail");
+define('PAYMENT', "{!POINTS!} Verg&uuml;tung");
+define('SELECT_CATEGORY', "Zielkategorie");
+define('USER_IN_CAT', "Empf&auml;nger");
+define('ENTER_RECEIVER', "Empf&auml;ngeranzahl");
+define('ENTER_SUBJECT', "Betreffzeile");
+define('ENTER_TEXT', "Werbetext");
+define('MEMBER_PLEASE_NOTE', "Bitte beachten Sie vor dem Absenden:");
+define('MEMBER_ENTER_URL', "URL");
+define('CONTINUE_FRAMETESTER', "Weiter zum Framekiller-Test");
+define('MEMBER_URL_TIME_LOCK', "Sie hatten bereits die selbe URL gebucht:");
+define('MEMBER_LAST_TLOCK', "Ihre letzte Buchung war am");
+define('CONFIG_URL_TLOCK', "Selbe URLs sind buchbar in");
+define('HOURS', "Stunden");
+define('MINS', "Minuten");
+define('SECS', "Sekunden");
+define('_AND', "und");
+define('UNKNOWN_CODE_1', "Es ist w&auml;hrend der Ausf&uuml;hrung ein unbekannter Fehler-Code <STRONG>");
+define('UNKNOWN_CODE_2', "</STRONG> enstanden, f&uuml;r den Sie vermutlich nicht verantwortlich sind. Bitte informieren Sie uns &uuml;ber diese Meldung!");
+define('MEMBER_TEXT_CONTAINS_URL', "Ihr Werbetext enth&auml;lt eine URL, dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrem Text und versuchen Sie es erneut.");
+define('MEMBER_TEXT_OVERLENGTH', "Ihr Text hat die maximale Textl&auml;nge &uuml;berschritten. Bitte fassen Sie ihn etwas k&uuml;rzer.");
+define('MEMBER_SUBJ_CONTAINS_URL', "Ihre eingegebe Betreffzeile enth&auml;lt eine URL,  dies ist in unserem {!MT_WORD!} nicht zul&auml;ssig. Bitte entfernen Sie diese aus Ihrer Betreffzeile und versuchen Sie es erneut.");
+define('MEMBER_URL_BLACK_LISTED', "Ihre eingegebene URL wurde in unsere Ausschlussliste aufgenommen!");
+define('MEMBER_BLIST_TIME', "Datum der Sperrung war");
+define('MEMBER_SELECTED_MORE_RECS', "Sie haben f&uuml;r diese Kategorie zu viele Empf&auml;nger eingegeben!");
+define('MEMBER_GO_BACK', "Zur&uuml;ck zum Buchungsformular");
+define('MEMBER_DO_ORDER', "Mailbuchung jetzt durchf&uuml;hren");
+define('LOADER_NOT_WORKING', "Falls die Weiterleitung nicht automatisch in einer Sekunde klappen sollte,");
+define('LOADER_CLICK_HERE', "so kommen Sie hier zur externen Seite weiter");
+define('ADMIN_NEW_MAIL_IN_QUEUE', "Ein Mitglied hat soeben eine Mailbuchung durchgef&uuml;hrt!\n\nSeine Buchung befindet sich nun im Sende-Pool und wird automatisch in 100-Mail-Bloecken versand.\n\nHier sind nochmals seine Daten, gebuchter Text und URL zur Verifizierung");
+define('ADMIN_SECOND_MAIL', "Sie werden bald nochmals benachrichtig, sobald der Versand vollstaendig beendet wurde.");
+define('_CATEGORY_404', "Kategorie nicht gefunden!");
+define('_PAYMENT_404', "Payment-Typ nicht gefunden!");
+define('ORDERED_CATEGORY', "Gebuchte Kategorie");
+define('MEMBER_MAILTYPE', "Gebuchter Payment-Typ");
+define('MEMBER_SUBJECT', "Betreffzeile in den Mails");
+define('MEMBER_URL', "Gebuchte URL");
+define('MEMBER_NEW_MAIL_IN_QUEUE', "Ihre Mailbuchung befindet sich derzeit in Warteschleife und wird bald ausgesendet!\n\nHier sind nochmals Ihre Daten aus dem Buchungsformular");
+define('MEMBER_SECOND_MAIL', "Sobald Ihre Mailbuchung vollst&auml;ndig gesendet wurde, erhalten Sie eine zweite Mail! Sie k&ouml;nnen bereits eine weitere Mailbuchung durchf&uuml;hren!");
+define('ADMIN_NEW_QUEUE', "Mailbuchung in Ihrem {!MT_WORD!}");
+define('MEMBER_NEW_QUEUE', "Vielen Dank fuer die Mailbuchung!");
+define('MEMBER_CONTINUE_AREA', "Weiter zum Mitgliedsbereich");
+define('MEMBER_THANX_ORDER', "Vielen Dank f&uuml;r Ihre Mailbuchung! Es ist eine Mail zu Ihnen unterwegs.");
+define('ADMIN_NO_MAILS_IN_POOL', "Es wurden noch keine Mailbuchungen aufgegeben, kann somit keine Mails anzeigen!");
+define('ADMIN_POOL_CONTENT', "Mailbuchungen im Sende-Pool (alle)");
+define('POOL_UNKNOWN', "Unbekannt");
+define('POOL_TEMP', "Neuer Auftrag");
+define('POOL_SEND', "Gesendet");
+define('POOL_NEW', "Wartet auf Versand");
+define('POOL_ADMIN', "Wartet auf Freischaltung");
+define('EMAIL_SENDER', "Versender");
+define('EMAIL_SUBJECT', "Betreffzeile");
+define('EMAIL_TEXT', "Gebuchter Text");
+define('EMAIL_PAYMENT', "Mailart");
+define('EMAIL_CATEGORY', "Gebuchte Kategorie");
+define('EMAIL_RECEIVERS', "Anzahl Empf&auml;nger");
+define('EMAIL_RUIDS', "User-IDs");
+define('EMAIL_POOL_TYPE', "Derzeitiger Status");
+define('EMAIL_TSEND', "Noch zu sendene Mails");
+define('EMAIL_URL', "Beworbene URL");
+define('ADMIN_TEST_URL', "URL testen");
+define('EMAIL_TIMESTAMP', "Gebucht am");
+define('GUEST_FRAMETESTER_TOP', "Sollte dieser Text verschwinden, enth&auml;lt Ihre Webseite einen Frame-Killer!");
+define('ADMIN_SELECT_EMAIL_EDIT', "Email ausw&auml;hlen, um diese zu editieren");
+define('RESET_SELECT', "Auswahl zur&uuml;cknehmen");
+define('ADMIN_EDIT_EMAIL', "Mailbuchung bearbeiten");
+define('ADMIN_CHANGE_EMAIL', "&Auml;nderungen speichern");
+define('EDIT_URL', "URL bearbeiten");
+define('EMAIL_EDIT_SUBJ', "Betreff bearbeiten");
+define('EMAIL_EDIT_TEXT', "Werbetext bearbeiten");
+define('ADMIN_UNLOCK_EMAILS', "Neue Mailbuchungen freischalten");
+define('EMAIL_ACCEPT', "Annehmen");
+define('EMAIL_REJECT', "Ablehnen und umleiten");
+define('CANNOT_RE_REGISTER_SESS', "Kann Sitzungs-Cookies nicht doppelt registrieren oder es liegt ein Script-Fehler vor!");
+define('ADMIN_MAIL_ACCEPTED', "Einer unserer Administratoren hat soeben Ihre Mailbuchung freigegeben. Sie wird von unserem System automatisch versendet! Bitte beachten Sie, dass dies ggf. zeitversetzt zu dieser Mail versendet wird. Hier sind nochmals URL und Betreff Ihrer Mailbuchung");
+define('ADMIN_THANX_ORDER', "Sie koennen den Versand-Fortschritt im Mitgliedsmenue unter \"Unbestaetigte Mails\" verfolgen. Sobald die Mail vollstaendig versendet wurde, erhalten Sie eine weitere Mail!");
+define('ADMIN_MAILS_ACTIVATED', "Die Mailbuchungen wurden in den Sende-Pool &uuml;bertragen und werden bald versand.");
+define('ADMIN_MAIL_REJECTED', "Einer unserer Administratoren hat soeben Ihre Mailbuchung abgelehnt. Bite beachten Sie unsere AGBs! Bei weiteren Verstoessen gegen unsere AGBs werden wir Ihre URL und ggf. auch Ihren Account sperren. Hier sind nochmals Ihre URL und Betreff Ihrer Mailbuchung");
+define('ADMIN_THANX_REJECTED', "Ihre Mailbuchung wurde somit gel&ouml;scht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support.");
+define('ADMIN_REJECTED_URLS', "URLs ausw&auml;hlen, die in die Black-List aufgenommen werden sollen:");
+define('ADMIN_LOCK_URLS', "URLs in die Black-List aufnehmen");
+define('ADMIN_URLS_BLOCKED', "URLs wurden in die Black-List aufgenommen!");
+define('ADMIN_SENDING_DONE', "Eine gebuchte Mail wurde soeben vollstaendig ausgesendet. Das werbende Mitglied wurde darueber in Kenntnis gesetzt.");
+define('ADMIN_NOTIFY_DONE', "Sollte diese Buchung nicht Ihren AGBs entsprechen, loggen Sie sich bitte in den Admin-Bereich ein und aendern die Mail.");
+define('ADMIN_SUBJ_SEND_DONE', "Vollstaendig: Aussendung einer Werbebbuchung!");
+define('MEMBER_SENDING_DONE', "Ihre gebuchte Mail wurde soeben vollstaendig von unserem System versendet! Wir wuenschen Ihnen viel Erfolg mit Ihrer Werbebuchung!");
+define('MEMBER_NOTIFY_DONE', "Den weiteren Verlauf dieser Werbebuchung koennen Sie im Mitgliedsbereich unter Statistiken verfolgen!");
+define('MEMBER_SUBJ_SEND_DONE', "Ihre Werbebuchung wurde versandt");
+define('GUEST_SELECT_LEAST_CATS_1', "Bitte w&auml;hlen Sie mindestens <STRONG><BIG>");
+define('GUEST_SELECT_LEAST_CATS_2', "</BIG></STRONG> Kategorien aus. Anderfalls erfolgt keine Anmeldung!");
+define('MEMBER_POOL_CONTENT', "Ihre Mails im Sende-Pool");
+define('EMAIL_END_SEND', "Vollst&auml;ndig versendet");
+define('EMAIL_CONFIRMED', "Best&auml;tigt");
+define('EMAIL_PERCENT', "Klickrate");
+define('MEMBER_NO_MAILS_TO_CONFIRM', "Keine Mails &uuml;brig zum Best&auml;tigen!");
+define('MEMBER_SID', "Mail-ID");
+define('CONFIRM_LINK', "Best&auml;tigungslink");
+define('MAIL_ALREADY_CONFIRMED', "Mail bereits verguetet oder Link ist nicht mehr gueltig!");
+define('MAIL_STATS_404', "Konnte Daten aus der Statistik-Tabelle nicht laden!");
+define('USER_NOT_FOUND', "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?");
+define('UNKNOWN_STATUS', "Unbekannter Account-Status");
+define('ADMIN_UNCONFIRMED_ACCOUNTS', "Hier alle Accounts, deren Email-Adresse nicht best&auml;tigt ist");
+define('_UID', "User-ID");
+define('REMOTE_IP', "IP-Nummer");
+define('REF_UID', "Werber-ID");
+define('UNKNOWN_STATUS_1', "Unbekannter Status <STRONG>");
+define('UNKNOWN_STATUS_2', "</STRONG> erkannt!");
+define('ACCOUNT_STATUS', "Account-Status");
+define('ACCOUNT_UNCONFIRMED', "<SPAN class=\"admin_failed\">Unbest&auml;tigt</SPAN>");
+define('ACCOUNT_CONFIRMED', "<SPAN class=\"admin_green\">Best&auml;tigt</SPAN>");
+define('ACCOUNT_LOCKED', "Gesperrt");
+define('ADMIN_ALL_ACCOUNTS', "Alle Mitglieder-Accounts auflisten");
+define('ADMIN_NO_NONE_REGISTERED', "Ihre Suchkriterieren ergaben keine Treffer in der Mitgliederliste.");
+define('ADMIN_MEMBER_404_1', "Mitglieds-Account <STRONG>");
+define('ADMIN_MEMBER_404_2', "</STRONG> existiert nicht!");
+define('ADMIN_LAST_ONLINE', "Zuletzt aktiv");
+define('ADMIN_LAST_MODULE', "Letzte Aktion");
+define('RECEIVE_MAILS', "Kann Mails empfangen");
+define('REF_CLICKS', "Klicks auf Ref-Link");
+define('TOTAL_LOGINS', "Logins gesamt");
+define('USED_POINTS', "Verwendete {!POINTS!}");
+define('MAILS_SENT', "Mails versendet");
+define('HAS_JOINED', "Beigetreten am");
+define('TOTAL_POINTS', "{!POINTS!} gesamt");
+define('TOTAL_REFERRALS', "Referrals gesamt");
+define('ADMIN_MEMBER_FUNCTIONS', "Administrative Funktionen");
+define('ADMIN_DEL_USER', "L&ouml;schen");
+define('ADMIN_LOCK_USER', "Sperren");
+define('ADMIN_UNLOCK_USER', "Entsperren");
+define('ADMIN_ADD_POINTS', "{!POINTS!} aufbuchen");
+define('ADMIN_EDIT_USER', "&Auml;ndern");
+define('ADMIN_ALL_REFS', "Alle Refs auflisten");
+define('BIRTHDAY2', "Geburtstag");
+define('TOTAL_CATS', "Ausgew&auml;hlte Kategorien");
+define('ADMIN_GOTO_USERLIST', "Dieser Men&uuml;punkt kann nicht direkt aufgerufen werden. Bitte rufen Sie stattdessen <I><U>User auflisten</U></I> auf.");
+define('ADMIN_USER_UPDATED', "Das Mitgliedsaccount wurde aktualisiert!");
+define('ADMIN_LOCKED_YOUR_ACCOUNT', "Ihr Account wurde von einem unserer Administratoren gesperrt! Bitte halten Sie sich an unsere AGBs.");
+define('REASON_LOCKED', "Grund der Sperrung war");
+define('MEMBER_PLEASE_RESPECT', "Sollten Sie damit nicht einverstanden sein, so melden Sie sich bitte bei uns. Wir kommen dann in Kontakt mit Ihnen.");
+define('ADMIN_LOCKED_SUBJ', "Ihr Account wurde gesperrt!");
+define('ADMIN_UNLOCKED_SUBJ', "Ihr Account wurde wieder freigegeben!");
+define('ADMIN_UNLOCKED_YOUR_ACCOUNT', "Einer unserer Administratoren hat soeben Ihren Account wieder freigeben! Sie koennen sich nun wieder unter folgender URL einloggen:\n\n".URL."/login.php");
+define('REASON_UNLOCKED', "Nachricht vom Admin");
+define('ADMIN_WELCOME_BACK', "Bitte beachten Sie beim naechsten Mal auf unsere AGBs, damit Ihnen diese Unangenehmlichkeiten erspart bleiben.");
+define('ADMIN_DEL_ACCOUNT', "Loeschung Ihres Accounts!");
+define('ADMIN_DELETED_YOUR_ACCOUNT', "Einer unserer Administratoren hat soeben Ihren Account geloescht!");
+define('REASON_DELETE', "Grund der Loeschung war folgender");
+define('ADMIN_BYE_BYE', "Wir wuenschen Ihnen weiterhin noch alles Gute und koennen Sie vielleicht irgentwann einmal wieder begruessen.");
+define('ADMIN_ALL_CONFIRMED_EMAIL', "Alle Ihre Mitglieder haben ihre Email-Adresse best&auml;tigt! Keine Neuanmeldungen vorhanden.");
+define('GUEST_CONFIRM_SUBJ', "Bitte Ihre Email-Adresse bestaetigen!");
+define('MEMBER_ORDER_ACCEPTED', "Ihre Mailbuchung wurde freigeschaltet");
+define('MEMBER_ORDER_REJECTED', "Ihre Mailbuchung wurde abgelehnt");
+define('THANX_REFERRAL_ONE', "Vielen Dank fuer die Referral-Werbung!");
+define('ADMIN_SEND_MAIL', "Bonusmail versenden");
+define('ADMIN_BONUS_SEND', "Bonusmail wurde in den Sende-Pool eingef&uuml;gt!");
+define('ENTER_POINTS', "Verg&uuml;tung");
+define('ENTER_SECONDS', "Wartezeit");
+define('ADMIN_MORE_SELECTED', "Sie haben mehr Empf&auml;nger eingegeben, als das empfangsbereit sind!");
+define('ADMIN_BONUS_CONTENT', "Versendete Bonus-Mails");
+define('EMAIL_POINTS', "Verg&uuml;tung");
+define('EMAIL_SECONDS', "Wartezeit");
+define('POOL_ACTIVE', "Wird gerade versendet");
+define('ALL_MEMBERS', "Alle Mitglieder");
+define('ADMIN_SELECT_USER', "Mitglied ausw&auml;hlen");
+define('ENTER_POINTS_ADD', "{!POINTS!} zum Aufbuchen");
+define('ENTER_ADD_REASON', "Grund der Aufbuchung");
+define('ADMIN_ADDED_POINTS_1', "Einer unserer Administratoren hat Ihnen soeben");
+define('ADMIN_ADDED_POINTS_2', " {!POINTS!} gutgeschrieben!");
+define('ADMIN_ADDED_REASON', "Grund dazu war folgender");
+define('ADMIN_ADD_SUBJ', "{!POINTS!}-Gutschrift durch unsere Admins!");
+define('ADMIN_POINTS_ADDED', "{!POINTS!} wurden gutgeschrieben. Das Mitglied hat eine Mail erhalten!");
+define('MAILS_PER_DAY', "Mails / Tag");
+define('GUEST_CONFIRMED_DONE', "Danke f&uuml;r die Best&auml;tigung Ihrer Email-Adresse! Es ist eine Mail mit den Login-Daten zu Ihnen unterwegs.");
+define('VALIDATING_LOGIN', "Logindaten werden gepr&uuml;ft . . .");
+define('ADMIN_SEND_NL', "Newsletter versenden");
+define('NEWSLETTER_FROM', "Newsletter vom");
+define('MEMBER_ACCOUNT_LOCKED_UNC', "Kann keine {!POINTS!} gutschreiben, da Ihr Account gesperrt wurde!");
+define('MAIL_POSSIBLE_INVALID', "Konnte keine {!POINTS!} gutschreiben: Daten moeglicherweise beschaedigt!");
+define('MEMBER_COOKIES_DISABLED', "Kann nicht einloggen, da Cookies bei Ihnen deaktiviert sind.");
+define('ADMIN_DEL_COMPLETED', "Account wurde gel&ouml;scht! Die {!POINTS!} werden immer in den Jackpot transferiert!");
+define('NORMAL_MAIL_RPOBLEM', "Mail vom Mitgliedern bereits gel&ouml;scht");
+define('BONUS_MAIL_PROBLEM', "Bonus-Mail bereits gel&ouml;scht");
+define('MEMBER_BACK_JACKPOT', "{!POINTS!}-Rueckgutschrift");
+define('ADMIN_BACK_JACKPOT', "{!POINTS!}-Aufbuchung fuer Jackpot");
+define('MEDIA_DATA', "Mediendaten");
+define('USERS_TOTAL', "Mitglieder gesamt");
+define('USERS_MAX_MAILS', "Erreichbare Mitglieder");
+define('USERS_REC_PER_DAY', "Heute noch erreichbar");
+define('USERS_LINKS', "Unbest&auml;tigte Mails");
+define('USERS_STATS', "Werbebuchungen");
+define('USERS_SENT_MAILS', "Gesendete Mails");
+define('USERS_MAX_PER_DAY', "Versendbare Mails pro Tag");
+define('USERS_MAX_REC', "Heute versendbare Mails");
+define('EDIT_CATEGORIES', "Kategorien &auml;ndern");
+define('CATEGORY_ID', "Kategorie-ID");
+define('CAT_DESCRIPTION', "Kategoriebeschreibung");
+define('CHANGE_CATS', "&Auml;ndern");
+define('SORT_KEY', "Sortierung");
+define('CATEGORIES_SAVED', "Kategorien gespeichert...");
+define('CATEGORIES_DELETED', "Kategorien gel&ouml;scht...");
+define('DELETE_CATEGORIES', "Kategorien l&ouml;schen");
+define('REMOVE_CATS', "L&ouml;schen");
+define('EDIT_MRECEIVE', "Maximal-Werte editieren");
+define('DELETE_MRECEIVE', "Maximal-Werte l&ouml;schen");
+define('MRECEIVE_ID', "Max-Wert ID");
+define('MREC_VALUE', "Mails pro Tag");
+define('MREC_COMMENT', "Kommentar");
+define('CHANGE_MREC', "&Auml;ndern");
+define('REMOVE_MREC', "L&ouml;schen");
+define('MRECEIVE_SAVED', "Maximal-Werte gespeichert...");
+define('MRECEIVE_DELETED', "Maximal-Werte gel&ouml;scht...");
+define('EDIT_REF_DEPTHS', "Referral-Ebenen editieren");
+define('DELETE_REF_DEPTHS', "Referral-Ebenen l&ouml;schen");
+define('REF_DEPTHS_ID', "Ref-Level ID");
+define('CHANGE_REF', "&Auml;ndern");
+define('REMOVE_REF', "L&ouml;schen");
+define('REF_DEPTHS_SAVED', "Referral-Ebenen gespeichert...");
+define('REF_DEPTHS_DELETED', "Referral-Ebenen gel&ouml;scht...");
+define('EDIT_PAYMENT', "Mailverg&uuml;tungen editieren");
+define('PAYMENT_ID', "Verg&uuml;tungs-ID");
+define('CHANGE_PAY', "&Auml;ndern");
+define('REMOVE_PAY', "L&ouml;schen");
+define('REFERRALS', "Referrals");
+define('POINTS_SUM', "Gesamtsumme");
+define('NEW_VERSION_AVAILABLE', "Neue Version verf&uuml;gbar!");
+define('YOUR_VERSION_IS', "Installierte Version");
+define('ONLINE_VERSION_IS', "Verf&uuml;gbare Version");
+define('UPDATE_CREATE_TIME', "Update wurde erstellt");
+define('DOWNLOAD_NEW_VERSION', "Jetzt neue Version herunterladen!");
+define('NO_UPDATES_AVAILABLE', "Keine neuen Updates/Patches verf&uuml;gbar!");
+define('NEW_PATCHES_AVAILABLE', "Neue Patches verf&uuml;gbar!");
+define('PATCH_FNAME', "Download-Link");
+define('PATCH_CTIME', "Patch erstellt");
+define('PATCH_FSIZE', "Downloadgr&ouml;sse");
+define('KBYTES', "KBytes");
+define('DEFAULT_SUBJECT_LINE', "Klick-Mail von ".TITLE);
+define('MEBER_UPDATE_PWD_WRONG', "Sie haben das falsche Passwort eingegeben! Bitte nochmal versuchen!");
+define('ADMIN_MEM_NO_CATS_1', "Das Mitglied <U>");
+define('ADMIN_MEM_NO_CATS_2', "</U> hat keine Kategorien ausgew&auml;hlt!");
+define('USER_ID', "Mitglied");
+define('UNCONFIRMED_LINKS', "Unbest&auml;tigte Mails");
+define('ADMIN_MEMBER_LINKS_1', "Das Mitglied <U>");
+define('ADMIN_MEMBER_LINKS_2', "</U> hat alle seine Mails best&auml;tigt.");
+define('MEMBER_TOTAL_LINKS_1', "Es m&uuml;ssen noch <STRONG>");
+define('MEMBER_TOTAL_LINKS_2', "</STRONG> Mails von diesem Mitglied best&auml;tigt werden!");
+define('ADMIN_DEL_UNCONFIRMED_LINKS', "Alle unbest&auml;tigten Mails l&ouml;schen");
+define('ADMIN_LINKS_DELETED', "Links f&uuml;r unbest&auml;tigte Mails wurden gel&ouml;scht!");
+define('ADMIN_DEL_LINK_SUBJ', "Ihr unbestaetigen Mails wurden geloescht!");
+define('MEMBER_LINKS_LEFT_1', "Sie haben <STRONG>");
+define('MEMBER_LINKS_LEFT_2', "</STRONG> unbest&auml;tigte Mails. Bitte best&auml;tigen Sie diese zuerst. Wenn Sie weniger als <STRONG>");
+define('MEMBER_LINKS_LEFT_3', "</STRONG> Mails im Account haben, k&ouml;nnen Sie auch wieder buchen.");
+define('TODAY', "Heute");
+define('MEMBER_PROFILE_LOCKED_1', "Sie k&ouml;nnen Ihren Account erst am <STRONG>");
+define('MEMBER_PROFILE_LOCKED_2', "</STRONG> wieder &auml;ndern!");
+define('MEMBER_HAS_ZERO_MMAILS', "Sie haben Ihren Empfang auf <STRONG>Urlaub</STRONG> stehen! Bitte stellen Sie unter &quot;Profildaten &auml;ndern&quot; den Empfang h&ouml;her ein!");
+define('REF_CLIX', "Clicks");
+define('REF_VIEWS', "Views");
+define('REFBANNER_TOTALS', "Gesamt");
+define('DAYS', "Tage");
+define('GUESTS_ONLINE', "G&auml;ste");
+define('MEMBERS_ONLINE', "Mitglieder");
+define('ADMINS_ONLINE', "Administratoren");
+define('USER_NOW_ONLINE', "User Online");
+define('ADMIN_ONLINE_DETAILS', "Detailierte Statistik f&uuml;r alle Besucher");
+define('_REFID', "Ref-ID");
+define('_MODULE', "Modul");
+define('MENU_ACTION', "Hauptmen&uuml;");
+define('MENU_WHAT', "Untermen&uuml;");
+define('_IS_ADMIN', "Administrator");
+define('_IS_GUEST', "Gast");
+define('LAST_SEEN', "Zuletzt gesehen");
+define('ADMIN_TOTAL_PATCH_SIZES', "Gesamtgr&ouml;sse aller Patches");
+define('ADMIN_DELETE_BONUS_MAIL', "Obrige Bonus-Mail l&ouml;schen");
+define('ADMIN_DELETE_NORMAL_MAIL', "Obrige Normal-Mail l&ouml;schen");
+define('ADMIN_REALLY_DELETE_ALL_MAILS', "Wollen Sie wirklich alle Mails l&ouml;schen?");
+define('SURNAME_FAMILY', "Vor- und Nachname");
+define('ADMIN_TOTAL_REFS_1', "Das Mitglied <STRONG>");
+define('ADMIN_TOTAL_REFS_2', "</STRONG> hat bereits <STRONG>");
+define('ADMIN_TOTAL_REFS_3', "</STRONG> weitere(s) Mitglied(er) geworben, davon sind <STRONG>");
+define('ADMIN_TOTAL_REFS_4', "</STRONG> gesperrt oder nicht best&auml;tigt!");
+define('REFS_COUNT', "Refs");
+define('MEMBER_JOINED', "Beigetreten");
+define('ADMIN_EMAIL_DELETED', "E-Mail wurde aus dem System gel&ouml;scht.");
+define('_ALL', "alle");
+define('PROFILE_LAST_CHANGE', "Letzte &Auml;nderung");
+define('PROFILE_OUTDATED', "Haben Sie Neuigkeiten fuer uns?");
+define('PROFILE_NEVER_CHANGED', "Sie haben noch nie eine Aenderung durchgefuehrt!");
+define('PROFILE_UPDATED', "Profildaten wurden ge&auml;ndert!");
+define('NEW_PATCHES_AVAILABLE_1', "Neue Entwickler-Patches f&uuml;r Version <STRONG>");
+define('NEW_PATCHES_AVAILABLE_2', "</STRONG> verf&uuml;gbar!");
+define('SORT_BY', "Sortieren");
+define('_OTHERS', "Andere");
+define('_ALL2', "Alle");
+define('WE_HAVE', "Wir haben");
+define('MEMBER_TEST_URL', "Zur beworbenen Seite");
+define('ADMIN_LOGS_DIR_404_1', "Das Verzeichnis mit den Zugriffslogb&uuml;chern konnte nicht gefunden werden! (<STRONG>");
+define('ADMIN_LOGS_DIR_404_2', "</STRONG>)");
+define('ADMIN_USAGE_DIR_404_1', "Das Verzeichnis mit den Webalizer-Statistiken konnte nicht gefunden werden! (<STRONG>");
+define('ADMIN_USAGE_DIR_404_2', "</STRONG>)");
+define('ADMIN_ENTER_REDIRECT_URL', "URL eingeben, wenn abgelehnt werden soll");
+define('ADMIN_ID_404_1', "ID <STRONG>");
+define('ADMIN_ID_404_2', "</STRONG> nicht gefunden!");
+define('ADMIN_ASSIGNED_ADMIN', "Zugewiesener Admin-Login");
+define('ADMIN_MEMBER_UID', "ID des Mitgliedes");
+define('ADMIN_TASK_TYPE', "Aufgabenbereich");
+define('ADMIN_TASK_CREATED', "Task erstellt");
+define('ADMIN_NO_ADMIN_ASSIGNED', "Kein Admin-Login zugewiesen!");
+define('ADMIN_TASK_IS_MEMBER_SUPPORT', "Support-Anfrage eines Mitgliedes");
+define('ADMIN_UNKNOWN_TASK_TYPE_1', "Unbekannter Task-Typ <STRONG>");
+define('ADMIN_UNKNOWN_TASK_TYPE_2', "</STRONG> im Task <STRONG>");
+define('ADMIN_UNKNOWN_TASK_TYPE_3', "</STRONG> erkannt!");
+define('ADMIN_TASK_SYSTEM_WELCOME', "Task-Management Ihres {!MT_WORD2!}");
+define('ADMIN_UNSELECT_ALL', "Alles abw&auml;hlen");
+define('ADMIN_ASSIGN_TASKS', "Bearbeiten");
+define('ADMIN_UNASSIGN_TASKS', "Zuweisung aufheben");
+define('ADMIN_REDIRECT_TASKS', "An uns weiterleiten");
+define('PATCHES_APPLIED', "Patches an der Datenbank durchgef&uuml;hrt!");
+define('PATCH_NOTES', "Bitte beachten Sie, dass wenn bei der Installation die SQL-Dateien nicht automatisch eingespielt werden konnten, dass sie auch hier nicht eingespielt worden sind! Sie m&uuml;ssen sie dann manuell einspielen.");
+define('LATEST_PATCH_INSTALLED', "Es wurde bereits die Datenbank aktualisiert!");
+define('PATCH_LISTED', "Anbei eine Liste der noetigen Dateien:");
+define('NO_PATCHES_APPLIED', "Keine Patches wurden ausgef&uuml;hrt!");
+define('LOAD_URL_ERROR_1', "Konnte nicht weiterleiten, da bereits Kopfinformationen gesendet wurden! <A href=\"");
+define('LOAD_URL_ERROR_2', "\">Bitte klicken Sie hier</A>, um zur URL zu kommen.<BR>
+<BR>
+Danke.");
+define('GUEST_STATS', "Statistiken unseres {!MT_WORD2!}");
+define('GUEST_STATS_MONTHLY', "Mitgliederverteilung auf Kalendermonate");
+define('GUEST_STATS_CATS', "Mitgliederverteilung auf Mail-Kategorien");
+define('GUEST_STATS_MALES', "Angemeldete M&auml;nner");
+define('GUEST_STATS_FEMALES', "Angemeldete Frauen");
+define('GUEST_STATS_TONLINE', "Heute Online gewesen");
+define('GUEST_STATS_YONLINE', "Gestern Online gewesen");
+define('GUEST_STATS_TREGISTER', "Heutige Anmeldungen");
+define('GUEST_STATS_YREGISTER', "Gestrige Anmeldungen");
+define('CHANGE_MENUS', "&Auml;ndern");
+define('CHANGE_MEMBER_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Mitgliedsmen&uuml;s");
+define('CHANGE_MENU_1', "&Auml;ndern von <STRONG>");
+define('CHANGE_MENU_2', "</STRONG> Men&uuml;eintr&auml;gen");
+define('IS_VISIBLE', "Wird angezeigt");
+define('IS_ACTIVE', "Aktiviert");
+define('CHANGE_ENTRIES', "&Auml;nderungen durchf&uuml;hren");
+define('BASE_URL_NOTE', "Ohne abschliessendem /!");
+define('ADMIN_WRONG_CALL', "Falscher Aufruf einer Aktion oder des Scriptes. Bitte navigieren Sie links weiter.");
+
+// Description of all months
+$MONTH_DESCR = array(
+       '01' => "Januar",
+       '02' => "Februar",
+       '03' => "M&auml;z",
+       '04' => "April",
+       '05' => "Mai",
+       '06' => "Juni",
+       '07' => "Juli",
+       '08' => "August",
+       '09' => "September",
+       '10' => "Oktober",
+       '11' => "November",
+       '12' => "Dezember",
+);
+//
+define('ADMIN_IS_SYSTEM_TASK', "System-Task");
+define('ADMIN_TASK_IS_EXTENSION', "Erweiterung-Management");
+define('ADMIN_NEW_EXT_SUBJ', "Neue Erweiterung gefunden");
+define('ADMIN_TASK_SUBJECT', "Aufgabenbetreff");
+define('ADMIN_TASK_TEXT', "Aufgabentext");
+define('ADMIN_REGISTER_EXTENSION', "Registrieren");
+define('ADMIN_SELECTED_TASKS_ASSIGN', "Zum Bearbeiten ausgew&auml;hlte Tasks");
+define('ADMIN_REG_FAILED_INVALID', "Registrierung fehlgeschlagen: Ung&uuml;tige ID &uuml;bermittelt!");
+define('ADMIN_REG_FAILED_ID_404', "Registrierung fehlgeschlagen: Erweiterung-ID nicht auffindbar!");
+define('ADMIN_REG_FAILED_404', "Registrierung fehlgeschlagen: Erweiterung nicht auffindbar!");
+define('ADMIN_REG_FAILED_ASSIGED', "Registrierung fehlgeschlagen: Sie sind nicht zugewiesen oder Task ist veraltet!");
+define('ADMIN_NO_EXTENSION_REGISTERED', "Derzeit haben Sie keine Erweiterung in Ihrem {!MT_WORD!} registriert.");
+define('ADMIN_EXTENSION_REGISTERED', "Erweiterung wurde in Ihrem {!MT_WORD!} registriert.");
+define('ADMIN_EXT_ALREADY_REGISTERED', "Erweiterung bereits registriert!");
+define('ADMIN_DELETE_ENTRIES', "L&ouml;schen");
+define('ADMIN_REGISTERED_EXTENSIONS', "Registrierte Erweiterungen");
+define('ADMIN_EXT_NAME', "Erweiterungsname");
+define('ADMIN_EXT_LANG', "Sprachdatei");
+define('ADMIN_EXT_ADMIN', "Admin-Bereich?");
+define('ADMIN_EXT_ACTIVE', "Aktiviert?");
+define('ADMIN_DE_ACTIVATE', "De-/Aktivieren");
+define('ADMIN_SEARCH_NEW_EXTENSIONS', "Nach neuen Erweiterungen suchen...");
+define('JACKPOT_POINTS', "{!POINTS!} im Jackpot");
+define('CLICK_RATE', "Klickrate");
+define('GUEST_STATS_MODULES', "Klicks in allen Modulen (TOP-10)");
+define('GUEST_STATS_MEMBERS', "Statistiken &uuml;ber unsere Mitglieder");
+define('EDIT_REFBANNER', "Werbebanner editieren");
+define('REQUEST_CONFIRM_LINK_TITLE', "Best&auml;tigungslink erneut anfordern");
+define('GUEST_CONFIRM_LINK_NOTE', "Sie haben Ihren Best&auml;tigungslink verlegt? Kein Problem, hier k&ouml;nnen Sie ihn erneut anfordern. Geben Sie dazu einfach Ihre angemeldete eMail-Adresse an. Der Link wird Ihnen dann per Mail zugesandt.");
+define('REQUEST_CONFIRM_LINK', "Erneut anfordern");
+define('LOGIN_ID_CONFIRMED', "Sie haben bereits Ihre E-Mail Adresse best&auml;tigt!");
+define('CONFIRM_LINK_SENT', "Der Best&auml;tigungslink wurde an Ihre E-Mail Adresse ausgesandt.");
+define('REQUEST_CONFIRM_LINK_SUBJ', "Anforderung Ihres Bestaetigunglinkes");
+define('EMAIL_ADDY_404', "Unter der angegebenen E-Mail Adresse konnten wir keinen Account finden! Bitte versuchen Sie es erneut.");
+define('SELECT_NONE', "Keine/s/r");
+define('ADMIN_SETUP_STATS_TITLE', "Einstellungen an den Gast-Statistiken");
+define('ADMIN_GSTATS_MEMBERS', "Mitglieder-Statistik zuerst");
+define('ADMIN_GSTATS_MODULES', "TOP10-Modul-Statistik zuerst");
+define('ADMIN_GSTATS_INACTIVE', "Gast-Statistik deaktivieren");
+define('ADMIN_GSTATS_MEMBERS_NOTE', "Die Mitglieder-Statistik zeigt an, wie viele Mitglieder Ihr {!MT_WORD!} hat und wie viele Mitglieder welche Kategorien ausgew&auml;hlt haben.");
+define('ADMIN_GSTATS_MODULES_NOTE', "Zeigt Klicks in den 10 am h&auml;ufigsten angeklickten Gast- und Mitgliedsmodulen an.");
+define('ADMIN_GSTATS_INACTIVE_NOTE', "Deaktiviert die Gast-Statistiken komplett.");
+define('DELETE_PAYMENT', "Verg&uuml;tungen l&ouml;schen");
+define('REF_PAYOUT', "Anzahl zu best&auml;tigender Mails, bevor die {!POINTS!} gutgeschrieben werden?");
+define('REF_PAYOUT_NOTE', "0 = Verg&uuml;tung erfolgt sofort.");
+define('ADMIN_EXT_NO_INFO_FOUND', "Keine Informationen zu dieser Erweiterung gefunden!");
+define('ADMIN_EXT_NEW_FOUND_TITLE', "Neue Erweiterungen gefunden");
+define('ADMIN_EXT_DOWNLOAD_LINK', "Download-Link");
+define('ADMIN_EXT_FILE_SIZE', "Downloadgr&ouml;&szlig;e");
+define('ADMIN_EXT_FILE_CTIME', "Erweiterung erstellt am");
+define('ADMIN_EXT_FILE_VERSION', "Version (alt)");
+define('ADMIN_EXT_TOTAL_FSIZE', "Downloadgesamtgr&ouml;sse");
+define('ADMIN_EXT_TOTAL_FOUND', "Gesamt gefundene Erweiterungen");
+define('ADMIN_EXT_ALREADY_INSTALLED_1', "Alle <STRONG><U>");
+define('ADMIN_EXT_ALREADY_INSTALLED_2', "</U></STRONG> gefundenen Erweiterungen sind bereits installiert!");
+define('ADMIN_EXT_NOTHING_FOUND', "Keine Erweiterungen auf dem Server gefunden!");
+define('ADMIN_EXT_VERSION', "Version");
+define('ADMIN_TASK_IS_EXTENSION_UPDATE', "Erweiterung-Update");
+define('ADMIN_EXTENSION_UPDATED', "Erweiterung aktualisiert!");
+define('ADMIN_UPDATE_EXT_SUBJ', "Erweiterung-Update installiert");
+define('MEMBER_ORDER_PAGE1_INTRO', "Mailbuchung - Schritt 1 von 4: PLZ eingeben");
+define('MEMBER_ORDER_PAGE2_INTRO', "Mailbuchung - Schritt 2 von 4: Daten eingeben");
+define('MEMBER_ORDER_PAGE3_INTRO', "Mailbuchung - Schritt 3 von 4: Frame-Killer Test und Absenden");
+define('MEMBER_ORDER_PAGE4_INTRO', "Mailbuchung - Schritt 4 von 4: Vielen Dank!");
+define('MEMBER_ORDER_PAGE1_NOTE', "Geben Sie hier die ersten ein bis drei Stellen der Postleitzahl ein, in der gesendet werden soll.<BR>
+<BR>
+Beispiele:
+<UL>
+  <LI><STRONG>1</STRONG> : Sendet nur an Mitglieder, deren Postleitzahl mit 1 anf&auml;ngt.</LI>
+  <LI><STRONG>12</STRONG> : Sendet nur an Mitglieder, deren Postleitzahl mit 12 anf&auml;ngt.</LI>
+  <LI><STRONG>123</STRONG> : Sendet nur an Mitglieder, deren Postleitzahl mit 123 anf&auml;ngt.</LI>
+</UL>
+<BR>
+Oder geben Sie nichts ein, wenn Sie diese Option nicht w&uuml;nschen.");
+define('MEMBER_ENTER_ZIP_CODE', "PLZ eingeben");
+define('ORDER_PAGE_2', "Weiter zur Seite 2");
+define('UNCONFIRMED_USERIDS', "Unbest./Gesperrte Accounts");
+define('LOCKED_POINTS', "Nicht verg&uuml;tete {!POINTS!}");
+define('LAST_UPDATE', "Letzte Profil&auml;nderung");
+define('LAST_PROFILE_SENT', "Erinnerung gesendet");
+define('USER_REF_PAYOUT', "Noch zu best. Mails");
+define('DISPLAY_REFID', "Ref-ID anzeigen");
+define('SORT_NAVIGATION', "Sortieren");
+define('HIGHER', "H&ouml;her");
+define('LOWER', "Niedriger");
+define('MEMBER_SETTINGS_SAVED', "Einstellungen gespeichert.");
+define('REMOTE_ADDR_TIMEOUT', "Ein Mitglied ist mit Ihrer IP-Nummer <U>".$_SERVER[REMOTE_ADDR]."</U> bereits registriert! Bitte kontaktieren Sie uns, wenn dies ein Fehler sein sollte!");
+define('IP_TIMEOUT', "IP-Zeitsperre");
+define('ADMIN_PAYOUT_NOT_INSTALLED', "payout-Erweiterung nicht installiert!");
+define('ADMIN_ADD_MAX_VALUE', "Neuen Maximal-Wert hinzuf&uuml;gen");
+define('ADMIN_CANNOT_CHECK_VERSION', "Konnte Versionsnummer nicht abgleichen! (Fehlende Internet-Verbindung? Server ist down?)");
+define('GUEST_STATS_DEACTIVATED', "Statistiken sind deaktiviert.");
+define('GUEST_TOPTEN_STATS', "Die am h&auml;ufigsten angeklickten Men&uuml;s");
+define('GUEST_TOP_GUEST_STATS', "Gastmen&uuml;");
+define('GUEST_TOP_MEMBER_STATS', "Mitgliedmen&uuml;");
+define('ADMIN_EDIT_BANNER_URL', "Banner-URL &auml;ndern");
+define('ADMIN_EDIT_ALTERNATE', "Alternativen Text &auml;ndern");
+define('ADMIN_EDIT_POINT_SETTINGS', "Einstellungen an {!POINTS!}verg&uuml;tungen");
+define('ADMIN_CONFIG_DIRECT_PAY', "Sollen die &quot;erklickten&quot; {!POINTS!} nach der Anmeldung direkt oder nach eingestellter Anzahl von Mails verg&uuml;tet werden?");
+define('CHANGE_PROFILE', "Profil &auml;ndern");
+define('ADMIN_PASS1', "Passwort eingeben");
+define('ADMIN_PASS2', "Passwortbest&auml;tigung");
+define('ADMIN_EDIT_USER_PROFILE', "Editieren eines Mitgliederaccountes");
+define('ADMIN_EDIT_USER_PASSWORD_NOTE', "Geben Sie nur zweimal das Passwort ein, wenn Sie es &auml;ndern wollen. Wollen Sie nur Daten &auml;ndern, geben Sie bitte keines ein.");
+define('POINTS_LOCKED', "Noch wartende {!POINTS!}");
+define('ADMIN_TASK_INFOS', "Infos");
+define('NICKNAME', "Nickname");
+define('EXT_NICKNAME_404', "<FONT class=\"note\">nickname-Erweiterung fehlt!</FONT>");
+define('ADMIN_PROBLEM_NO_MENU', "Konnte keine Men&uuml;eintr&auml;ge finden!");
+define('USER_REF_404', "Dieses Mitglied hat keine Referals gemacht.");
+define('USER_NICKNAME', "Nickname");
+define('ADMIN_EXT_AUTOPURGE_404', "autopurge nicht installiert!");
+define('ADMIN_EXT_BONUS_OUTDATED_1', "Ihre Bonus-Erweiterung ist veraltet! Version <U>");
+define('ADMIN_EXT_BONUS_OUTDATED_2', "</U> oder h&ouml;her wird ben&ouml;tigt!");
+define('ADMIN_EXT_BONUS_404', "bonus nicht installiert!");
+define('ADMIN_CONFIG_POINTS_DIRECT', "Direkt auszahlen");
+define('ADMIN_CONFIG_POINTS_MAILS', "Nach best. Mails");
+define('MEMBER_MORE_POINTS_NEEDED', "Sie haben nicht ausreichend {!POINTS!} &uuml;brig, um die Buchung durchzuf&uuml;hren! Bitte stellen Sie weniger Empf&auml;nger oder eine kleinere Mailart ein.");
+define('CANNOT_SEND_ADMIN_MAILS', "Fehler bei Mailversand an Admin!");
+define('MAILID_CLICK_BUTTON', "Einmal den Button anklicken");
+define('ADMIN_ADD_POINTS_TO_ALL', "Allen Mitgliedern {!POINTS!} gutschreiben");
+define('ADMIN_ALL_POINTS_ADDED', "Allen Mitgliedern wurden die {!POINTS!} gutgeschrieben!");
+define('EMAILS_PAGENAV', "Seite");
+define('_IS_CURRENT_HOME', "Liegt in Home");
+define('_IS_NEW_HOME', "In Home setzen");
+define('ADMIN_CONFIG_HOME', "Legen Sie hier die neue Home-Seite fest");
+define('HOME_ACTION', "Funktion");
+define('HOME_BOTTOM_NOTE', "Es werden nur aktive Men&uuml;punkte aus dem Gasthauptmen&uuml; (main) angezeigt.");
+define('ADMIN_EXT_CSSFILE', "CSS?");
+define('ADMIN_EDIT', "&Auml;ndern");
+define('ADMIN_EDIT_EXTENSIONS', "&Auml;ndern von Erweiterungen");
+define('ADMIN_EXT_CHANGED', "Erweiterungen ge&auml;ndert.");
+define('POOL_DELETED', "Bereinigt");
+define('ONLINE_TIMEOUT_IS_1', "Die Liste zeigt die Besucher der letzten <STRONG>");
+define('ONLINE_TIMEOUT_IS_2', "</STRONG> an.");
+define('ADMIN_CONFIG_EXTENSIONS_SETTINGS', "Erweiterungs-Management konfigurieren");
+define('ADMIN_VERBOSE_SQL', "SQL-Anweisungen beim Registrieren/Updates/Entfernen ausgeben");
+define('ADMIN_REMOVING_THESE_EXTENSIONS', "Diese Erweiterungen werden deinstalliert");
+define('ADMIN_REMOVE_EXTENSIONS', "Erweiterungen jetzt entfernen");
+define('ADMIN_SQLS_EXECUTED_ON_REMOVAL', "Beim Entfernen ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_NO_ADDIONAL_SQLS', "Keine weiteren SQL-Anweisungen zum Ausf&uuml;hren!");
+define('ADMIN_SQLS_EXECUTED_ON_UPDATE', "Beim Aktualisieren ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_SQLS_EXECUTED_ON_REGISTER', "Beim Registrieren ausgef&uuml;hrte SQL-Anweisungen");
+define('ADMIN_UNKNOWN_FIELD_TYPE_1', "Unbekannter Datentyp <STRONG>");
+define('ADMIN_UNKNOWN_FIELD_TYPE_2', "</STRONG> erkannt!");
+define('ADMIN_ADD_POINTS_TO_USER', "Einem Mitglied {!POINTS!} gutschreiben");
+define('MEMBER_ORDER_DELETED', "Ihre Mailbuchung wurde soeben geloescht");
+define('ADMIN_LIST_UNCONFIRMED_NOT_DIRECTLY', "Bitte diesen Men&uuml;punkt nicht direkt aufrufen!");
+define('ADMIN_UNCONFIRMED_POOL_MISSING_1', "Es fehlen Daten im Sende-Pool zur Mail-ID <U>");
+define('ADMIN_UNCONFIRMED_POOL_MISSING_2', "</U> !");
+define('ADMIN_UNCONFIRMED_STATS_MISSING_1', "Es fehlen Daten in der User-Statistik zur Mail-ID <U>");
+define('ADMIN_UNCONFIRMED_STATS_MISSING_2', "</U> !");
+define('ADMIN_UNCONFIRMED_INVALID_LINK', "Ung&uuml;tigen Link aufgerufen oder Mail ist nicht mehr vorhanden!");
+define('ADMIN_UNCONFIRMED_NO_LINK_LEFT', "Diese Mailbuchung wurde komplett best&auml;tigt!");
+define('ADMIN_CONFIG_REFMODE', "Verg&uuml;tungsmodus f&uuml;r einmalige Referral-Gutschrift");
+define('ADMIN_CONFIG_REFMODE_REF', "&Uuml;ber das Ref-System");
+define('ADMIN_CONFIG_REFMODE_DIRECT', "Nur User selber aufbuchen");
+define('ADMIN_HEADER_LOCK_ACCOUNT_1', "Mitgliedsaccount <U>");
+define('ADMIN_HEADER_LOCK_ACCOUNT_2', "</U> sperren");
+define('ADMIN_HEADER_UNLOCK_ACCOUNT_1', "Mitgliedsaccount <U>");
+define('ADMIN_HEADER_UNLOCK_ACCOUNT_2', "</U> freigeben");
+define('ADMIN_HEADER_DEL_ACCOUNT_1', "Mitgliedsaccount <U>");
+define('ADMIN_HEADER_DEL_ACCOUNT_2', "</U> l&ouml;schen");
+define('ADMIN_TEXT_DEL_ACCOUNT_1', "M&ouml;chten Sie den User <STRONG>");
+define('ADMIN_TEXT_DEL_ACCOUNT_2', "</STRONG> nun <STRONG>unwiederruflich</STRONG> l&ouml;schen? Bitte geben Sie einen Grund der L&ouml;schung mit an!");
+define('ADMIN_TEXT_LOCK_ACCOUNT_1', "M&ouml;chten Sie den User <STRONG>");
+define('ADMIN_TEXT_LOCK_ACCOUNT_2', "</STRONG> nun sperren? Bitte geben Sie einen Grund der Sperrung mit an!");
+define('ADMIN_TEXT_UNLOCK_ACCOUNT_1', "M&ouml;chten Sie den User <STRONG>");
+define('ADMIN_TEXT_UNLOCK_ACCOUNT_2', "</STRONG> nun freischalten? Sie k&ouml;nnen auch optional einen Text mit angeben.");
+define('ADMIN_EDIT_HOME_TARGET', "Home-Seite festlegen");
+define('ADMIN_EDIT_HOME_SETTINGS', "Einstellungen an Eingangsseite");
+define('ADMIN_CONFIG_HOME_TITLE', "Einstellungen an der Home-Seite");
+define('ADMIN_CONFIG_INDEX_DELAY', "Verz&ouml;gerung bevor weitergeleitet wird");
+define('ADMIN_INDEX_MANUAL_FORWARD', "Klicken leitet weiter");
+define('ADMIN_INDEX_NO_DELAY', "Sofort weiterleiten");
+define('ADMIN_CONTINUE_TO_CONFIG', "Weiter zu den Einstellungen");
+define('ADMIN_CONFIG_INDEX_COOKIE', "Wie lange soll der Besucher die Eingangsseite nicht mehr sehen?");
+define('BONUS_EXTENSION_UPGRADE_1', "Bitte aktualisieren Sie Ihre Bonus-Erweiterung auf Version <U>");
+define('BONUS_EXTENSION_UPGRADE_2', "</U> oder neuer!");
+define('_ON', "an");
+define('CLICK_STATISTICS', "Mail-Statistik");
+define('ADMIN_SELECT_DEF_REFID', "Standart Referral-ID bei Anmeldung &uuml;ber keinen Ref-Link");
+define('ADMIN_SELECT_REFID_TARGRT', "Ziel-Seite des Referral-Linkes");
+define('ADMIN_REF_TARGET_REGISTER', "Zur Anmeldeseite");
+define('ADMIN_REF_TARGET_INDEX', "Zur Eingangsseite");
+define('ADMIN_THEME_ALREADY_INSTALLED', "Theme bereits installiert.");
+define('ADMIN_INSTALL_THEME', "Theme importieren");
+define('ADMIN_NO_THEMES_FOUND', "Keine Themes gefunden!");
+define('THEME_UNIX', "Uni*-Name");
+define('THEME_NAME', "Theme-Titel");
+define('THEME_AUTHOR', "Author");
+define('THEME_URL', "Download-URL");
+define('THEME_VERSION', "Versionsnummer");
+define('THEME_INSTALL', "Import-Status");
+define('THEME_ACTIVE', "Aktiviert?");
+define('ADMIN_THEME_LIST_NOTE', "Diese Liste zeigt alle auf Ihrem Server abgelegten Themes sortiert nach dem Uni*-Namen an.");
+define('ADMIN_CHANGE_STATUS_THEME', "Themes de-/aktivieren");
+define('ADMIN_THEME_NO_OUTPUT', "Problem: Kein Text zum Ausgeben!");
+define('ADMIN_THEMES_UPDATED', "Themes wurden aktualisiert.");
+define('ADMIN_THEMES_DELETED', "Themes wurden gel&ouml;scht.");
+define('ADMIN_THEME_IMPORTED_1', "Theme <U>");
+define('ADMIN_THEME_IMPORTED_2', "</U> wurde importiert.");
+define('CURR_THEME_IS_1', "Aktuelles Design: <STRONG>");
+define('CURR_THEME_IS_2', "</STRONG>");
+define('ADMIN_NO_THEME_INSTALLED_WARNING', "Kein Design installiert!");
+define('CHANGE_THEME', "Design &auml;ndern");
+define('ADMIN_SET_AS_NEW_THEME', "Dieses Theme als Standart-Theme setzen");
+define('ADMIN_THEME_NEW_DEFAULT_THEME', "Durch Anklicken des Uni*-Names wird das jeweilige Theme als Standart-Theme gesetzt, welches Ihre Besucher sofort sehen werden.");
+define('ENTRY_DELETE', "Eintrag l&ouml;schen");
+define('ADMIN_NO_MENUS_FOUND', "Keine Men&uuml;s gefunden!");
+define('ADMIN_CONFIG_TITLE_SETTINGS', "Einstellungen am Seitentitel");
+define('ADMIN_CONFIG_TITLE_DECORATIONS', "Titeldekorationen");
+define('ADMIN_TITLE_ENABLE_DECORATIONS', "Dekorationen aktivieren");
+define('ADMIN_TITLE_ENABLE_MODULE_TITLE', "Modul-Titel in Seiten titel einblenden");
+define('ADMIN_TITLE_ENABLE_WHAT_TITLE', "Titel vom Men&uuml;punkt einblenden");
+define('ADMIN_TITLE_LEFT', "Linke Seite");
+define('ADMIN_TITLE_MIDDLE', "Mittleres Trennzeichen");
+define('ADMIN_TITLE_RIGHT', "Rechte Seite");
+define('ADMIN_MENU_PROBLEM_TITLE', "Problem im Admin-Men&uuml;system erkannt");
+define('CONFIRM_ACCOUNT', "Account best&auml;tigen");
+define('CONFIRMATION_LINK', "Hier best&auml;tigen");
+define('CLICK_NOW', "Klick!");
+define('MAILID_LINK', "Best.-Link");
+define('UNKNOWN_MAILID_CODE_1', "Unbekannter Fehler-Code <STRONG>");
+define('UNKNOWN_MAILID_CODE_2', "</STRONG> erkannt!");
+define('EXTENSION_PROBLEM_EXT_INACTIVE', "Erweiterung deaktiviert! Fehler: Kann nicht fortfahren!");
+define('CHANGE_GUEST_MENU', "Verdecken, anzeigen, deaktivieren, aktivieren des Gastmen&uuml;s");
+define('IS_LOCKED', "Ist gesperrt");
+define('ADMIN_REMOVE_STATS_ENTRY', "Hier klicken, um Mitgliederstatistik zu entfernen!");
+define('ADMIN_USER_STATS_REMOVED', "Mitgliederstatistiken entfernt.");
+define('MAIL_WILL_NEVER_EXPIRE', "Bestaetigungslink verfaellt nicht.");
+define('MEMBER_ENTER_MORE_RECEIVERS', "Geben Sie mindestens ein Empf&auml;nger ein!");
+define('MEMBER_NO_MORE_RECEIVERS_FOUND', "Es konnten nicht ausreichend genug empfangsbereite Mitglieder gefunden werden.");
+define('ADMIN_USER_PROFILE_TITLE', "Mitgliedsprofil aufrufen");
+define('LIST_UNCONFIRMED_MEMBER_LINKS', "Unbest&auml;tigte Maillinks eines Mitgliedes auflisten");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS_1', "Geben Sie mehr als <U>");
+define('MEMBER_ENTER_MORE_MIN_RECEIVERS_2', "</U> Empf&auml;nger ein!");
+define('NO_TEMPLATE_SUPPLIED', "Keinen Template-Namen uebergeben! Fehler im Script erkannt. Bitte den Webmaster (".WEBMASTER.") verstaendigen!");
+define('_OR', "oder");
+define('GUEST_NEW_PASSWORD_SEND', "Neues Passwort ist zu Ihrem Postfach unterwegs!");
+define('UNDER_CONSTRUCTION', "Funktion noch im Aufbau!");
+define('ADMIN_SUB_SUBJ', "{!POINTS!}-Abzug durch unsere Admins");
+define('ADMIN_POINTS_SUBTRACTED', "{!POINTS!} wurden erfolgreich abgezogen!");
+define('ADMIN_ALL_POINTS_SUBTRACTED', "Allen Mitgliedern wurden {!POINTS!} abgezogen!");
+define('ADMIN_SUB_POINTS_FROM_USER', "Abzug von {!POINTS!} eines Mitgliedes");
+define('ENTER_POINTS_SUB', "Abzuziehende {!POINTS!}");
+define('ENTER_SUB_REASON', "Grund des Abzuges");
+define('ADMIN_SUB_POINTS', "{!POINTS!} abziehen");
+define('ADMIN_SUB_POINTS_FROM_ALL', "Allen Mitgliedern {!POINTS!} abziehen");
+define('PATCH_DESCRIPTION', "Beschreibung zum Patch");
+define('DOWNLOAD_ZIP', "Direktes ZIP-Archiv downloaden");
+define('DOWNLOAD_BZIP2', "Direkten Tar-Ball downloaden");
+define('DOWNLOAD_FROM_SERVER', "&Uuml;ber unseren Server downloaden");
+define('DOWNLOAD_NOW', "Jetzt downloaden!");
+define('ADMIN_MEMBER_STATS_TITLE', "Einstellungen an der Mitglieder-Statistik");
+define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite");
+define('MEMBER_NO_THEMES_FOUND', "Keine Design gefunden!");
+define('MEMBER_THEME_LIST_NOTE', "Wenn Sie Fragen zu einem der Designs haben, wenden Sie sich bitte an den jeweiligen Autor!");
+define('MEMBER_SAVE_THEME', "Design speichern");
+define('MEMBER_THEME_LIST_USAGE', "W&auml;hlen Sie unten ein neues Design aus und klicken Sie auf <STRONG>Theme abspeichern</STRONG>, das Design wird dann nur f&uuml;r Sie dauerhaft ge&auml;ndert.");
+define('MEMBER_THEME_SAVED', "Design gespeichert.");
+define('TASK_NO_TITLE', "Aufgabe ohne SQL-Anweisungen");
+define('UNCONFIRMED_LOCKED', "Noch zu best. Mails");
+define('CONFIRMED_MAILS', "Bereits best. Mails");
+define('_YEARS'  , "Jahre");
+define('_MONTHS' , "Monate");
+define('_WEEKS'  , "Wochen");
+define('_DAYS'   , "Tage");
+define('_HOURS'  , "Stunden");
+define('_MINUTES', "Minuten");
+define('_SECONDS', "Sekunden");
+define('SORT_ASCENDING', "Aufsteigend");
+define('SORT_DESCENDING', "Absteigend");
+define('INVALID_EMAIL_ADDRESS_ENTERED', "Ung&uuml;tige EMail-Adresse eingegeben!");
+define('NEVER_HAPPENED', "Nie");
+define('WRONG_DB_SELECTED', "Falsche oder fehlende Datenbank ausgew&auml;hlt!");
+define('NO_CONFIG_FOUND', "Keine Konfigurationsdaten gefunden! (Leere Datenbank? Oder haben Sie die SQL-Dateien in andere Datenbank eingespielt?)");
+define('NO_CONFIG_FOUND_TITLE', "Keine Konfigurationsdaten gefunden!");
+define('SORTING_KEY', "Sortierung");
+define('ADMIN_ADD_BANNER', "Neuen Banner hinzuf&uuml;gen");
+define('ADMIN_ENTER_BANNER_URL', "Banner-URL");
+define('ADMIN_ENTER_ALTERNATE_TEXT', "Alternativen Text");
+define('ADMIN_SELECT_BANNER_ACTIVE', "Ist der Banner aktiv?");
+define('ADMIN_SUBMIT_BANNER', "Banner hinzuf&uuml;gen");
+define('ADMIN_LIST_REFERRALS_1', "Referrals des Mitgliedes ");
+define('ADMIN_LIST_REFERRALS_2', " in erster Ebene");
+define('ADMIN_LIST_REFERRALS_NOTE', "<STRONG>&Auml;nderung:</STRONG> Klicken Sie die User-ID an und gelangen Sie zum Mitgliederprofil. Klicken Sie Anzahl Referrals an, werden die Referrals des jeweiligen Mitgliedes aufgelistet.");
+define('ADMIN_NORMAL_MAIL_ALREADY_DELETED', "Mitglieder-Mail bereits gel&ouml;scht!");
+define('INITIAL_RELEASE', "Erste Alpha-Version");
+define('NO_UPDATE_NOTES', "Keine Update-Hinweise gefunden!");
+define('MYSQL_QUERY_STRING', "MySQL-Abfragebefehl war:");
diff --git a/inc/language/en.php b/inc/language/en.php
new file mode 100644 (file)
index 0000000..7cad73b
--- /dev/null
@@ -0,0 +1,319 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/26/2003 *
+ * ===============                              Last change: 04/16/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : en.php                                           *
+ * -------------------------------------------------------------------- *
+ * Short description : English language support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Englische Sprachunterstuetzung                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language identifier
+define('__LANG_ID', "English (US)");
+
+// Language definitions
+define('LANG_DOWN_MAINTAINCE', "System is down for maintenance.");
+define('LANG_MOD_REG_404_1', "Module <U>");
+define('LANG_MOD_REG_404_2', "</U> does not exists.");
+define('LANG_MOD_NOT_REG', " is not registered.");
+define('LANG_UNKNOWN_MODULE', "Unknown module");
+define('META_YOUR_NAME_1', "Your name here");
+define('META_YOUR_NAME_2', "Your name again");
+define('META_DESCRIPTION', "The description of your website here");
+define('META_KEYWORDS', "Enter at least (1) 20 search keywords seperated by commatas here");
+define('LANG_WARNING', "Warning");
+define('DIE_CONFIG_CHANGED_YOU', "You have edited your config.php file! I'm out here...");
+define('DIE_RUN_INSTALL_MYSQL', "Please run http://your-domain.com/install.php to setup your MySQL data.");
+define('WARN_NULL_PASSWORD', "You have a null-password! If you want to switch off this warning please have a look in <STRONG>inc/config.php</STRONG>.");
+define('FATAL_CONFIG_WRITABLE', "Your file inc/config.php is writeable! This is a possible security risk.");
+define('FATAL_CANNOT_WRITE_CONFIG', "Cannot write config data because I have no write permissions to inc/config.php.");
+define('FATAL_ERROR', "Fatal error");
+define('LANG_NO_RENDER_DIRECT', "You did not setup the output mode weather to 'render' nor to 'direct'.");
+define('INSTALLATION', "Script installation");
+define('INSTALL_PROBLEMS_DETECTED', "I have detected problems while initializing the installation procedure.");
+define('FATAL_NO', "Fatal error no. #");
+define('FATAL_CORRECT_ERRORS', "I cannot continue! Please correct the listet problems first and retry again!");
+define('WRONG_PAGE', "You or this system has selected a wrong page!");
+define('SERVER_PATH', "Absolute server path");
+define('BASE_URL', "Base URL");
+define('HP_TITLE', "Mail-exchange's title");
+define('HP_SLOGAN', "Slogan");
+define('MYSQL_HOST', "Server hostname");
+define('MYSQL_DBASE', "Database");
+define('MYSQL_PREFIX', "Prefix for all tables");
+define('MYSQL_LOGIN', "Your login name");
+define('MYSQL_PASS1', "Your password");
+define('MYSQL_PASS2', "Password confirmation");
+define('CSS_URL', "URL to CSS file (relative)");
+define('FATAL_NO_MHOST', "You have entered no host name!");
+define('FATAL_NO_MDBASE', "Please provide a database name.");
+define('FATAL_NO_MLOGIN', "Please enter your login to the database.");
+define('FATAL_NO_MPASS1', "You have entered no password. This is very unsecure and will be handled as an error.");
+define('FATAL_NO_MPASS2', "Please enter the password confirmation.");
+define('FATAL_MPASS1_MPASS2', "Your both passwords didn't match.");
+define('LANG_OUTPUT_MODE', "Output mode of HTML code");
+define('MODE_RENDER', "HTML code will be rendered and then delivered.");
+define('MODE_DIRECT', "HTML code will be delivered immediately.");
+define('WARN_NO_PASSWORD', "Shall I warn you if you did not provide a password?");
+define('YES', "Yes");
+define('NO', "No");
+define('RETURN_MYSQL_PAGE', "Back to MySQL settings");
+define('INSTALL_FINALIZER_FAILED', "While installtion unexpected errors occur! The finalizer cannt finish installation.");
+define('INSTALL_MAYBE_DONE', "The installation is possibely completed or unexpected errros occur.");
+define('INSTALL_FINISHED', "Installation is completed! :-)");
+define('INSTALL_FIN_SECU', "<STRONG><U>Security notes:</U></STRONG><br />Install a .htaccess file in directory inc and templates including all secondary directories.");
+define('CONTINUE_ADMIN', "Continue to administrator's area...");
+define('RUNTIME_PROBLEMS_DETECTED', "Runtime-problem detected!");
+define('FATAL_INC_WRITABLE', "Directory inc is writeable! Please set the access rights to CHMOD 755.");
+define('LANG_WRITE_FOOTER', "Display name, version and author of this script?");
+define('LANG_FRAMESET_ACTIVE', "Enable frameset? If not a table-set will be used instead.");
+define('MYSQL_ERRORS', "MySQL errors detected. Please correct first to continue.");
+define('LANG_MOD_UNKNOWN_1', "Unknown return-code <U>");
+define('LANG_MOD_UNKNOWN_2', "</U> detected!");
+define('LANG_MOD_LOCKED_1', "Selected module <U>");
+define('LANG_MOD_LOCKED_2', "</U> is locked!");
+define('ADMIN_UNKNOWN_ACTION_1', "Unknown administrator-action <U>");
+define('ADMIN_UNKNOWN_ACTION_2', "</U> detected. Please call this module correctly!");
+define('ADMIN_ACTION_404_1', "Administrator module for action <U>");
+define('ADMIN_ACTION_404_2', "</U> was not found on server.");
+define('ADMIN_NOT_REGISTERED', "There is no administrator account created so far.");
+define('ADMIN_REGISTER_NOW', "Please create an administrator account now:");
+define('ADMIN_LOGIN', "Enter administrator login");
+define('ADMIN_PASS', "Enter password");
+define('LANG_CLEAR_FORM', "Clear form");
+define('ADMIN_REG_SUBMIT', "Create admin-account");
+define('ADMIN_NO_LOGIN', "You have entered no login.");
+define('ADMIN_NO_PASS', "You have entered no password.");
+define('ADMIN_SHORT_PASS', "Your entered password is too short. Please enter at least 4 chars!");
+define('ADMIN_LOGIN_ALREADY_REG', "Your entered admin-login does already exists.");
+define('ADMIN_REGISTER_FAILED', "While creating an admin-account an unexpected error occurs!");
+define('ADMIN_REGISTER_DONE', "Admin account created. You can use the account to login into the admin-area.");
+define('ADMIN_CANNOT_COMPLETE', "Cannot finish registration of admin-account!");
+define('ADMIN_LOGIN_NOW', "You can now login into the admin-area.<br />Enter your admin-login (not user-login!) and the password to do so.");
+define('ENTER_ADMIN_LOGIN', "Administrator login");
+define('ENTER_ADMIN_PASS', "Password");
+define('ADMIN_LOGIN_SUBMIT', "Login to admin-area");
+define('WRONG_PASS', "Wrong password.");
+define('ADMIN_NOT_FOUND', "Administrator account not found.");
+define('ADMIN_LOGIN_FAILED', "Login into admin-area failed!");
+define('CANNOT_REGISTER_SESS', "Cannot register session cookies. Maybe you have deactivated cookies?");
+define('SELECT_TIMEOUT', "Expiration time for automated login");
+define('TIMEOUT_ONE_DAY', "1 Day");
+define('TIMEOUT_TWO_DAYS', "2 Days");
+define('TIMEOUT_THREE_DAYS', "3 Days");
+define('TIMEOUT_ONE_WEEK', "1 Week");
+define('TIMEOUT_TWO_WEEKS', "2 Weeks");
+define('TIMEOUT_ONE_MONTH', "1 Month");
+define('TIMEOUT_HALF_YEAR', "1/2  Year");
+define('TIMEOUT_FULL_YEAR', "1 Year");
+define('ADMIN_LOGOUT_DONE', "Logout from admin-account completed.");
+define('ADMIN_LOGOUT_FAILED', "Logout from admin-account failed! :-(");
+define('ADMIN_RELOGIN_LINK', "Click here to re-login again.");
+define('ADMIN_404_ACTION', "Admin-module not found!");
+define('ADMIN_404_ACTION_1', "Called admin-module <U>");
+define('ADMIN_404_ACTION_2', "</U> is well valid but it is not on this server.");
+define('ALREADY_INSTALLED', "This script is already installed on this server. Please delete the whole installation system for your server. Don't worry you can do it...");
+define('ADMIN_MAIN_TITLE', "Welcome to the administration area");
+define('YOU_ARE_HERE', "You are here:");
+define('ID_SELECT', "ID:");
+define('DISPLAY_ACTION', "Action");
+define('DISPLAY_WHAT', "Sub action");
+define('DISPLAY_TITLE', "Title");
+define('UNDO_SELECTIONS', "Undo selections");
+define('EDIT_MENUS', "Edit menus");
+define('DEL_MENUS', "Delete menus");
+define('EDIT_ADMIN_MENU', "Edit admin menu entries");
+define('EDIT_MENU_1', "<STRONG>");
+define('EDIT_MENU_2', "</STRONG> menu entr(y/ies) shall be edited:");
+define('ENTRY_MODIFY', "Entry");
+define('SUBMIT_CHANGES', "Submit changes");
+define('ENTRY_404_1', "Entry <I>");
+define('ENTRY_404_2', "</I> was not found!");
+define('EDIT_UNKNOWN_OKAY', "An unknown action was performed.");
+define('SAVING_DATA', "Saving data");
+define('SAVING_DONE', "finished!");
+define('DEL_ADMIN_MENU', "Admin-Men&uuml;eintr&auml;ge l&ouml;schen");
+define('DEL_MENU_1', "<STRONG>");
+define('DEL_MENU_2', "</STRONG> menu entr(y/ies) shall be deleted:");
+define('DEL_ENTRIES', "Remove entries permanently");
+define('EDIT_ACTION', "Change action value");
+define('EDIT_WHAT', "Change sub action");
+define('EDIT_TITLE', "Change link title");
+define('ADMIN_ADD_MENU', "");
+define('ENTER_TITLE', "Enter link title for new menu entry");
+define('SELECT_PARENT_MENU', "Select the parent main menu");
+define('IS_TOP_MENU', "Is main menu");
+define('SELECT_WHAT_NAME', "Select your wished suffix");
+define('ENTER_DESCR', "Enter short but good-to-understand description");
+define('SELECT_BELOW_MENU', "Select menu entry where the new one shall be displayed below");
+define('EDIT_DESCR', "Edit description");
+define('CREATE_WHAT_FIRST', "Please create a what-xxxxx.php file first. After this you can select it here.");
+define('MENU_IS_VISIBLE', "Menu point is visible");
+define('MENU_IS_ACTIVE', "Menu point is active");
+define('CREATE_ACTION_FIRST', "Please create an action-xxxxx.php file first. After this you can select it here.");
+define('IS_FIRST_MENU', "Is the first main menu");
+define('NO_DB_LINK', "No connection to our database found!");
+define('MYSQL_DATA_MISSING', "Something is wrong with the MySQL settings!");
+define('REGISTER_PERSONAL_DATA', "Personal data");
+define('REGISTER_CATEGORIES', "Your interests");
+define('REGISTER_MISC', "Password, maximum mails per day, etc.");
+define('SURNAME', "Surname");
+define('FAMILY_NAME', "Family name");
+define('STREET_NR', "Street and house number");
+define('COUNTRY', "Country");
+define('ZIP', "ZIP code");
+define('CITY', "City");
+define('ADDY', "Email address");
+define('BIRTHDAY', "Birthday (MM.DD.YYYY)");
+define('PASS_1', "Password");
+define('PASS_2', "Password again");
+define('ADD_NEW_CATEGORY', "Add new category");
+define('ENTER_CATNAME', "Description of category");
+define('SELECT_PARENT', "Below which category shall this new be displayed?");
+define('IS_TOP_CATEGORY', "Is top-level category");
+define('CAT_IS_VISIBLE', "Category is visible?");
+define('ADD_NEW_CAT', "Add new category");
+define('CATEGORY_ADDED', "Category added.");
+define('CATEGORY_ALREADY_EXISTS', "Category does already exist!");
+define('EDIT_DEL_CATEGORIES', "Edit / delete listed categories");
+define('CATNAME', "Description of category:");
+define('EDIT_CATS', "Edit categories");
+define('DEL_CATS', "Delete categories");
+define('NO_CATEGORIES_VISIBLE', "Currently no categories can be displayed!");
+define('MAX_RECEIVE', "How many totally mails shall your memebers receive daily? Please add more values so every member can set it more individually.");
+define('ADD_MAX_RECEIVE', "Add max-value");
+define('SAVE_SETTINGS', "Save settings");
+define('ENTER_MAX_VALUE', "New max-value (0 to 9999)");
+define('ENTER_MAX_COMMENT', "Addition hint which will be displayed in brackets.");
+define('MAX_VALUE_SAVED', "Max-value saved");
+define('MAX_VALUE_ALREADY', "Max-values does already exist!");
+define('EDIT_DEL_MAX_VALUES', "Edit/Delete max-values");
+define('MAX_VALUE', "Maxium receiveable mails");
+define('MAX_COMMENT', "Comment to max-value");
+define('EDIT_MAX_V', "Edit max-value");
+define('DEL_MAX_V', "Delete max-value");
+define('NO_MAX_VALUES', "The registration cannot be completed because you cannot select maximum receiveable mails!");
+define('MAX_PER_DAY', "Maximum mails per day");
+define('PER_DAY', "Mails");
+define('REFID_BY', "You are advertised by");
+define('TERMS_OF_USAGE', "Accept T&amp;C and submit form");
+define('YOU_FINALIZE', "You have nearly filled out this form!");
+define('AGREE_TO_THIS', "Do you accep our [<A href=\"".URL."/agb.php\" class=\"register_term\" target=\"_blank\">Terms And Conditions</A>] ?");
+define('SUBMIT_REGISTER', "Submit registration form");
+define('HAVE_TO_AGREE', "You have to accept our Terms And Conditions you cannot join this mail exchange!");
+define('ENTER_BOTH_PASSWORDS', "Please enter a password by your choice twice.");
+define('ENTER_PASS1', "Please enter a password.");
+define('ENTER_PASS2', "Please enter confirmation of your password.");
+define('ENTER_EMAIL', "Please enter your valid email address.");
+define('ENTER_SURNAME', "Please enter your surname.");
+define('ENTER_FAMILY', "Please enter your family's name.");
+define('EDIT_SECURITY_SETTINGS', "Change security-related settings");
+define('MIN_PASS_LENGTH', "Minimum password length");
+define('SETTINGS_NOT_SAVED', "Settings are NOT saved/changed!");
+define('SETTINGS_SAVED', "Settings saved.");
+define('FATAL_CANNOT_LOAD_CONFIG', "Cannot load base configuration! A possible reason for this message is that the webmaster is setting up this mail exchange. Please come back later again.");
+define('ADMIN_INVALID_ACTION', "Invalid combination of action/what detected! Please click on Home to continue.");
+define('ADMIN_INVALID_ACTION_1', "Your combination action/what <U>");
+define('ADMIN_INVALID_ACTION_2', "</U> is invalid!");
+define('SHORT_PASS', "Your entered password is to short to match with our security conditions. Mimum length is");
+define('EDIT_POINTS_SETTINGS', "Edit welcome credit and other {!POINTS!}");
+define('POINTS_REGISTER', "Wecome credit");
+define('POINTS_REF', "Single referral credit");
+define('EDIT_REGFORM_SETTINGS', "Settings for registration form");
+define('LEAST_CATS', "Minium to select categories");
+define('CATS_LEAST', "Please select more categories! Minimum is");
+define('EMAIL_ALREADY_DB', "You are already registered with your entered email address or someone else is using your email address. Registering twice is not allowed in our service.");
+define('REJECT_DOUBLE_EMAIL', "Prevent of registering with same email address?");
+define('REJECT_DOUBLE_PASS', "Prevent of registering with same password? (Will not be displayed!)");
+define('ADMIN_EDIT_POINTS', "Edit welcome bonus and other fixed amounts");
+define('ADMIN_EDIT_REFDEPTHS', "Edit / delete / add referral levels");
+define('ADD_NEW_REFDEPTH', "Add new referral level");
+define('ADD_DEPTH', "Add referral level");
+define('ENTER_REF_LVL', "Referral level");
+define('ENTER_REF_PERCENTS', "Percentage payment");
+define('EDIT_DEL_REFDEPTH', "Edit / delete referral levels");
+define('REF_LEVEL', "Referral level");
+define('REF_PERCENT', "Percentage payment");
+define('EDIT_LVL', "Edit referral level");
+define('DEL_LVL', "Delete referral level");
+define('HELLO', "Hello");
+define('GUEST_YOU_REGISTERED_WITH_US', "Thank you for registering with our email exchange! If you didn't do this please contact us!");
+define('GUEST_YOUR_PERSONA_DATA', "Please verify your personal data");
+define('GUEST_SURNAME', "Surname");
+define('GUEST_FAMILY', "Family name");
+define('GUEST_STREET_NR', "Street and house no.");
+define('GUEST_COUNTRY', "Country code");
+define('GUEST_ZIPCODE', "ZIP code");
+define('GUEST_CITY', "City");
+define('GUEST_ADDY', "EMail address");
+define('GUEST_BIRTHDAY', "Birthday");
+define('GUEST_REF', "Advertised by");
+define('GUEST_YOUR_REFLINK', "Here is your personal referral link which you can use to advertise new members:");
+define('GUEST_CONFIRM_LINK', "Your confirmation link (click once!)");
+define('THANX', "Thank you very much.\n\nBest regards,");
+define('YOUR', "your");
+define('TEAM', "team");
+define('HELLO_ADMIN', "Hello administrator");
+define('ADMIN_GUEST_REGISTERED_WITH_US', "A guest has registered with our service.");
+define('ADMIN_GUEST_PERSONA_DATA', "Here you can verify his personal data");
+define('ADMIN_THANX', "Best regards,");
+define('SCRIPT', "Script");
+define('ADMIN_NEW_ACCOUNT', "New registration for your email exchange");
+define('REGISTRATION_DONE', "Registration is done. An email is on its way to you.");
+define('GUEST_404_ACTION_1', "The action module <U>");
+define('GUEST_404_ACTION_2', "</U> does not exist or this script makes a boo-boo!");
+define('GUEST_LOCKED_ACTION', "Action module is locked.");
+define('FATAL_REPORT_ERRORS', "A fatal error ocurs while runtime. If a module is locked we are working on it othervice please contact us!");
+define('TEMPLATE_404', "Template not found.");
+define('EDIT_GUEST_MENU', "Edit guest menu");
+define('EDIT_MEMBER_MENU', "Edit member menu");
+define('DEL_GUEST_MENU', "Delete guest menu");
+define('DEL_MEMBER_MENU', "Delete member menu");
+define('GUEST_PASSWORD', "Your password");
+define('GUEST_THANX_CONFIRMATION', "You have just now confirmed your email address. You are now unlocked for our service {--MAIN_TITLE--}.");
+define('GUEST_MAY_LOGIN_HERE', "You can now login here:");
+define('HAPPY_MAILING', "We wish you lots of fun and success with our mailer system!\n\nBest regards,");
+define('GUEST_THANX_CONFIRM', "EMail address confirmed");
+define('GUEST_CONFIRMED_TWICE', "You have already confirmed your email address or your account is locked.");
+define('TOP', "To top");
+define('YOUR_LOGIN', "Your login ID is");
+define('LOGIN_URL', "URL for login");
+define('GUEST_WELCOME_MEMBER', "Welcome to the login-area for members");
+define('GUEST_ENTER_LOGIN', "Login ID");
+define('GUEST_ENTER_PASSWORD', "Password");
+define('LOGIN_SUBMIT', "Login");
+define('GUEST_GET_NEW_PASS', "Submit new password");
+define('GUEST_ENTER_EMAIL', "Registered email address");
+define('NEW_PASSWD', "Send new password!");
+
+//
+?>
diff --git a/inc/language/holiday_de.php b/inc/language/holiday_de.php
new file mode 100644 (file)
index 0000000..2233d5d
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/26/2004 *
+ * ===============                              Last change: 08/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : holiday_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('HOLIDAY_MEMBER_TITLE', "Von wann bis wann sind Sie im Urlaub?");
+define('HOLIDAY_MEMBER_TSTART', "Anfang Ihres Urlaubes");
+define('HOLIDAY_MEMBER_TEND', "Ende Ihres Urlaubes");
+define('HOLIDAY_MAX_DAYS_1', "Sie k&ouml;nnen nicht mehr als ");
+define('HOLIDAY_MAX_DAYS_2', " Tag(e) an Urlaub einstellen!");
+define('HOLIDAY_ADD', "Urlaubsschaltung aktivieren");
+define('HOLIDAY_COMMENTS', "Sonstige Hinweise an uns");
+define('HOLIDAY_NOTES', "Sobald Sie das Formular abgeschickt haben, wird die Urlaubsschaltung f&uuml;r Ihren Account aktiviert. Sie k&ouml;nnen sich weiterhin im Mitgliedsbereich aufhalten, k&ouml;nnen aber keine Mails mehr empfangen und auch selber keine mehr buchen!");
+define('ADMIN_TASK_IS_HOLIDAY_REQUEST', "Urlaubsanfrage");
+define('HOLIDAY_ADMIN_NOTHING_FOUND', "Niemand hat Urlaub beantragt.");
+define('HOLIDAY_ADMIN_TSTART', "Anfang");
+define('HOLIDAY_ADMIN_TEND', "Ende");
+define('HOLIDAY_ADMIN_COMMENTS', "Kommentar");
+define('HOLIDAY_ADMIN_STOP_CHECKED', "Ausgew. Urlaub beenden");
+define('HOLIDAY_ADMIN_DELETE_NOTE', "Bitte beachten Sie, dass beim vorzeitigen Beenden des Urlaubes der Account-Status nicht ge&auml;ndert wird. Ist also das Account noch gesperrt, m&uuml;ssen Sie es seperat freischalten.");
+define('HOLIDAY_NO_DIRECT_CALL', "Bite rufen Sie dieses Script &uuml;ber Auflisten auf.");
+define('HOLIDAY_ADMIN_DEL_LINK', "Urlaub beenden");
+define('HOLIDAY_ADMIN_SINGLE_DELETED', "Urlaub eines Mitgliedes beendet!");
+define('HOLIDAY_ADMIN_MULTI_DEL_1', "Urlaub von <U>");
+define('HOLIDAY_ADMIN_MULTI_DEL_2', "</U> Mitglied(-ern) beendet!");
+define('HOLIDAY_ADMIN_CONFIG_HEADER', "Einstellungen an der Urlaubsschaltung");
+define('HOLIDAY_ADMIN_MAX_HOLIDAY', "Maximale beantragbare Urlaubszeit");
+define('HOLIDAY_IS_ACTIVATED_NOW', "Ihre Urlaubsschaltung wurde jetzt aktiviert. Sie k&ouml;nnen keine Mails mehr buchen!");
+define('HOLIDAY_MEMBER_DEACTIVATE_TITLE', "Bestehende Urlaubsschaltung deaktivieren");
+define('HOLIDAY_DEACTIVATE_NOTES', "M&ouml;chten Sie diese Urlaubsschaltung wieder deaktivieren? Es ist eine weitere Mail dann an uns unterwegs.");
+define('HOLIDAY_STOP', "Urlaubsschaltung aufheben");
+define('HOLIDAY_MEMBER_DEACTIVATED_NOW', "Ihre Urlaubsschaltung ist jetzt aufgehoben!");
+define('HOLIDAY_MEMBER_CANNOT_DEACTIVATE', "Konnte Ihre Urlaubsschaltung nicht aufheben! Bitte melden Sie sich bei uns!");
+define('HOLIDAY_ORDER_NOT_POSSIBLE', "Sie k&ouml;nnen keine Mails versenden, da Ihre Urlaubsschaltung aktiviert ist!");
+define('HOLIDAY_MEMBER_TLOCK', "Urlaubsschaltung eingerichtet");
+define('HOLIDAY_MEMBER_LOCKED', "Sie k&ouml;nnen derzeit Ihre Urlaubsschaltung nicht wieder deaktivieren, da Sie diese erst vor Kurzem aktiviert haben.");
+define('HOLIDAY_MEMBER_ORDER_1', "Sie k&ouml;nnen derzeit Ihre Urlaubsschaltung nicht ver&auml;ndern, da Ihre letzte Mailbuchung zu kurz her ist! Letzte Buchung: <U>");
+define('HOLIDAY_MEMBER_ORDER_2', "</U>");
+define('HOLIDAY_ADMIN_SINGLE_404', "Urlaubsschaltung nicht mehr vorhanden, oder veralteter Link!");
+define('HOLIDAY_ADMIN_LOCKED', "Dauer bis Urlaubsschaltung aufgehoben werden kann");
+define('HOLIDAY_ADMIN_MODE', "Zeitpunkt der Abarbeitung der Urlaubsschaltungen");
+define('HOLIDAY_ADMIN_MODE_RESET', "Am t&auml;glichen Reset um 00:00 Uhr");
+define('HOLIDAY_ADMIN_MODE_DIRECT', "Sofort nach Beantragung pr&uuml;fen");
+
+// Subject lines
+define('HOLIDAY_MEMBER_SUBJECT', "[HINWEIS:] Ihre Urlaubsanfrage");
+define('HOLIDAY_ADMIN_SUBJECT', "Urlaubsanfrage in Ihrem {!MT_WORD!}");
+define('HOLIDAY_MEMBER_UNLOCK_SUBJ', "[HINWEIS:] Beendigung Ihres Urlaubes");
+define('HOLIDAY_ADMIN_UNLOCK_SUBJ', "Automatische Urlaubsbeendigung");
+define('HOLIDAY_ADMIN_DEAC_SUBJ', "Deaktivierung einer Urlaubsschaltung");
+define('HOLIDAY_ADMIN_REMOVED_SUBJ', "[HINWEIS:] Ihr Urlaub wurde beendet");
+define('HOLIDAY_MEMBER_ACTIVATED', "[HINWEIS:] Ihre Urlaubsschaltung ist aktiviert");
+
+//
+?>
diff --git a/inc/language/html_mail_de.php b/inc/language/html_mail_de.php
new file mode 100644 (file)
index 0000000..239d7d0
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/25/2004 *
+ * ===============                              Last change: 04/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : html_de.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_HTML_DOWNLOAD_CLASS', "Bitte laden Sie sich die Klasse <A href=\"".DEREFERER("https://sourceforge.net/projects/phpmailer/")."\" target=\"_blank\">PHPMailer</A> herunter, um diese Funktion nutzen zu k&ouml;nnen!");
+define('MEMBER_HTML_INTRO', "HTML-Emfpang - Einstellung");
+define('MEMBER_HTML_TEXT', "In unserem {!MT_WORD!} ist das Empfangen von HTML-Mails nun m&ouml;glich. Gleichzeitig k&ouml;nnen Sie auch selber HTML-Mails versenden. M&ouml;chten Sie dies beides nutzen?");
+define('MEMBER_HTML_ORDER_INTRO', "HTML- oder normale Text-Mails versenden?");
+define('MEMBER_HTML_MSG', "HTML-Mail");
+define('MEMBER_NORMAL_MSG', "Normale Text-Mail");
+define('MEMBER_HTML_VALID_TAGS', "G&uuml;tige HTML-Codes sind");
+define('MEMBER_HTML_INVALID_TAGS', "Ung&uuml;tige HTML-Tags im HTML-Code gefunden!");
+
+//
+?>
diff --git a/inc/language/install_de.php b/inc/language/install_de.php
new file mode 100644 (file)
index 0000000..540f550
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/11/2005 *
+ * ===============                              Last change: 05/11/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : install_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('MT_WORD', "Mailtausch");
+define('MT_WORD2', "Mailtausches");
+define('INSTALLATION_OF_MXCHANGE', "Installation von MXChange-".MT_WORD."-Script");
+define('INSTALL_MISSING_DUMPS', "Die SQL-Dumps wurden nicht gefunden! Diese sollten auch mit hochgeladen werden und lesbar sein (CHMOD 644).");
+define('INSTALL_ENABLE_BACKLINK', "Backlink (=R&uuml;ckverlinkung zu mxchange.org setzen?) <EM>rel=&quot;external&quot;</EM> ist gesetzt. Bitte nicht den Backlink einbauen, und <STRONG>nofollow</STRONG> verwenden! Das schadet allen.");
+define('WRONG_PAGE', "Sie oder dieses Script haben eine falsche Seite ausgew&auml;hlt!");
+define('WELCOME_TEXT', "Willkommen zum Installationsscript von MXChange-{!MT_WORD!}, dem kostenlosen {!MT_WORD!} Powered by MyAutoInstaller-Community!");
+define('INTRO_TEXT', "Dieses Script wird den {!MT_WORD!} f&uuml;r Sie soweit installieren, die Datenbank einrichten und vorkonfigurieren.<br />Sie werden w&auml;hrend der Installation Schritt-F&uuml;r-Schritt durch die Installation gebracht! Bitte halten Sie die MySQL-Daten, sowie den absoluten Server-Pfad bereit!<br />Nach erfolgreicher Installation sollten Sie als n&auml;chstes das erste Administrator-Login einrichten. Anschliessend k&ouml;nnen Sie sich einloggen und weitere Einstellungen verfeinern.<br />Wir empfehlen dann alle Installationsdateien von Ihrem Server zu l&ouml;schen.");
+define('NEXT_PAGE', "Weiter zur n&auml;chsten Seite...");
+define('HEADER_TEXT_PAGE1', "Server-Pfad, Basis-URL und Webseitentitel");
+define('HEADER_TEXT_PAGE2', "MySQL-Daten: Hostname, Login und Passwort");
+define('HEADER_TEXT_PAGE3', "SMTP-Server Einstellungen");
+define('HEADER_TEXT_PAGE4', "Cascading Stylesheet-Datei");
+define('HEADER_TEXT_PAGE5', "Verschiedene Einstellungen");
+define('HEADER_MYSQL_ERRORS', "Fehler beim Verbinden zur MySQL-Datenbank!");
+define('TEXT_PAGE_1', "Geben Sie hier den absoluten Server-Pfad (/ihr/server/pfad/) <STRONG>mit</STRONG> abschliessendem Slash (/), die Basis-URL (vorgegebene stimmt meistens) und den Titel Ihres {!MT_WORD2!} ein.");
+define('TEXT_PAGE_2', "Geben Sie hier die Daten vom MySQL-Server ein, die Ihnen vom Hoster mitgeteilt wurden. Es wird dann anschliessend versucht, eine Testverbindung aufzubauen.");
+define('TEXT_PAGE_3', "Geben Sie hier die Ihre Zugangsdaten zum SMTP-Server (ausgehender Mailserver) ein, wenn der mail()-Befehl auf Ihrem Server deaktiviert sein sollte. Oder lassen Sie alle Felder leer f&uuml;r Standart-Einstellungen.");
+define('TEXT_PAGE_4', "Geben Sie hier die URL Ihrer hochgeladenen CSS-Datei an. Wenn Sie die bestehende Standart-Datei verwenden m&ouml;chten, so klicken Sie einfach auf Weiter.");
+define('TEXT_PAGE_5', "Hier k&ouml;nnen Sie weitere Einstellungen vornehmen, wie zum Beispiel den Ausgabe-Modus festlegen, in der der HTML-Code ausgegeben werden soll, usw.");
+define('TEXT_MYSQL_ERRORS', "Es konnte keine Verbindung zur Datenbank aufgebaut werden! Ist das Login richtig? Ist auch die UMSCHALT-Taste nicht bet&auml;tigt? (zweite gr&uuml;ne Lampe leuchtet!) Ist somit das Passwort richtig?<br /><br />Hier sind / ist alle Fehler aufgelistet:");
+define('SERVER_PATH', "Absoluter Server-Pfad");
+define('BASE_URL', "Basis-URL");
+define('HP_TITLE', "{!MT_WORD!}-Titel");
+define('HP_SLOGAN', "Werbespruch");
+define('HP_EMAIL', "E-Mail-Adresse");
+define('MYSQL_HOST', "Server-Hostname");
+define('MYSQL_DBASE', "Datenbank");
+define('MYSQL_PREFIX', "Pr&auml;fix f&uuml;r alle Tabellen");
+define('MYSQL_LOGIN', "Ihr Loginname");
+define('MYSQL_PASS1', "Ihr Passwort");
+define('MYSQL_PASS2', "Passwortwiederholung");
+define('CSS_URL', "URL zur CSS-Datei (relativ)");
+define('FATAL_NO_MHOST', "Sie haben keinen Hostnamen eingeben!");
+define('FATAL_NO_MDBASE', "Bitte geben Sie einen Datenbankname ein.");
+define('FATAL_NO_MLOGIN', "Bitte geben Sie Ihr Loginname zum MySQL-Server ein.");
+define('FATAL_NO_MPASS1', "Sie haben kein Passwort eingegeben! Dies ist sehr unsicher und wird daher als Fehler gewertet!");
+define('FATAL_NO_MPASS2', "Bitte geben Sie noch die Passwortbest&auml;tigung ein!");
+define('FATAL_MPASS1_MPASS2', "Ihre beiden Passw&ouml;rter sind nicht identisch!");
+define('LANG_OUTPUT_MODE', "Ausgabemodus des HTML-Codes");
+define('MODE_RENDER', "HTML-Code wird vom Server komplett erzeugt und dann ausgegeben");
+define('MODE_DIRECT', "HTML-Code wird sofort ausgegegeben. (Langsam)");
+define('WARN_NO_PASSWORD', "Warnen, wenn kein Passwort angegeben wurde?");
+define('INSTALL_SQL_IMPORT_FAILED', "Konnte die SQL-Dateien aus <strong>install/</strong> nicht nachladen. Bitte Zugriffsrechte (CHMOD) auf die Dateien &uuml;berpr&uuml;fen. Diese sollten 644 mindestens aufweisen!");
+
+// SMTP input
+define('TEXT_SMTP_HOST', "SMTP-Servername (z.B. mail.provider.tld)");
+define('TEXT_SMTP_USER', "SMTP-Benutzername");
+define('TEXT_SMTP_PASS1', "SMTP-Kennwort");
+define('TEXT_SMTP_PASS2', "SMTP-Kennwortwiederholung");
+define('INSTALL_SMTP_HOSTNAME_EMPTY', "SMTP-Servername leer gelassen.");
+define('INSTALL_SMTP_PASS1_EMPTY', "SMTP-Passwort leer gelassen.");
+define('INSTALL_SMTP_PASS2_EMPTY', "SMTP-Passwortwiederholung leer gelassen.");
+define('INSTALL_SMTP_PASS_MISMATCH', "SMTP-Passwort und -wiederholung stimmen nicht &uuml;berein.");
+
+//
+?>
diff --git a/inc/language/mailid_de.php b/inc/language/mailid_de.php
new file mode 100644 (file)
index 0000000..43df81b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/21/2004 *
+ * ===============                              Last change: 11/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mailid_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('MAIL_DATA_INVALID', "Daten der Mailbuchung sind fehlerhaft.");
+define('ERROR_CONFIRMING_MAIL', "Bitte klicken Sie nur Links aus Ihrem Mitgliedsbereich oder aus den Mails an.");
+define('THANX_POINTS_ADDED_1', "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die ");
+define('THANX_POINTS_ADDED_2', " {!POINTS!} wurden Ihnen gerade gutgeschrieben!");
+define('THANX_POINTS_LOCKED_1', "Vielen Dank f&uuml;r die Best&auml;tigung der Mail. Die ");
+define('THANX_POINTS_LOCKED_2', " {!POINTS!} werden Ihnen bald gutgeschrieben!");
+define('POINTS_NOT_ADDED_1', "Falscher Best&auml;tigungscode eingegeben! Die ");
+define('POINTS_NOT_ADDED_2', " {!POINTS!} wurden dem Versender wieder gutgeschrieben!");
+define('ENTER_CODE', "Code eingeben");
+define('MEMBER_TIME_COUNTER_1', "Gutschrift der {!POINTS!} erfolgt in");
+define('MEMBER_TIME_COUNTER_2', "!");
+define('SUBMIT_CODE', "Abschicken");
+define('MAILID_TOTAL_POINTS1', "Ihr Kontostand betr&auml;gt jetzt");
+define('MAILID_TOTAL_POINTS2', ".");
+
+//
+?>
diff --git a/inc/language/maintenance_de.php b/inc/language/maintenance_de.php
new file mode 100644 (file)
index 0000000..939ccac
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/13/2004 *
+ * ===============                              Last change: 08/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : de.php                                           *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language constans
+define('ADMIN_CHANGE_MAINTENANCE_MODE', "Wartungsmodus &auml;ndern");
+define('ADMIN_MAINTENANCE_MODE_INTRO', "Wartungsmodus Ihrer Webseite");
+define('ADMIN_MAINTENANCE_MODE_IS_INACTIVE', "Der Wartungsmodus ist derzeit ausgeschaltet. Wenn Sie ihn jetzt aktivieren, wird Ihre Webseite gesperrt. Nur Administratoren k&ouml;nnen diese dann besuchen.");
+define('ADMIN_MAINTENANCE_MODE_IS_ACTIVE', "Der Wartungsmodus ist derzeit eingeschaltet. Wenn Sie ihn jetzt deaktivieren, wird Ihre Webseite freigegeben. Alle G&auml;ste k&ouml;nnen Ihre Webseite dann wieder besuchen.");
+define('ADMIN_MAINTENANCE_DEACTIVATED', "Wartungsmodus wurde deaktiviert.");
+define('ADMIN_MAINTENANCE_ACTIVATED', "Wartungsmodus wurde aktiviert.");
+
+//
+?>
diff --git a/inc/language/mediadata_de.php b/inc/language/mediadata_de.php
new file mode 100644 (file)
index 0000000..5a85c73
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/05/2005 *
+ * ===============                              Last change: 03/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mediadata_de.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('MEDIA_DATA_GENERAL', "Allgemeine Mediendaten");
+define('MEDIA_DATA_POINTS', "{!POINTS!} im System");
+define('MEDIA_DATA_MISC', "Verschiedene Mediendaten");
+define('MEDIA_DATA_REFBANNER', "Daten zu unsere Referral-Bannern");
+define('MEDIA_DATA_MAIL', "Mailstatistik");
+
+define('MEDIA_DOUBLER_HEADER', "Statistiken - {!POINTS!}-Verdoppler");
+define('MEDIA_DOUBLER_COUNT', "Anzahl Auszahlungen");
+define('MEDIA_DOUBLER_CPOINTS', "Ausgezahlte {!POINTS!}");
+define('MEDIA_DOUBLER_WAITING', "In Warteschleife befindlich");
+define('MEDIA_DOUBLER_WPOINTS', "Wartende {!POINTS!}");
+
+define('MEDIA_TRANSFER_HEADER', "Statistiken - {!POINTS!}-Transfer");
+define('MEDIA_TRANSFER_IN_COUNT', "Anzahl eingehende Transfers");
+define('MEDIA_TRANSFER_IN_POINTS', "Eingehende {!POINTS!}");
+define('MEDIA_TRANSFER_OUT_COUNT', "Anzahl ausgehende Transfers");
+define('MEDIA_TRANSFER_OUT_POINTS', "Ausgehende {!POINTS!}");
+
+define('TOTAL_REF_BANNER', "Anzahl Referral-Banner");
+define('TOTAL_REF_CLICKS', "Klicks auf die Banner");
+define('TOTAL_REF_VIEWS', "Einblendungen der Banner");
+define('TOTAL_REFCLICKS', "Referral-Klicks");
+define('MEDIA_BEG_CLICKS', "Klicks auf Bettellinks");
+define('MEDIA_HOLIDAY_COUNT', "Auf Urlaub gestellte Accounts");
+define('CONTINUE_MEMBER_STATS', "Weiter zur Mitglieder-Statistik");
+
+define('MEDIA_DATA_SCRIPT', "Daten zur verwendeten Software");
+define('ENGINE_SOFTWARE', "Verwendete Engine");
+define('ENGINE_VERSION', "Installierte MXChange-Version");
+define('ENGINE_PATCH_LEVEL', "Patch-Level");
+define('ENGINE_PATCH_CTIME', "Letzte Aktualisierung");
+
+// Admin area
+define('ADMIN_MEDIADATA_SETTINGS', "Einstellungen zu den Mediendaten");
+define('ADMIN_MEDIADATA_MT_START', "Startdatum Ihres ".MT_WORD2."");
+define('ADMIN_MEDIADATA_MT_START_NOTE', "Bitte beachten Sie, dass das Startdatum Ihres ".MT_WORD2." nicht in der Zukunft liegen darf!");
+define('ADMIN_MEDIADATA_MT_STAGE', "Anzahl zu vorausberechnende Mitgliederanzahl");
+define('ADMIN_MEDIADATA_MT_STAGE_NOTE', "Geben Sie hier an, wie viele Mitglieder Ihr ".MT_WORD." erreichen soll. Es wird dann vom Script gesch&auml;tzt, an welchem Tag dies sein wird.");
+
+// New guest data
+define('MEDIA_DATA_MEMBERS', "Mitglieder-Statistik");
+define('USERS_CONFIRMED', "Best&auml;tigte Accounts");
+define('USERS_UNCONFIRMED', "Auf Freischaltung wartend");
+define('USERS_LOCKED', "Gesperrte Accounts");
+define('USER_MT_START', "Start dieses {!MT_WORD2!}");
+define('USER_MT_PROJECTED_1', "Voraussichtlich: Am <STRONG>");
+define('USER_MT_PROJECTED_2', "</STRONG> werden wir <STRONG>");
+define('USER_MT_PROJECTED_3', "</STRONG> Mitglieder erreicht haben!");
+define('USER_PROJECTION_UNKNOWN', "<I>unbekanntes Datum</I>");
+
+//
+?>
diff --git a/inc/language/mods_de.php b/inc/language/mods_de.php
new file mode 100644 (file)
index 0000000..9e1fbf5
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2004 *
+ * ===============                              Last change: 08/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mods_de.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('MODS_NAME', "Modulname");
+define('MODS_TITLE', "Modultitel");
+define('MODS_IS_LOCKED', "Gesperrt");
+define('MODS_IS_HIDDEN', "Verdeckt");
+define('MODS_IS_ADMIN', "Nur Admin");
+define('MODS_IS_MEMBER', "Nur Mitglied");
+define('MODS_CLICKS', "Klicks");
+define('MODS_EDIT', "Module &auml;ndern");
+define('MODS_ADMIN_EDIT_NOTE', "Klicken Sie auf den Modulnamen, um Statistiken zu den verkn&uuml;pften Men&uuml;punkten zu erhalten.");
+define('MODS_NOTHING_SELECTED', "Bitte mindestens ein Modul ausw&auml;hlen.");
+define('MODS_CHANGED', "Module wurden ge&auml;ndert.");
+define('MODS_WHAT_ACTION', "Men&uuml;punkt (Hauptmen&uuml;)");
+
+//
+?>
diff --git a/inc/language/newsletter_de.php b/inc/language/newsletter_de.php
new file mode 100644 (file)
index 0000000..f4d29c3
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/10/2005 *
+ * ===============                              Last change: 01/10/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : newsletter_de.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+
+// Language definitions
+define('ADMIN_SEND_NL', "Newsletter versenden");
+define('NEWSLETTER_FROM', "Newsletter vom");
+define('ENTER_NL_SUBJECT', "Betreffzeile");
+define('ENTER_NL_TEXT', "Werbetext");
+define('ADMIN_NL_TITLE', "Newsletter an Mitglieder versenden");
+define('ADMIN_NL_SEND_MODE', "Aussendemodus der Mails");
+define('NL_MODE_TEXT', "Text-Mail");
+define('NL_MODE_HTML', "HTML-Mail");
+define('ADMIN_NL_SEND_DONE', "Newsletter wurde versendet.");
+define('ADMIN_NEWSLETTER_SETTINGS', "Einstellungen am Newsletter");
+define('ADMIN_NL_CHARGE', "Monatliche Geb&uuml;hr zur Abschaltung des Newsletters");
+define('ADMIN_NL_AUTO_ADD', "URLs automatisch umwandeln");
+define('ADMIN_NL_SUBJECT', "Newsletterabmeldung");
+define('ADMIN_TASK_IS_NL_UNSUBSCRIBE', "Newsletter-System");
+define('ADMIN_NL_UNSUBSCRIBE', "Abbestellung durchf&uuml;hren");
+define('ADMIN_NL_UNSUBSCRIBE_ALREADY', "Abbestellung bereits durchgef&uuml;hrt!");
+define('ADMIN_NL_MEMBER_DONE', "Mitglied wurde ausgetragen und benachrichtigt.");
+define('NL_MEMBER_TITLE', "Newsletter abbestellen");
+define('NL_MEMBER_RECEIVE_STATUS', "Newsletterempfang ist derzeit...");
+define('NL_MEMBER_CHARGE', "Abbestellgeb&uuml;hr f&uuml;r einen Monat");
+define('NL_MEMBER_ON', "eingeschaltet");
+define('NL_MEMBER_OFF', "ausgeschaltet");
+define('NL_MEMBER_SUBMIT_ON', "Jetzt wieder einschalten");
+define('NL_MEMBER_SUBMIT_OFF', "Abschaltung *verbindlich* bestellen");
+define('NL_MEMBER_SUBJECT', "Ihre Newsletterabbestellung");
+define('NL_ADMIN_SUBJECT', "Abbestellungsanfrage des Newsletters");
+define('NL_MEMBER_REQUEST_DONE', "Abestellungsanfrage versendet.");
+define('NL_MEMBER_REQUEST_ALREADY', "Newsletterabbestellung ist bereits beantragt.");
+define('NL_MEMBER_DONE_SUBJECT', "Newsletter-Austragung abgeschlossen");
+define('NL_MEMBER_RESET_SUBJECT', "Automatische Eintragung in Newsletter");
+define('ADMIN_NEWSLETTER_NOTE', "Hinweis: Wenn die URLs umgewandelt werden sollen, wird ein Dereferrer eingesetzt.");
+
+//
+?>
diff --git a/inc/language/nickname_de.php b/inc/language/nickname_de.php
new file mode 100644 (file)
index 0000000..d3bd0b5
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/20/2004 *
+ * ===============                              Last change: 12/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : nickname_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('NICKNAME_CHANGE_NICKNAME_TITLE', "Einstellen Ihres Nicknames");
+define('NICKNAME_CHANGE_NICKNAME_INTRO', "Stellen Sie hier einen Nicknamen ein, der anstelle Ihrer User-ID angezeigt wird! Dieser darf nur unten aufgef&uuml;hrte Zeichen enthalten und sollte nicht k&uuml;rzer als {!__NICKNAME_LENGTH!} Zeichen sein.");
+define('NICKNAME_ENTER_NICKNAME', "Nickname eingeben");
+define('NICKNAME_SUBMIT', "Nickname &auml;ndern");
+define('NICKNAME_ALREADY_IN_USE', "Der von Ihnen eingegebene Nickname wird bereits verwendet!");
+define('NICKNAME_SAVED', "Nickname wurde gespeichert.");
+define('GUEST_ENTER_LOGIN_NICKNAME', "Nickname o. Login-ID");
+define('NICKNAME_ALLOWED_CHARS', "Erlaubte Zeichen: <STRONG>{!__NICKNAME_LANG_CHARS!}</STRONG>");
+define('NICKNAME_IS_INVALID', "Ung&uuml;tige Zeichen im Nicknamen gefunden oder ist zu kurz!");
+define('NICKNAME_YOUR_REFLINK', "Ihr Nickname-Reflink");
+define('NO_NICKNAME_SET', "Sie haben noch keinen Nickname eingerichtet! Damit k&ouml;nnen Sie sich alternativ zur User-ID einloggen.");
+define('PLEASE_CLICK_NICKNAME_FORM', "Hier k&ouml;nnen Sie sich nun einen einrichten...");
+define('NICKNAME_ADMIN_CONFIG_HEADER', "Einstellungen am Nicknamen");
+define('ADMIN_NICKNAME_MIN_LENGTH', "Minimale L&auml;nge");
+define('ADMIN_NICKNAME_PATTERN', "Pattern f&uuml;r ereg()-Befehl");
+define('ADMIN_NICKNAME_LANG_CHARS', "Zeichenfolge f&uuml;r Sprachdatei");
+
+//
+?>
diff --git a/inc/language/online_de.php b/inc/language/online_de.php
new file mode 100644 (file)
index 0000000..db5313d
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/14/2005 *
+ * ===============                              Last change: 01/14/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : online_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ONLINE_STATISTICS_DEACTIVATED', "Online-Statistik deaktivert.");
+
+//
+?>
diff --git a/inc/language/optimize_de.php b/inc/language/optimize_de.php
new file mode 100644 (file)
index 0000000..fa2e35d
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/12/2004 *
+ * ===============                              Last change: 09/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : optimize_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('OPTIMIZE_DBNAME', "Tabelle");
+define('OPTIMIZE_REPAIRED', "Repariert");
+define('OPTIMIZE_OPTIMIZED', "Optimiert");
+define('OPTIMIZE_TOTAL_SIZE', "Gesamtgr&ouml;sse");
+define('OPTIMIZE_GAIN_SIZE', "Eingespart");
+define('OPTIMIZE_STATUS_OK', "Nein");
+define('OPTIMIZE_STATUS_UNSUPPORTED', "Nicht m&ouml;glich");
+define('OPTIMIZE_STATUS_OPTIMIZED', "Optimiert!");
+define('OPTIMIZE_DB_TOTAL_TABLES', "Gesamtzahl angelegter Tabellen");
+define('OPTIMIZE_DB_TOTAL_SIZE', "Gesamtgr&ouml;&szlig;e der Datenbank");
+define('OPTIMIZE_DB_TOTAL_OPTIMIZE', "Aufrufe der Optimierungsfunktion");
+define('OPTIMIZE_DB_TOTAL_GAIN_SIZE', "Diesen Durchlauf eingespart");
+define('OPTIMIZE_DB_TOTAL_GAIN_TABLES', "Diesen Durchlauf optimierte Tabellen");
+define('OPTIMIZE_DB_TOTAL_OPTI', "Gesamteinsparnisse");
+
+//
+?>
diff --git a/inc/language/order_de.php b/inc/language/order_de.php
new file mode 100644 (file)
index 0000000..be9999d
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/19/2004 *
+ * ===============                              Last change: 09/19/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : order_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ORDER_ADMIN_SETTINGS', "Einstellungen - Mailbuchung");
+define('ORDER_ADMIN_MISC_SETTINGS', "Weitere Einstellungen");
+define('ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder maximal versenden k&ouml;nnen?");
+define('ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empf&auml;nger pro Mailbuchung");
+define('ORDER_ADMIN_MAX', "So viele wie m&ouml;glich.");
+define('ORDER_ADMIN_ORDER', "So viele wie auf Empfang eingestellt.");
+define('ORDER_ALLOWED_RECEIVE_1', "Sie k&ouml;nnen heute noch <STRONG>");
+define('ORDER_ALLOWED_RECEIVE_2', "</STRONG> von <STRONG>");
+define('ORDER_ALLOWED_RECEIVE_3', "</STRONG> Mailbuchungen aufgeben.");
+define('MEMBER_ORDER_MAX_ALLOWED', "Maximale Mailbuchungen");
+define('ORDER_ALLOED_MAX', "Sie k&ouml;nnen solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.");
+define('MEMBER_ORDER_ALLOWED_EXHAUSTED', "Sie k&ouml;nnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang h&ouml;her ein.");
+define('MEMBER_MIN_RECS_1', "Minimum:");
+define('MEMBER_MIN_RECS_2', "");
+define('MEMBER_ENTER_INVALID_URL', "Ung&uuml;tige URL eingegeben!");
+define('ADMIN_ORDER_SELECTION_COLUMN', "Tabellenspalte, nach der umsortiert werden soll");
+define('ADMIN_ORDER_SELECTION_MODE', "Sortierreihenfolge");
+define('ADMIN_ORDER_SELECTION_SETTINGS', "Auswahlverfahren der Empf&auml;nger");
+
+define('ORDER_SELECT_COLUMN_USERID', "Mitgliedsnummer");
+define('ORDER_SELECT_COLUMN_ZIP', "Postleitzahl");
+define('ORDER_SELECT_COLUMN_COUNTRY', "Land");
+define('ORDER_SELECT_COLUMN_EMAIL', "EMail-Adresse");
+define('ORDER_SELECT_COLUMN_BIRTH_YEAR', "Geburtsjahr");
+define('ORDER_SELECT_COLUMN_LAST_ONLINE', "Als letztes Online");
+define('ORDER_SELECT_COLUMN_REF_CLICKS', "Klicks auf Ref-Link");
+define('ORDER_SELECT_COLUMN_TOTAL_LOGINS', "Gesamtlogins");
+define('ORDER_SELECT_COLUMN_MAIL_ORDERS', "Heutige Mailbuchungen");
+
+define('ADMIN_AUTOSEND_INACTIVE', "Der Auto-Versand ist in Ihrem {!MT_WORD!} derzeit deaktiviert. Bitte loggen Sie sich in den Admin-Bereich ein und schalten Sie diese Mailbuchung frei!");
+define('ADMIN_AUTOSEND_ACTIVE', "Der Auto-Versand ist in Ihrem {!MT_WORD!} derzeit aktiviert. Die Mailbuchung wird aktiviert und dann automatisch versand.");
+define('MEMBER_AUTOSEND_INACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit deaktiviert. Ihre Mailbuchung wird bald von einem Administrator ueberprueft und dann freigegeben.");
+define('MEMBER_AUTOSEND_ACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit aktiviert. Ihr Mailbuchung wurde aktiviert und wird bald automatisch versant.");
+
+// Repay deleted mails constants
+define('ADMIN_CFG_REPAY_POINTS_REPAY', "Dem Mitglied gutschreiben");
+define('ADMIN_CFG_REPAY_POINTS_JACKPOT', "In den Jackpot legen");
+define('ADMIN_CFG_REPAY_POINTS_SHRED', "Nicht gutschreiben (verf&auml;llt dann)");
+define('ADMIN_REPAY_ON_DELETE_MODE', "Wie sollen {!POINTS!} von gel&ouml;schten Mails verbucht werden?");
+
+//
+?>
diff --git a/inc/language/other_de.php b/inc/language/other_de.php
new file mode 100644 (file)
index 0000000..eaaee73
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/19/2003 *
+ * ===============                              Last change: 11/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : de.php                                           *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language constans
+define('ADMIN_OTHER_SETTINGS', "Sonstige Einstellungen");
+define('ADMIN_OPTION_URL_TIME_LOCK', "Selbe beworbene URL nicht mehr bewerbar (0 = URL sofort erneut buchbar)");
+define('ADMIN_OPTION_POOL_MAX_SEND', "Anzahl zu sendender Mails aus dem Pool");
+define('ADMIN_OPTION_MAX_UNCONFIRMED_MAILS', "Maximale Anzahl unbest. Mails (Mailbuchung)");
+define('ADMIN_OPTION_LOCK_PROFILE_TIME', "Sperrzeit des Mitgliedprofiles nach &Auml;nderung (0 = Keine Sperrzeit)");
+define('ADMIN_OPTION_MAX_TEXT_LENGTH', "Maximale L&auml;nge des Werbetextes");
+define('ADMIN_OPTION_CHECK_EMAIL_TEXT', "Sind URLs im Werbetext erlaubt?");
+define('ADMIN_OPTION_CHECK_EMAIL_SUBJ', "Sind URLs in der Betreffzeile erlaubt?");
+define('ADMIN_OPTION_URL_BLACKLIST', "Black-Liste f&uuml;r gebuchte URLs aktivieren?");
+define('ADMIN_OPTION_AUTOSEND_ACTIVE', "Ist der Auto-Versand aktiv?");
+define('ADMIN_OPTION_NOTIFY_ADMIN', "Benachrichtigung bei Profil&auml;nderung?");
+define('ADMIN_OPTION_MAX_ONLINETIME', "Timeout f&uuml;r Who-is-Online");
+define('ADMIN_OPTION_SEND_UPDATE', "Mail zur Erneurung des Profiles senden?");
+define('ADMIN_SENDING_SETTINGS', "Versand-Optionen");
+define('ADMIN_NOTIFY_SETTINGS', "Benachrichtigungsoptionen");
+define('ADMIN_TIMEOUT_SETTINGS', "Time-out Optionen");
+define('ADMIN_PROFILE_TIME_SETTINGS', "Zeitenangaben f&uuml;r Mitgliederprofile");
+define('ADMIN_OPTION_PROFILE_UPDATE', "Profilaktualisierungsinterval (0 = Keine Erinnerung aussenden)");
+define('ADMIN_OPTION_PROFILE_REUPDATE', "Erneute Aussendung der Mail (0 = Keine Erinnerung aussenden)");
+define('ADMIN_OPTION_CODE_LENGTH', "L&auml;nge des grafischen Codes im Best.-Frame (0 = Nur Button anklicken)");
+define('ADMIN_CODE_LENGTH_NOTE', "(Zeichenanzahl)");
+define('ADMIN_OPTION_ACTIVATE_EXCHANGE', "Automatisches Freischalten des Mailtauschs, wenn x Mitglieder empfangsbereit sind. 0 = Funktion abschalten");
+define('ADMIN_OPTION_ZIPCODE_ACTIVE', "Versand nach PLZ erlauben");
+define('ADMIN_OPTION_POINTS_WORD', "W&auml;hrung Ihres Tausches (Klammlose, Wernis, FuCo, etc.)");
+define('ADMIN_OPTION_MAX_COMMA', "Angezeigte Stellen hinter dem Komma");
+define('ADMIN_OPTION_CSS_PHP', "Sollen die CSS-Dateien direkt ausgegeben werden oder von css.php angezeigt werden?");
+define('ADMIN_CSS_PHP_DIRECT', "Direkt ausgeben");
+define('ADMIN_CSS_PHP_FILE', "Per css.php ausgeben");
+define('ADMIN_OPTION_GUEST_MENU', "Gastmen&uuml; global ein-/ausblenden");
+define('ADMIN_OPTION_MEMBER_MENU', "Mitgliedsmen&uuml; global ein-/ausblenden");
+define('ADMIN_OPTION_YOURE_HERE', "Navigation &quot;Sie sind hier&quot; ein-/ausblenden");
+define('ADMIN_GUEST_MENU_ACTIVE', "Einblenden");
+define('ADMIN_GUEST_MENU_INACTIVE', "Ausblenden");
+define('ADMIN_MEMBER_MENU_ACTIVE', "Einblenden");
+define('ADMIN_MEMBER_MENU_INACTIVE', "Ausblenden");
+define('ADMIN_YOURE_HERE_ACTIVE', "Einblenden");
+define('ADMIN_YOURE_HERE_INACTIVE', "Ausblenden");
+define('ADMIN_OPTION_MT_WORD', "Art Ihres Tausches (1. Fall)");
+define('ADMIN_OPTION_MT_WORD2', "Art Ihres Tausches (2. Fall)");
+define('ADMIN_OPTION_MT_WORD3', "Art Ihres Tausches (1. Fall, Plural)");
+define('ADMIN_OPTION_REJECT_URL', "Standart-URL bei Ablehnung der Mailbuchung");
+
+//
+?>
diff --git a/inc/language/payout_de.php b/inc/language/payout_de.php
new file mode 100644 (file)
index 0000000..8ad9e0d
--- /dev/null
@@ -0,0 +1,142 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ===============                              Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : payout_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_PAYOUT_ADD_NEW_TITLE', "Neuer Auszahlungstyp hinzuf&uuml;gen");
+define('ADMIN_PAYOUT_ADD_NEW_NOTE', "Auszahlungsbezeichnung kann z.B. Lose, FCs, HCs oder &euro; sein.");
+define('ADMIN_PAYOUT_ADD_NEW', "Hinzuf&uuml;gen");
+define('ADMIN_PAYOUT_FROM', "Ihr Account");
+define('ADMIN_PAYOUT_TITLE', "Auszahlungsbezeichnung");
+define('ADMIN_PAYOUT_RATE', "Umrechnungsrate: 1 Punkt =");
+define('ADMIN_PAYOUT_RATE2', "Umrechnungsrate");
+define('ADMIN_PAYOUT_VALUE_NOTE', "0.1, 1.2 o.&auml;");
+define('ADMIN_PAYOUT_TYPE_ADDED', "Auszahlungstyp hinzugef&uuml;gt.");
+define('ADMIN_PAYOUT_TYPE_ALREADY', "Auszahlungstyp existiert bereits!");
+define('ADMIN_PAYOUT_EDIT_DEL_TITLE', "Editieren / L&ouml;schen von Auszahlungstypen");
+define('ADMIN_PAYOUT_EDIT_TITLE', "Ausgw&auml;hlte Eintr&auml;ge editieren");
+define('ADMIN_PAYOUT_DELETE_TITLE', "Ausgw&auml;hlte Eintr&auml;ge l&ouml;schen");
+define('ADMIN_PAYOUT_EDIT', "Editieren");
+define('ADMIN_PAYOUT_DELETE', "L&ouml;schen");
+define('ADMIN_PAYOUT_NO_MEMBER_REQUESTS', "Keine Auszahlungsanfragen von Ihren Mitgliedern erhalten!");
+define('ADMIN_PAYOUT_ENTRIES_CHANGED', "Eintr&auml;ge wurden ge&auml;ndert.");
+define('ADMIN_PAYOUT_ENTRIES_DELETED', "Eintr&auml;ge wurden gel&oumllscht.");
+define('ADMIN_PAYOUT_MIN_POINTS', "Minium {!POINTS!}-Guthaben");
+define('ADMIN_PAYOUT_MIN_POINTS2', "Min. {!POINTS!}");
+define('ADMIN_PAYOUT_YOUR_ACCOUNT', "Ihre Account-ID");
+define('ADMIN_PAYOUT_YOUR_PASSWORD', "Passwort");
+define('ADMIN_PAYOUT_YOUR_URL', "URL zum ext. Script");
+define('ADMIN_PAYOUT_YOUR_URL_NOTE', "<FONT class=\"admin_note\">
+  Wobei &#36;fuid/&#36;fpass und &#36;f/&#36;fpass die Logindaten sind und &#36;points die zu &uuml;bberweisenden {!POINTS!} sind:<br />
+  http://url/engine.php?action=trans&amp;from_uid=&#36;fuid&amp;from_pass=&#36;fpass&amp;to_uid=&#36;tuid&amp;to_pass=&#36;tpass&amp;points=&#36;points<br />
+</FONT>");
+define('ADMIN_PAYOUT_YOUR_RET_DONE', "Return-Code: Erfolgreich");
+define('ADMIN_PAYOUT_YOUR_RET_FAILED', "Return-Code: Fehlgeschlagen");
+define('ADMIN_PAYOUT_OPTIONAL_SETTINGS', "Optionale Einstellungen");
+define('ADMIN_PAYOUT_YOUR_PASS_TRANSFER', "Passwortverschl&uuml;sslung zur &Uuml;bertragung");
+define('PAYOUT_NOW', "Sie k&ouml;nnen Ihre angesammelten {!POINTS!} jetzt in anderen W&auml;hrungen auszahlen lassen!");
+define('PAYOUT_IN', "Auszahlen in");
+define('PAYOUT_MAX', "maximal");
+define('PAYOUT_ID_INVALID', "Auszahlungs-ID ist ung&uuml;ltig!");
+define('PAYOUT_POINTS_NOT_ENOUGTH', "Sie haben nicht ausreichend {!POINTS!} angesammelt!");
+define('PAYOUT_NOW_TITLE', "Auszahlungsanforderung an uns senden:");
+define('PAYOUT_SEND_NOW', "Auszahlung anfordern");
+define('PAYOUT_SELECTED_TYPE', "Auszahlungstyp");
+define('PAYOUT_MAX_PAYOUT', "Maximal auszahlbar");
+define('PAYOUT_WANT_PAYOUT', "Auszuzahlender Betrag");
+define('PAYOUT_TARGET_ACCOUNT', "An Accountnummer");
+define('PAYOUT_TARGET_BANK', "Bankleitzahl (od. Klamm)");
+define('PAYOUT_MEMBER_NOTE', "Accountnummer kann Ihre Kontonummer bei der Bank, Klamm-ID oder Ihre ID bei der Empf&auml;nger-Webseite sein. Bitte beachten Sie weitere Hinweise dieses ".MT_WORD2."!");
+define('PAYOUT_REQUEST_MEMBER', "Ihre Auszahlungsanfrage an uns");
+define('PAYOUT_REQUEST_ADMIN', "Auszahlungsanfrage eines Mitgliedes");
+define('PAYOUT_REQUEST_SENT', "Auszahlungsanfrage wurde versendet . . .");
+define('ADMIN_TASK_IS_PAYOUT_REQUEST', "Auszahlungsanfrage");
+define('ADMIN_PAYOUT_LIST_REQUESTS', "Jetzt alle Auszahlungsanfragen auflisten.");
+define('PAYOUT_ADMIN_LIST_PAYOUTS', "Alle Auszahlungen nach Mitgliedern auflisten");
+define('PAYOUT_DELETE_ALL_REQUESTS', "Alle Anfragen <STRONG>*SOFORT*</STRONG> l&ouml;schen");
+define('PAYOUT_TOTAL_PAYOUT', "Gesamtbetrag");
+define('PAYOUT_TARGET_ACCOUNT2', "Ziel-Account");
+define('PAYOUT_TARGET_BANK2', "Ziel-Bank");
+define('PAYOUT_ID', "Auszahlungs-ID");
+define('PAYOUT_TIMESTAMP', "Wann?");
+define('PAYOUT_STATUS', "Status&nbsp;/&nbsp;Aktionen");
+define('PAYOUT_STATUS_NEW', "Neu");
+define('PAYOUT_STATUS_ACCEPTED', "Angenommen");
+define('PAYOUT_STATUS_REJECTED', "Abgelehnt");
+define('PAYOUT_MEMBER_STATUS_NEW', "In Arbeit");
+define('PAYOUT_MEMBER_STATUS_ACCEPTED', "Angenommen");
+define('PAYOUT_MEMBER_STATUS_REJECTED', "Abgelehnt");
+define('PAYOUT_ACCEPT_PAYOUT', "Annehmen");
+define('PAYOUT_REJECT_PAYOUT', "Ablehnen");
+define('PAYOUT_OBTAIN_ID_FAILED', "Konnte ID nicht finden! Bitte links im Men&uuml; diese Anfrage aufsuchen!");
+define('PAYOUT_FAILED_OBTAIN_USERID', "Konnte Mitglieds-ID nicht finden!");
+define('PAYOUT_FAILED_OBTAIN_TASK_ID', "Konnte Task-ID nicht finden!");
+define('PAYOUT_FAILED_OBTAIN_USERDATA', "Konnte Mitgliedsdaten nicht laden!");
+define('PAYOUT_FAILED_OBTAIN_PAYOUT_ID', "Konnte Auszahlungs-ID nicht laden!");
+define('PAYOUT_ACCEPT_PAYOUT_INTRO', "Auszahlungsanfrage annehmen");
+define('PAYOUT_REJECT_PAYOUT_INTRO', "Auszahlungsanfrage ablehnen");
+define('PAYOUT_RECEIVER_ACCEPT', "Empf&auml;nger der Auszahlung");
+define('PAYOUT_RECEIVER_REJECT', "Empf&auml;nger der Ablehnung");
+define('PAYOUT_OPTIONAL_TEXT', "Optionale Hinweise an den Empf&auml;nger");
+define('PAYOUT_ACCEPTED_NOTIFIED', "Anfrage angenommen! Bitte &uuml;berweisen Sie nun den Betrag!");
+define('PAYOUT_REJECTED_NOTIFIED', "Anfrage abgelehnt! Das Mitglied wurde benachrichtigt.");
+define('PAYOUT_ACCEPTED_SUBJECT', "[Auszahlunganfrage:] Angenommen!");
+define('PAYOUT_REJECTED_SUBJECT', "[Auszahlunganfrage:] Abgelehnt!");
+define('PAYOUT_MEMBER_LIST_PAYOUTS', "Ihre Auszahlungsanfragen");
+define('PAYOUT_OPTIONAL_PASSWORD', "Optionales Passwort");
+define('PAYOUT_ADMIN_NO_REQUESTS_FOUND', "Keine Auszahlungsanfragen von Ihren Mitgliedern erhalten.");
+define('PAYOUT_REASON_PAYOUT', "{!POINTS!}-Transfer von ".MAIN_TITLE);
+define('ADMIN_PAYOUT_TRANSFER_FAILED', "Transfer nicht abgeschlossen:");
+define('ADMIN_PAYOUT_ALLOW_URLS', "URLs erlauben");
+define('PAYOUT_URLS_ALLOWED', "Keine direkte e-W&auml;hrung");
+define('PAYOUT_TARGET_URL', "Beworbene URL");
+define('PAYOUT_ALTERNATE_TEXT', "Kurzer Text (30 Zeichen)");
+define('PAYOUT_OPTIONAL_BANNER', "Optionaler Banner");
+define('PAYOUT_BANNER_NOTE', "Erlaube Bannerformate: 468x60, 88x31 usw.");
+define('PAYOUT_REMEMBER_TERMS', "Bitte beachten Sie f&uuml;r Auszahlungen in e-W&auml;hrungen unsere AGBs!");
+define('PAYOUT_MEMBER_STATUS', "Status");
+define('CLICK_HERE', "Klick!");
+define('PAYOUT_BANNER_ACCEPTED_NOTIFIED', "Anfrage angenommen, bitte richten Sie eine Werbekampagne ein!");
+define('PAYOUT_NOT_ENOUGH_POINTS', "Sie haben nicht ausreichend {!POINTS!}!");
+define('PAYOUT_NO_PAYOUT_TYPES', "Es wurden vom Admin noch keine Auszahlungstypen eingerichtet.");
+define('PAYOUT_LINK_TEXT', "Link-Text");
+define('PAYOUT_LINK_URL', "Link-URL");
+define('PAYOUT_NO_POINTS_ENTERED', "Sie haben keine {!POINTS!} zum Auszahlen eingegeben, oder es besteht ein &Uuml;bertragungsfehler! Bitte benachrichtigen Sie den Support!");
+
+//
+?>
diff --git a/inc/language/primera_de.php b/inc/language/primera_de.php
new file mode 100644 (file)
index 0000000..9e8bc90
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ===============                              Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : primera_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('TASK_ADMIN_LIST_PRIMERA_ALL', "Alle Primera-Ein-/Auszahlungen");
+define('TASK_ADMIN_LIST_PRIMERA_ALL_TITLE', "Listet alle Primera-Ein- und Auszahlungen auf.");
+define('PRIMERA_ADMIN_CONFIG_TITLE', "Einstellungen zum Primus-Portal:");
+define('PRIMERA_ADMIN_MIN_PAYOUT', "Minimumguthaben f&uuml;r Auszahlungen.");
+define('PRIMERA_ADMIN_MIN_WITHDRAW', "Minimumguthaben f&uuml;r Einzahlungen.");
+define('PRIMERA_ADMIN_API_NAME', "Primus-Nickname");
+define('PRIMERA_ADMIN_API_MD5', "Primera-Passwort (Wird als MD5-Hash gespeichert)");
+define('PRIMERA_ADMIN_CONFIG_NOTE', "<A href=\"http://www.primusportal.de/r/Quix0r\" target=\"_blank\">Hier</A> k&ouml;nnen Sie sich ein Primus-Portal-Account holen. <strong>Geben Sie immer Ihren Usernamen von Primus-Portal ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von Primera ben&ouml;tigt.");
+define('PRIMERA_ADMIN_NO_TRANSFERS', "Derzeit keine Primera transferiert!");
+define('PRIMERA_ADMIN_ACCOUNT', "Account bei Primus-Portal");
+define('PRIMERA_ADMIN_TRANSFERED', "Primera transferiert");
+define('PRIMERA_ADMIN_TIMESTAMP', "Zeitpunkt &Uuml;berweisung");
+define('PRIMERA_ADMIN_TYPE', "&Uuml;berweisungsrichtung");
+define('PRIMERA_ADMIN_API_MESSAGE', "Nachricht von Primus-API");
+define('PRIMERA_ADMIN_API_STATUS', "Status von Primus-API");
+define('MEMBER_PRIMERA_MODE_WITHDRAW', "Primera einzahlen");
+define('MEMBER_PRIMERA_MODE_PAYOUT', "Primera auszahlen");
+define('PRIMERA_STATUS_UNKNWOWN', "Primera-Typ <u>%s</u> unbekannt.");
+define('PRIMERA_STATUS_WITHDRAW', "Einzahlung von Primus");
+define('PRIMERA_STATUS_PAYOUT', "Auszahlung an Primus");
+define('PRIMERA_STATUS_FAILED', "Fehlgeschlagen");
+define('PRIMERA_TIMESTAMP', "Buchungszeitmarke");
+define('PRIMERA_ACCOUNT', "Primus-Portal");
+define('PRIMERA_TOTAL_PRIMERA', "Gesamt &uuml;berwiesen");
+define('PRIMERA_MEMBER_LIST_PRIMERA', "&Uuml;berweisungsliste von/an Primus-Portal");
+
+// API messages
+define('PRIMERA_API_REQUEST_DATA_INVALID', "Interner Fehler: Abfragedaten sind defekt!");
+define('PRIMERA_API_REQUEST_DATA_MISSING', "Interner Fehler: Abfragedaten sind nicht komplett!");
+define('PRIMERA_API_REQUEST_ERROR', "Abfragefehler: <u>%s</u>");
+define('PRIMERA_API_REQUEST_FAILED', "Unbekannter Fehler <u>%s</u> von API erhalten! Bitte im [<A href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</A>], den Fehlercode nennen und wie es dazu gekommen ist.");
+define('PRIMERA_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte Primera-Nickname und Passwort &uuml;berpr&uuml;fen. [<A href=\"http://www.primusportal.de/\" target=\"_blank\" title=\"Direkt zum Primus-Exportaccount\">Hier</A>] direkt zum Primera-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
+define('PRIMERA_API_REQUEST_FAILED_USER', "Useraccount nicht gefunden oder Primera-Passwort ist ung&uuml;ltig!");
+define('PRIMERA_API_REQUEST_FAILED_OWN', "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.");
+define('PRIMERA_API_REQUEST_FAILED_AMOUNT', "Konto weist nicht gen&uuml;gend Deckung auf.");
+define('PRIMERA_API_REQUEST_FAILED_API_AMOUNT', "Primera-Account weist nicht gen&uuml;gend Deckung auf.");
+define('PRIMERA_API_PURPOSE_WITHDRAW', "Einzahlung auf {!MAIN_TITLE!} ({!URL!}), ID: %s");
+define('PRIMERA_API_PURPOSE_PAYOUT', "Auszahlung von {!MAIN_TITLE!} ({!URL!}), ID: %s");
+
+// Error messages
+define('PRIMERA_ERROR_STATUS', "Fehler-Status <u>%s</u> erhalten.");
+define('PRIMERA_UNKNOWN_ERROR', "Unbekannter Fehler aufgetreten!");
+
+// Member messages
+define('PRIMERA_MEMBER_NO_ACCOUNT', "Noch kein Primus-Account? Hier entlang!");
+define('PRIMERA_MEMBER_API_DATA_MISSING', "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten m&uuml;ssen.");
+define('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT', "Sie haben nicht gen&uuml;gend Primera zum Auszahlen! Mindestens: <u>%s</u> Primera.");
+define('PRIMERA_MEMBER_WITHDRAW_TITLE', "Primera bei {!MAIN_TITLE!} einzahlen:");
+define('PRIMERA_MEMBER_WITHDRAW_POINTS_ACCOUNT', "Primera hier im Account:");
+define('PRIMERA_MEMBER_WITHDRAW_MIN_POINTS', "Mindest einzuzahlendes Primera-Guthaben:");
+define('PRIMERA_MEMBER_WITHDRAW_SUBMIT', "Primera jetzt einzahlen");
+define('PRIMERA_MEMBER_WITHDRAW_NOTE', "Ihr Primera-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Primera-Betrag nur gerade Betr&auml;ge eingeben! Ihr Primera-Account sollte ausreichend Deckung aufweisen!");
+define('PRIMERA_MEMBER_PAYOUT_TITLE', "Primera auf Ihr Portal-Account auszahlen");
+define('PRIMERA_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes Primera-Guthaben");
+define('PRIMERA_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes Primera-Guthaben");
+define('PRIMERA_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
+define('PRIMERA_MEMBER_PAYOUT_NOTE', "Ihr Primera-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Primera-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren Primus-Usernamen.");
+define('PRIMERA_MEMBER_NICKNAME', "Username bei Primus-Portal: [<A href=\"http://www.primusportal.de/lost_password.php\" target=\"_blank\">Vergessen?</A>]");
+define('PRIMERA_MEMBER_PASSWORD', "Primera-Passwort (nicht Accountpasswort!): [<A href=\"http://www.primusportal.de/lost_password.php\" target=\"_blank\">Vergessen?</A>]");
+define('PRIMERA_MEMBER_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
+define('PRIMERA_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <u>%s</u> erkannt! Bitte links im Men&uuml; fortfahren.");
+define('PRIMERA_MEMBER_EMPTY_USERNAME', "Sie haben Ihren Primus-Usernamen nicht eingegeben.");
+define('PRIMERA_MEMBER_EMPTY_PASSWORD', "Sieh haben kein Primera-Passwort eingegeben.");
+define('PRIMERA_MEMBER_EMPTY_AMOUNT', "Sie haben keine zu &uuml;berweisende Betrag angegeben.");
+define('PRIMERA_MEMBER_INVALID_USERNAME', "Bitte nur Zahlen f&uuml;r den Primus-Usernamen eingeben!");
+define('PRIMERA_MEMBER_INVALID_AMOUNT', "Bitte nur Zahlen f&uuml;r den zu &uuml;berweisenden Betrag eingeben!");
+define('PRIMERA_MEMBER_AMOUNT_SMALLER_MIN', "Bitte geben Sie mindestens <u>%s</u> Primera an!");
+define('PRIMERA_MEMBER_WITHDRAW_FAILED', "Die Einzahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <em>%s</em>.");
+define('PRIMERA_MEMBER_WITHDRAW_DONE', "Einzahlung auf Ihr {!MAIN_TITLE!} Konto erfolgreich abgeschlossen. :-)");
+define('PRIMERA_MEMBER_PAYOUT_DONE', "Auszahlung auf Primus-Portal erfolgreich abgeschlossen. :-)");
+define('PRIMERA_MEMBER_PAYOUT_POINTS_DEPLETED', "Sie k&ouml;nnen nicht <u>%s</u> Primera auszahlen, da Sie nur <u>%s</u> &uuml;brig haben.");
+define('PRIMERA_MEMBER_STATUS', "&Uuml;berweisungsart");
+
+//
+?>
diff --git a/inc/language/rallye_de.php b/inc/language/rallye_de.php
new file mode 100644 (file)
index 0000000..0094713
--- /dev/null
@@ -0,0 +1,149 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/04/2004 *
+ * ===============                              Last change: 08/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : rallye_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_RALLYE_ADD_NEW_TITLE', "Neue Ref-Rallye hinzuf&uuml;gen");
+define('ADD_RALLYE', "Rallye hinzuf&uuml;gen");
+define('ADD_RALLYE_PRICE', "Preis hinzuf&uuml;gen");
+define('RALLYE_START_DAY', "Beginn der Rallye");
+define('RALLYE_END_DAY', "Ende der Rallye");
+define('RALLYE_AUTO_ADD_USER', "Neue Mitglieder nehmen automatisch dran teil");
+define('RALLYE_IS_ACTIVE', "Rallye ist aktiv");
+define('RALLYE_SEND_NOTIFY', "Autom. Benachrichtigung an Mitglieder senden");
+define('RALLYE_OVERLAP_TIMES', "Rallyes d&uuml;rfen nicht zeitgleich laufen!");
+define('RALLYE_TITLE', "Rallye-Titel");
+define('RALLYE_DESCR', "Kurze Beschreibung / Freier HTML-Code der Rallye");
+define('RALLYE_TEMPLATE', "Template (anstelle freien HTML-Codes)");
+define('RALLYE_PROBLEM_CREATE', "Problem beim Erzeugen der Rallye!");
+define('RALLYE_NO_RALLYES_SETUP', "Bitte f&uuml;gen Sie zuerst eine neue Rallye hinzu.");
+define('RALLYE_CONFIG_PRICES_1', "Preise einrichten f&uuml;r Rallye <U>");
+define('RALLYE_CONFIG_PRICES_2', "</U>");
+define('RALLYE_PRICE_LEVEL', "Platz eingeben (1, 2, 3, usw.)");
+define('RALLYE_PRICE_POINTS', "Preis in {!POINTS!}");
+define('RALLYE_PRICE_INFOS', "Preisbeschreibung (<FONT class=\"tiny\">Sie k&ouml;nnen auch nur die Beschreibung eingeben!</FONT>)");
+define('RALLYE_PRICE_ALREADY_FOUND', "Sie haben bereits f&uuml;r diesen Platz einen Preis vergeben oder ist identisch mit anderen Preisen!");
+define('RALLYE_PRICE_LEVEL_SAVED', "Preis wurde hinzugef&uuml;gt.");
+define('RALLYE_EDIT_DEL_PRICES', "&Auml;ndern und L&ouml;schen von Rallye-Preisen");
+define('RALLYE_LEVEL', "Platz");
+define('RALLYE_PRICE_INFO', "Infos");
+define('RALLYE_EDIT_SELECTED_PRICES', "Preise/Pl&auml;tze &auml;ndern");
+define('RALLYE_EDIT_PRICES', "Editieren");
+define('RALLYE_DELETE_PRICES', "L&ouml;schen");
+define('RALLYE_CHANGE_PRICES', "&Auml;ndern");
+define('RALLYE_ID', "Rallye-ID");
+define('RALLYE_EDIT_DEL_RALLYES', "&Auml;ndern / L&ouml;schen von Rallyes (Grunddaten)");
+define('RALLYE_ADMIN_ID', "Admin-Login");
+define('RALLYE_TSTART', "Anfang");
+define('RALLYE_TEND', "Ende");
+define('RALLYE_EDIT_ADMIN', "Editieren");
+define('RALLYE_DELETE_ADMIN', "L&ouml;schen");
+define('RALLYE_EDIT_DEL_NOTE', "Wenn Sie die Grunddaten der ausgew&auml;hlten Rallyes &auml;ndern / l&ouml;schen wollen, markieren Sie diese per K&auml;stchen. Wollen Sie die Preise &auml;ndern, klicken Sie den Rallye-Titel an. Aktive Rallyes k&ouml;nnen nicht ge&auml;ndert werden, sondern m&uuml;ssen erst deaktiviert werden.");
+define('RALLYE_ENTRIES_DELETED', "Eintr&auml;ge gel&ouml;scht.");
+define('RALLYE_ENTRIES_CHANGED', "Eintr&auml;ge ge&auml;ndert.");
+define('RALLYE_ENTRIES_NOT_DELETED', "Bitte w&auml;hlen Sie mindestens einen Eintrag zum L&ouml;schen aus.");
+define('RALLYE_DESCR2', "Kurzbeschreibung");
+define('RALLYE_TEMPLATE2', "Template");
+define('RALLYE_AUTO_ADD', "Autom. Teilnahme");
+define('RALLYE_ACTIVE', "Aktiviert");
+define('RALLYE_NOTIFY', "Benachrichtigen");
+define('RALLYE_NOTIFIED', "Benachrichtigt");
+define('RALLYE_ASSIGNED_PRICES', "Bereits eingerichtete Preise");
+define('RALLYE_ASSIGNED_USERS', "Teilnehmende Mitglieder");
+define('RALLYE_LIST_OVERVIEW_TITLE', "Datenbl&auml;tter der Rallyes");
+define('RALLYE_NO_RALLYES_SELECTED_1', "Sie haben keine ");
+define('RALLYE_NO_RALLYES_SELECTED_2', "Rallyes zum Editieren");
+define('RALLYE_NO_RALLYES_SELECTED_3', " ausgew&auml;hlt!");
+define('RALLYE_DEACTIVATE_NOW', "Rallye deaktivieren");
+define('RALLYE_ACTIVATE_NOW', "Rallye aktivieren");
+define('RALLYE_STOP_NOTIFY_NOW', "Nicht mehr benachrichtigen");
+define('RALLYE_START_NOTIFY_NOW', "Mitglieder autom. benachrichtigen");
+define('RALLYE_EDIT_ONLY_INACTIVE_NOTE', "Es k&ouml;nnen nur deaktivierte Rallyes bearbeitet bzw. gel&ouml;scht werden. Beim L&ouml;schen werden alle dazu verkn&uuml;pften Daten ebenfalls ohne Vorwarnung gel&ouml;scht.");
+define('RALLYE_DELETE_NOTHING_SELECTED', "Keine Rallye(s) zum L&ouml;schen ausgew&auml;hlt!");
+define('RALLYE_DELETED', "Rallye(s) wurde(n) gel&ouml;scht.");
+define('RALLYE_MEMBER_NO_PRICES', "--> Keine Preise ausgesetzt! <--");
+define('RALLYE_MEMBER_PRICES_ADDED', "Die Preise");
+define('RALLYE_PRICE', ". Platz");
+define('RALLYE_MEMBER_NOTIFY', "REF-RALLYE GESTARTET: ");
+define('RALLYE_ADMIN_NOTIFY', "Neue Ref-Rallye: ");
+define('RALLYE_ADMIN_USERS_404', "Zur ausgew&auml;hlten Rallye sind noch keine Mitglieder hinzugef&uuml;gt worden!");
+define('RALLYE_LIST_USERS_1', "Teilnehmende Mitglieder an der Rallye <U>");
+define('RALLYE_LIST_USERS_2', "</U>");
+define('RALLYE_OLD_REFS', "Refs vor Rallye");
+define('RALLYE_NEW_REFS', "Neue Refs");
+define('RALLYE_STOP_AUTO_ADD_NOW', "Auto-Beitreten neuer Mitglieder deaktivieren");
+define('RALLYE_START_AUTO_ADD_NOW', "Auto-Beitreten neuer Mitglieder aktivieren");
+define('RALLYE_GUEST_REFS', "Geworbene Mitglieder");
+define('_RALLYE_PRICE', "Platz");
+define('RALLYE_EXPIRE_ONE_DAY', "Rallye endet in weniger als 24 Stunden!");
+define('RALLYE_HAS_EXPIRED', "Diese Rallye ist beendet.");
+define('RALLYE_ADMIN_EXPIRED', "Rallye beendet");
+define('RALLYE_MEMBER_EXPIRED', "REF-RALLYE BEENDET");
+define('RALLYE_YOU_CAN_WIN', "Was Sie gewinnen k&ouml;nnen");
+define('RALLYE_OUR_WINNERS_ARE', "Unsere Gewinner sind dieses Mal");
+define('RALLYE_PRICE_IS', "Hat gewonnen");
+define('RALLYE_HAPPY_WINNERS', "Wir gratulieren allen Gewinnern!");
+define('RALLYE_ADMIN_PURGED', "Rallye entfernt");
+define('RALLYE_ADMIN_EXPIRED_TEXT', "Eine Referal-Rallye ist beendet worden. Bitte kontrollieren Sie diese und f&uuml;hren Sie ggf. weitere Schritte durch!");
+define('RALLYE_ADMIN_PURGED_TEXT', "Eine oder mehr Referal-Rallye(s) ist/sind gel&ouml;scht worden.");
+define('RALLYE_EDIT_RALLYES', "Rallye-Grunddaten &auml;ndern");
+define('RALLYE_CHANGE_ADMIN', "&Auml;nderungen speichern");
+define('RALLYE_CHANGED', "&Auml;nderungen gespeichert.");
+define('RALLYE_REF_POINTS', "Verdienst durch Refs");
+define('RALLYE_REGISTER_NOW', "Jetzt kostenlos und unverbindlich anmelden!");
+define('RALLYE_GET_REFLINK', "Jetzt dran teilnehmen!");
+define('ADMIN_TASK_IS_RALLYE_EXPIRED', "Rallye wurde beendet");
+define('ADMIN_TASK_IS_RALLYE_PURGED', "Rallye wurde gel&ouml;scht");
+define('RALLYE_LIST_USERS', "Alle teilnehmenden Mitglieder auflisten.");
+define('RALLYE_REF_POINTS_NOTE', "Die {!POINTS!} in der Spalte <U>Verdienst durch Refs</U> geben den Verdienst in erster Ebene vor der Rallye an und wird sich bis Ende der Rallye nicht ver&auml;ndern.");
+define('RALLYE_MIN_USERS', "Gesamtzahl der Mitglieder, ab der Rallye automatisch endet.");
+define('RALLYE_MIN_PRICES', "Mindestens zu belegende Pl&auml;tze");
+define('RALLYE_MIN_USERS_MINI', "Mitgliederanzahl erreicht");
+define('RALLYE_MIN_PRICES_MINI', "Minimum Pl&auml;tze");
+define('RALLYE_END_NO_USER_LIMITATION', "Die Rallye endet ohne Mitgliederbegrenzung.");
+define('RALLYE_END_NO_PRICE_LIMITATION', "Die Rallye endet ohne Platzbelegungsbegrenzung.");
+define('RALLYE_END_USERS_1', "Die Rallye endet, sobald wir");
+define('RALLYE_END_USERS_2', "Mitglieder in unserem {!MT_WORD!} haben!");
+define('RALLYE_END_PRICES_1', "Die Rallye endet, sobald mindestens");
+define('RALLYE_END_PRICES_2', "Plaetze belegt sind!");
+define('RALLYE_LIMITATIONS', "Einschr&auml;nkungen an der Dauer der Rallye");
+define('RALLYE_REMOVE_PRICES', "Rallye-Preis(e) entfernen");
+define('RALLYE_NO_TEMPLATES_FOUND', "Keine Templates gefunden!");
+
+//
+?>
diff --git a/inc/language/refback_de.php b/inc/language/refback_de.php
new file mode 100644 (file)
index 0000000..6b98f61
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/29/2008 *
+ * ===============                              Last change: 09/29/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : refback_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterst&uuml;tzung                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Member language strings
+define('MEMBER_REFBACK_LIST_TITLE_1', "Ref-Back &Uuml;bersicht f&uuml;r Referal-Ebene <u>");
+define('MEMBER_REFBACK_LIST_TITLE_2', "</u> (<u>");
+define('MEMBER_REFBACK_LIST_TITLE_3', "</u>% Ref-Verg&uuml;tung)");
+define('MEMBER_REFBACK_TITLE', "Ref-Back und Referal-&Uuml;bersicht");
+define('MEMBER_REFBACK_NOTE', "Hier k&ouml;nnen Sie in jeder Referal-Ebene jedem von Ihnen geworbenen Mitglied Ref-Back einstellen. Sollte Ihr Referal {!POINTS!} verdienen und diese ihm/ihr nicht direkt gutgeschrieben werden, so erh&auml;lt Ihr Referal die eingestellten Prozente von dem Verdienst aufgebucht, den Sie als Ref-Verdienst erhalten. Unter <strong>{--MEMBER_REFBACK_POINTS--}</strong> sind die {!POINTS!}-Gutschriften durch Ref-Back an das jeweilige Mitglied zu verstehen.");
+define('MEMBER_REFBACK_NO_ENTRIES', "Es gibt technische Probleme mit der Refback-Tabelle. Bitte Support benachrichtigen.");
+define('MEMBER_REFBACK_EDIT_SUBMIT', "Refback einstellen");
+define('MEMBER_REFBACK_COUNTER_1', "In dieser Ebene haben Sie <u>");
+define('MEMBER_REFBACK_COUNTER_2', "</u> Mitglieder geworben.");
+define('MEMBER_REFBACK_REFID', "User-ID (Nickname)");
+define('MEMBER_REFBACK_STATUS', "Referal-Status");
+define('MEMBER_REFBACK_PERCENTS', "Ref-Back Prozente");
+define('MEMBER_REFBACK_POINTS', "Ref-Back Verg&uuml;tung");
+define('MEMBER_REFBACK_EDIT', "Einstellen");
+define('MEMBER_REFBACK_EDIT_TITLE', "Ref-Back f&uuml;r ausgew&auml;hltes Mitglied einstellen:");
+define('MEMBER_REFBACK_DELETED_SUBMIT', "Nicht m&ouml;glich");
+define('MEMBER_REFBACK_DELETED_TITLE', "Einstellen von Ref-Back ist f&uuml;r gel&ouml;schte Mitglieder nicht m&ouml;glich.");
+
+// Error messages for members
+define('MEMBER_REFBACK_ERROR_MESSAGE', "Fehler beim Einstellen des Ref-Backs. Fehlermeldung:<br />\n<u>%s</u>");
+define('MEMBER_REFBACK_ERROR_GENERAL', "Allgemeiner Scriptefehler. Bitte beim Support melden.");
+define('MEMBER_REFBACK_ERROR_NO_MEMBER', "Nur Mitglieder k&ouml;nnen Ref-Backs einstellen.");
+define('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER', "Ung&uuml;ltige ID-Nummer &uuml;bertragen.");
+define('MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE', "Prozentsatz ung&uuml;ltig. 0 bis 100 sind g&uuml;ltige Werte.");
+define('MEMBER_REFBACK_ERROR_ID_MISMATCH', "Die ausgew&auml;hlte Ref-Back ID geh&ouml;rt Ihnen nicht.");
+define('MEMBER_REFBACK_ERROR_NOT_UPDATED', "Ref-Back nicht aktualisiert.");
+define('MEMBER_REFBACK_DONE', "Ref-Back eingestellt. Dieser ist ab jetzt g&uuml;ltig.");
+
+// Subject lines
+define('ADMIN_REFBACK_SUBJECT', "Es wurde Ref-Back eingestellt");
+define('MEMBER_REFBACK_SUBJECT', "F&uuml;r Sie wurde Ref-Back eingestellt");
+
+//
+?>
diff --git a/inc/language/register_de.php b/inc/language/register_de.php
new file mode 100644 (file)
index 0000000..05a1944
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/10/2004 *
+ * ===============                              Last change: 07/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : register_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('REGISTER_MUST_SET_NOTE', "Sind Pflichtangaben, ansonsten erfolgt keine Anmeldung.");
+define('REGISTER_MUST_HEADER', "Pflichtfelder einstellen");
+define('REGISTER_CHANGE_MUST', "Einstellungen &auml;ndern");
+define('REGISTER_FIELD_NAME', "Eingabefeld");
+define('REGISTER_FIELD_REQUIRED', "Pflichtfeld?");
+define('REGISTER_ADMIN_CHANGES_SAVED', "&Auml;nderungen gespeichert.");
+define('REGISTER_SURNAME_REQUIRED', "Bitte geben Sie Ihren Vornamen ein.");
+define('REGISTER_FAMILY_NAME_REQUIRED', "Bitte geben Sie Ihren Nachnamen ein.");
+define('REGISTER_STREET_NR_REQUIRED', "Bitte geben Sie Stra&szlig;e und Hausnummer ein.");
+define('REGISTER_CNTRY_REQUIRED', "Bitte geben Sie den zweistelligen L&auml;ndercode ein.");
+define('REGISTER_ZIP_REQUIRED', "Bitte geben Sie die Postleitzahl ein.");
+define('REGISTER_CITY_REQUIRED', "Bitte geben Sie den Wohnort ein.");
+define('CNTRY', "L&auml;ndercode");
+define('ADMIN_CFG_REGISTER_DEFAULT', "Standart-Vorauswahl in der Kategorienliste einstellen auf Ja/Nein");
+define('ADMIN_CFG_REGISTER_DISPLAY_REFID', "Soll die Ref-ID angezeigt werden? <FONT class=\"admin_note\">(Nein = ID wird editierbar!)</FONT>");
+
+//
+?>
diff --git a/inc/language/removeip_de.php b/inc/language/removeip_de.php
new file mode 100644 (file)
index 0000000..0e18706
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/01/2008 *
+ * ===============                              Last change: 10/01/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : removeip_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_CONFIG_REMOVEIP_TITLE', "Konfiguration zur Anonymit&auml;t/Privatsph&auml;hre");
+define('ADMIN_CONFIG_REMOVEIP_ANON_IP', "IP-Nummer anonymisieren?<br /><span class=\"admin_note\">(Siehe dazu weiter unten)</span>");
+define('ADMIN_CONFIG_REMOVEIP_ANON_HOST', "Hostname anonymisieren?<br /><span class=\"admin_note\">(Dieser wird als <strong>localhost.localnet</strong> ausgegeben.)</span>");
+define('ADMIN_CONFIG_REMOVEIP_ANON_UA', "User-Agent anonymisieren?<br /><span class=\"admin_note\">(Dieser wird als Strich ausgegeben.)</span>");
+define('ADMIN_CONFIG_REMOVEIP_ANON_REF', "Referer anonymisieren?<br /><span class=\"admin_note\">(Dieser wird als Strich ausgegeben.)</span>");
+define('ADMIN_CONFIG_REMOVEIP_ANONYMOUS_IP', "Als was soll die anonymisierte IP-Nummer ausgegeben werden?");
+define('ADMIN_CONFIG_REMOVEIP_LOCAL', "127.0.0.1 (Lokal)");
+define('ADMIN_CONFIG_REMOVEIP_ZERO', "0.0.0.0 (Nicht existierend)");
+define('ADMIN_CONFIG_REMOVEIP_RANDOM', "???.???.???.??? (Pseudozufall)");
+define('ADMIN_CONFIG_REMOVEIP_ADMIN_SHOW', "Im Adminbereich Anonymit&auml;tslevel zeigen?");
+define('ADMIN_CONFIG_REMOVEIP_GUEST_SHOW', "Im Gastbereich Anonymit&auml;tslevel zeigen?");
+define('ADMIN_CONFIG_REMOVEIP_MEMBER_SHOW', "Im Mitgliedsbereich Anonymit&auml;tslevel zeigen?");
+define('ADMIN_CONFIG_REMOVEIP_SPONSOR_SHOW', "Im Sponsorbereich Anonymit&auml;tslevel zeigen?");
+
+// Anonymity levels
+define('REMOVEIP_UNKNOWN_LEVEL', "Unbekannte Anonymit&auml;tslevel <u>%s</u>");
+define('REMOVEIP_LEVEL_NONE', "Keine Anonymit&auml;t");
+define('REMOVEIP_LEVEL_LOW', "Niedrige Anonymit&auml;t");
+define('REMOVEIP_LEVEL_MEDIUM', "Mittlere Anonymit&auml;t");
+define('REMOVEIP_LEVEL_HIGH', "Hohe Anonymit&auml;t");
+
+//
+?>
diff --git a/inc/language/repair_de.php b/inc/language/repair_de.php
new file mode 100644 (file)
index 0000000..da5bdd0
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/24/2004 *
+ * ===============                              Last change: 04/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : repair_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_REPAIR_CATS_NOTHING', "Keine Kategorie-Auswahlenn gefunden! Vermutlich sind keine Mitglieder registriert?");
+define('ADMIN_REPAIR_ENTRIES_FIXED_1', "Es wurden <STRONG>");
+define('ADMIN_REPAIR_ENTRIES_FIXED_2', "</STRONG> Eintr&auml;ge repariert!");
+define('ADMIN_REPAIR_NOTHING_FIXED', "Es wurden keine Eintr&auml;ge repariert!");
+
+//
+?>
diff --git a/inc/language/rewrite_de.php b/inc/language/rewrite_de.php
new file mode 100644 (file)
index 0000000..a8c590f
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2005 *
+ * ===============                              Last change: 02/12/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : rewrite_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('MODULE_NAME', "Modulname");
+define('MODULE_TITLE', "Modultitel");
+define('MODULE_SKIPPED', "Modul wird ausgeblendet");
+define('ADMIN_CONFIG_REWRITE_NOTE', "Stellen Sie hier die Module ein, die von der Rewrite-Engine nicht<br />
+auf die suchmaschienenoptimierten URLs umgeschrieben werden sollen.<br />
+Das Modul <U>admin</U> sollten Sie *KEINES FALLS* aus der Liste enfernen!");
+
+//
+?>
diff --git a/inc/language/sponsor_de.php b/inc/language/sponsor_de.php
new file mode 100644 (file)
index 0000000..902e017
--- /dev/null
@@ -0,0 +1,325 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/02/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : sponsor_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('SPONSOR_NOT_INITIALIZED', "Sponsorenbereich noch nicht eingerichtet!");
+define('ADMIN_CONFIG_SPONSOR_TITLE', "Allgemeine Einstellungen");
+define('ADMIN_SPONSOR_MIN_POINTS', "Minimum buchbare {!POINTS!}");
+define('ADMIN_SPONSOR_REF_POINTS', "Einmalige Referral-Gutschrift bei Vermittlung eines neuen Sponsors");
+define('ADMIN_SPONSOR_ENTER_COMPANY_DATA', "Daten zur anzumeldenen Unternehmen eingeben");
+define('SPONSOR_ENTER_COMPANY_TITLE', "Firmenname");
+define('SPONSOR_ENTER_COMPANY_POSITION', "Position");
+define('SPONSOR_ENTER_TAX_IDENT', "Ust-Ident-Nr.");
+define('ADMIN_SPONSOR_ENTER_PERSONA_DATA', "Daten zur Person (oder bei Unternehmen Kontaktperson)");
+define('ADMIN_SPONSOR_ENTER_CONTACT_DATA', "Kontaktdaten des Sponsors");
+define('SPONSOR_ENTER_STREET_NR1', "Stra&szlig;e mit Hausnummer");
+define('SPONSOR_ENTER_STREET_NR2', "(noch Stra&szlig;e; Zeile 2)");
+define('SPONSOR_ENTER_CNTRY_ZIP_CITY', "L&auml;ndercode, PLZ, Wohnort");
+define('SPONSOR_ENTER_PHONE', "Telefonnummer");
+define('SPONSOR_ENTER_FAX', "Faxnummer");
+define('SPONSOR_ENTER_CELL', "Handynummer");
+define('SPONSOR_ENTER_EMAIL', "EMail-Adresse");
+define('SPONSOR_ENTER_URL', "Homepage-URL");
+define('ADMIN_SPONSOR_ENTER_PASSWORDS', "Passw&ouml;rter eingeben");
+define('SPONSOR_ENTER_PASSWORDS', "Passwort mit -best&auml;tigung");
+define('ADMIN_SPONSOR_WARNINGS_POINTS', "Warnungen und {!POINTS!}");
+define('SPONSOR_RECEIVE_WARNINGS', "Sponsor erh&auml;lt bei jeder Aktion Mails zugesandt");
+define('SPONSOR_WARNING_INTERVAL', "Sendeinterval des Sponsorenberichtes");
+define('SPONSOR_ENTER_POINTS', "Guthaben an {!POINTS!} zum Starten");
+define('ADD_SPONSOR', "Sponsor hinzuf&uuml;gen");
+define('ADMIN_SPONSOR_COMPANY_NOTE', "Wenn Sie eine Privatperson anmelden wollen, lassen Sie bitte die folgenden drei Felder einfach leer!");
+define('SPONSOR_DATA_NOT_SAVED', "Sponsorendaten wurden <U>nicht</U> gespeichert.");
+define('ADMIN_SPONSOR_REALLY_ADD_SPONSOR', "Sponsor existiert bereits!");
+define('ADMIN_SPONSOR_DO_YOU_REALLY_WANT_ADDING', "Ein Sponsor existiert bereits mit der eingegeben EMail-Adresse <B>{!__EMAIL!}</B>. Wollen Sie ihn dennoch hinzuf&uuml;gen?");
+define('ADMIN_SPONSOR_ADDED', "Sponsor wurde hinzugef&uuml;gt.");
+define('ADMIN_SPONSOR_UPDATED', "Sponsordaten wurden aktualisiert.");
+define('ADMIN_SPONSOR_FAILED', "Konnte Daten nichtn speichern!");
+define('ADMIN_SPONSOR_NONE_PENDING', "Kein Sponsorenaccount wartet auf Freischaltung.");
+define('SPONSOR_CREATED', "Angelegt");
+define('SPONSOR_UNLOCK', "Sponsoren freischalten");
+define('ADMIN_SPONSOR_UNLOCK_NOTES', "Wichtig: Schalten Sie nur Sponsoren frei, wenn diese auch bezahlt haben! Das Script wird dann den Status auf <U>Bezahlt</U> setzen.");
+define('ADMIN_SPONSOR_UNLOCK_TITLE', "Sponsorenaccounts freischalten");
+define('ADMIN_SPONSOR_NONE_SELECTED_UNLOCK', "Keinen Sponsor zum Freischalten ausgew&auml;hlt!");
+define('SPONSOR_NO_ADMIN', "Ihrer Bestellung wurde keinem Administrator zugewiesen!");
+define('SPONSOR_NO_PAYMENTS_FOUND', "Keine offenen Bestellungen gefunden!");
+define('ADMIN_SPONSOR_NONE_REGISTERED', "Kein Sponsor hat sich bei Ihnen angemeldet! :-(");
+define('ACCOUNT_PENDING', "Wartend");
+define('ADMIN_LIST_SPONSOR_ACCOUNTS', "Alle Sponsoren auflisten");
+define('SPONSOR_POINTS_LEFT', "Restguthaben");
+define('ADMIN_LIST_SPONSOR_NOTES', "Klicken Sie auf die ID-Nummer, um weitere Details zu sehen und um weitere Aktionen am Sponsorenaccount durchf&uuml;hren zu k&ouml;nnen! Klicken Sie auf das Restguthaben an {!POINTS!}, um dem jeweiligen Sponsor mehr {!POINTS!} aufzubuchen.");
+define('ADMIN_SPONSOR_404_1', "Sponsorenaccount <U>");
+define('ADMIN_SPONSOR_404_2', "</U> nicht gefunden!");
+define('ADMIN_SPONSOR_REFS_404_1', "Der Sponsor <U>");
+define('ADMIN_SPONSOR_REFS_404_2', "</U> hat keine Referrals!");
+define('ADMIN_SPONSOR_DETAILS', "Datenblatt eines Sponsors");
+define('ADMIN_SPONSOR_COMPANY_DATA', "Firmendaten des Sponsors");
+define('ADMIN_SPONSOR_PERSONA_DATA', "Pers&ouml;nliche Daten des Sponsors");
+define('ADMIN_SPONSOR_OTHER_DETAILS', "Sonstige Daten zum Sponsor");
+define('SPONSOR_POINTS_AMOUNT', "Guthaben");
+define('SPONSOR_POINTS_USED', "Verwendet");
+define('SPONSOR_RECEIVE_WARNINGS_SHORT', "Mailbenachrichtigung");
+define('SPONSOR_WARNING_INTERVAL_SHORT', "Benachrichtunsinterval");
+define('ADMIN_LAST_CHANGE', "Letzte &Auml;nderung");
+define('SPONSOR_REFID', "Von Sponsor geworben");
+define('ADMIN_SPONSOR_ACTIONS', "Aktionen am Sponsorenaccount");
+define('SPONSOR_ID', "Sponsor-ID");
+define('SPONSOR_STATUS', "Sponsor-Status");
+define('SPONSOR_REFERRALS', "Sponsoren geworben");
+define('ADMIN_INVALID_MODE_1', "Ung&uuml;tiger Modus <U>");
+define('ADMIN_INVALID_MODE_2', "</U> angegeben!");
+define('ADMIN_TPL_404_1', "Modus-Template <U>");
+define('ADMIN_TPL_404_2', "</U> nicht gefunden!");
+define('ADMIN_ADD_POINTS_TO_SPONSOR', "{!POINTS!} gutschreiben");
+define('ADMIN_SUB_POINTS_FROM_SPONSOR', "{!POINTS!} abziehen");
+define('ADMIN_SUM_SPONSOR_POINTS', "Summe {!POINTS!}");
+define('ADMIN_SPONSOR_ADD_POINTS', "Jetzt gutschreiben");
+define('ADMIN_SPONSOR_SUB_POINTS', "Jetzt abziehen");
+define('ADMIN_SPONSPOR_NO_POINTS_TO_ADD', "Keine {!POINTS!} zum Gutschreiben eingegeben!");
+define('ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT', "Keine {!POINTS!} zum Abziehen eingegeben!");
+define('ADMIN_SPONSOR_POINTS_ADDED', "{!POINTS!} wurden gutgeschrieben.");
+define('ADMIN_SPONSOR_POINTS_SUBTRACTED', "{!POINTS!} wurden abgezogen.");
+define('ADMIN_SPONSPOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS', "Sie k&ouml;nnen keine auf Freischaltung wartende oder unbest&auml;tigte Accounts sperren/freigeben!");
+define('ADMIN_HEADER_DEL_SPONSOR_1', "Sponsorenaccount <U>");
+define('ADMIN_HEADER_DEL_SPONSOR_2', "</U> l&ouml;schen");
+define('ADMIN_TEXT_DEL_SPONSOR_1', "M&ouml;chten Sie den Sponsoren <B>");
+define('ADMIN_TEXT_DEL_SPONSOR_2', "</B> mit samt aller seiner Bestellungen unwiederruflich l&ouml;schen?");
+define('SPONSOR_DELETED_1', "Sponsorenaccount <U>");
+define('SPONSOR_DELETED_2', "</U> entfernt.");
+define('GUEST_SPONSOR_TITLE', "Anmeldung als Sponsor");
+define('GUEST_SPONSOR_TEASER_1', "Melden Sie sich als Sponsor von <STRONG>".MAIN_TITLE."</STRONG> an! Hier bekommen Sie f&uuml;r Ihr Geld die Zielgruppe, die Sie auch auf Ihren Produktseiten haben wollen!");
+define('GUEST_SPONSOR_TEASER_2', "Alles inklusiv: Ausf&uuml;hrliche Statistiken (auch per Mail im gew&uuml;nschten Zeitabstand) und einfache Verwaltung Ihrer {!POINTS!} mit nur wenigen Klicks!");
+define('GUEST_SPONSOR_TEASER_3', "Werden Sie Sponsor und melden Sie sich noch heute an!");
+define('SPONSOR_ENTER_COMPANY_DATA', "Daten zum Unternehmen");
+define('SPONSOR_COMPANY_NOTE', "Sie k&ouml;nnen sich auch als private Person anmelden, lassen Sie dazu die drei folgenden Felder einfach leer!");
+define('SPONSOR_ENTER_PERSONA_DATA', "Daten zu Ihrer Person");
+define('SPONSOR_ENTER_CONTACT_DATA', "Kontaktm&ouml;glichkeiten (mindestens EMail!)");
+define('SPONSOR_WARNINGS', "Mailbenachrichtigungen");
+define('SPONSOR_SELECT_PAYMENT', "Buchungspaket ausw&auml;hlen");
+define('REGISTER_SPONSOR', "Jetzt verbindlich anmelden!");
+define('SPONSOR_PAYMENTS', "Bezahlung der {!POINTS!}");
+define('SPONSOR_NO_ACTIONS_ACTIVATED', "Derzeit sind keine Aktionen im Sponsorenbereich m&ouml;glich!");
+define('SPONSOR_PAYTYPE', "Buchungspaket(e)");
+define('SPONSOR_PAYTYPE_VALUE', "Bestellwert");
+define('SPONSOR_PAYTYPE_COUNT', "Bestellmenge");
+define('GUEST_SPONSOR_RECEIVE_WARNINGS', "Bei Daten&auml;nderung eine Best&auml;tigung per Mail erhalten?");
+define('SPONSOR_ACCEPT_TERMS', "Ich/wir habe/n die [<B><A href=\"".URL."/modules.php?module=index&amp;what=sponsor_agb\" target=\"_blank\">AGBs</A></B>] gelesen und akzeptiert.");
+define('SPONSOR_TERMS_HEADER', "Allgemeine Gesch&auml;ftsbedingungen");
+
+// Add payment types
+define('SPONSOR_ADMIN_NO_PAYTYPES', "Noch keine Buchungspakete eingerichtet!");
+define('ADMIN_ADD_SPONSOR_PAYTYPE_TITLE', "Neue Buchungspaket hinzuf&uuml;gen");
+define('ADMIN_ADD_SPONSOR_PAYTYPE', "Buchungspaket hinzuf&uuml;gen");
+define('SPONSOR_PAYTYPE_NAME', "Bezeichnung");
+define('SPONSOR_PAYTYPE_NAME_HINT', "(max. 255 Zeichen)");
+define('SPONSOR_PAYTYPE_RATE', "Umrechnungsrate");
+define('SPONSOR_PAYTYPE_RATE_HINT', "(z.B. 1 &euro; = x {!POINTS!})");
+define('SPONSOR_PAYTYPE_MIN_COUNT', "Bestellmenge");
+define('SPONSOR_PAYTYPE_CURRENCY', "W&auml;hrung");
+define('SPONSOR_ADD_PAYTYPES_NOTES', "Hinweise zu den Buchungspaketen");
+define('SPONSOR_PAYTYPE_NAME_NOTE', "Geben Sie eine passende Bezeichnung zum Buchungspaket ein (z.B. <B>Spar-Paket</B>)");
+define('SPONSOR_PAYTYPE_RATE_NOTE', "Wie viele {!POINTS!} soll der Sponsor f&uuml;r z.B. 1 &euro; bekommen?");
+define('SPONSOR_PAYTYPE_MIN_COUNT_NOTE', "Und wie oft soll dieses Buchungspaket <B>mindestens</B> eingekauft werden? (meistens einmal)");
+define('SPONSOR_PAYTYPE_CURRENCY_NOTE', "W&auml;hrung des Geldbetrages, die der Sponsor an Sie &uuml;berweisen soll.");
+define('SPONSOR_ADMIN_PAYTYPE_ALREADY_1', "Buchungspaket <U>");
+define('SPONSOR_ADMIN_PAYTYPE_ALREADY_2', "</U> bereits eingerichtet.");
+define('SPONSOR_ADMIN_PAYTYPE_ADDED_1', "Buchungspaket <U>");
+define('SPONSOR_ADMIN_PAYTYPE_ADDED_2', "</U> hinzugef&uuml;gt.");
+define('SPONSOR_LIST_PAYMENT_TYPES_TITLE', "Buchungspakete auflisten, bearbeiten und l&ouml;schen");
+define('SPONSOR_PAYTYPE_MIN_COUNT2', "Minium");
+define('ADMIN_SPONSOR_PAYTYPE_EDIT', "Bearbeiten");
+define('ADMIN_SPONSOR_PAYTYPE_DELETE', "L&ouml;schen");
+define('SPONSOR_EDIT_PAY_ENTRIES', "Buchungspakete editieren");
+define('SPONSOR_DELETE_PAY_ENTRIES', "Buchungspakete l&ouml;schen");
+define('SPONSOR_PAY_ENTRIES_CHANGED', "Buchungspakete ge&auml;ndert.");
+define('SPONSOR_PAY_ENTRIES_REMOVED', "Buchungspakete gel&ouml;scht.");
+define('SPONSOR_PAYMENT_LIST_IS_EMPTY', "Noch keine Buchungspakete eingerichtet!");
+define('ADMIN_SPONSOR_UNKOWN_STATUS_1', "Unbekannter Status <U>");
+define('ADMIN_SPONSOR_UNKOWN_STATUS_2', "</U> wurde bei der Anmeldung zur&uuml;ckgeliefert!");
+define('SPONSOR_REFERRAL', "Sponsoren-Referral");
+define('SPONSOR_REFID_WAS', "Sie wurden vom Sponsor geworben");
+define('SPONSOR_ACCOUNT_IS_PENDING', "EMail-Adresse best&auml;tigt! Sie haben soeben eine EMail mit weiteren Anweisungen erhalten.");
+
+// Header / text / email messages
+define('SPONSOR_LOCK_SPONSOR_HEADER', "Sponsorenaccount sperren");
+define('SPONSOR_UNLOCK_SPONSOR_HEADER', "Sponsorenaccount freigeben");
+define('SPONSOR_LOCK_SPONSOR_TEXT', "Wollen Sie das ausgew&auml;hlte Sponsorenaccount sperren? Falls ja, wird eine Mail an den Sponsor geschickt. Bitte geben Sie auch eine plaubsible Begr&uuml;ndung der Sperrung mit an!");
+define('SPONSOR_UNLOCK_SPONSOR_TEXT', "Wollen Sie das ausgew&auml;hlte Sponsorenaccount freigeben? Falls ja, wird eine Mail an den Sponsor geschickt.");
+define('SPONSOR_ACCOUNT_LOCKED', "Ihr Sponsorenaccount wurde hiermit von einem unserer Administratoren gesperrt. Bitte beachten Sie fuer die Zukunft unsere AGBs!");
+define('SPONSOR_ACCOUNT_UNLOCKED', "Ihr Sponsorenaccount wurde hiermit von einem unserer Administratoren wieder freigegeben. Sie koennen sich mit den alten Logindaten wieder einloggen. Sollten Sie Ihr Passwort vergessen haben, koennen Sie sich unter Sponsoren->Einloggen ein neues zusenden lassen.");
+define('SPONSOR_EMAIL_STREET_NR1', "Strasse mit Hausnummer");
+define('SPONSOR_EMAIL_STREET_NR2', "(noch Strasse; Zeile 2)");
+define('SPONSOR_EMAIL_CNTRY_ZIP_CITY', "Laendercode, PLZ, Wohnort");
+define('SPONSOR_PASS_UNCHANGED', "- Nicht geaendert! -");
+
+// Guest headers
+define('GUEST_SPONSOR_WANT_BECOME_HEADER', "Sie wollen unser Sponsor sein?");
+define('GUEST_SPONSOR_INFOS_PRICING_HEADER', "Hier sind Preise und was Sie f&uuml;r Ihr Geld bekommen!");
+define('GUEST_SPONSOR_PRICING_HEADER', "Unsere Preise sind einfach fair! Schauen Sie selbst:");
+define('GUEST_SPONSOR_ACTIONS_HEADER', "Und das bekommen Sie von uns:");
+
+// Link descriptions
+define('ADMIN_SPONSOR_DETAILS_LINK_TITLE', "Details des Sponsorenaccounts anzeigen");
+define('ADMIN_SPONSOR_EDIT_LINK_TITLE', "Sponsorenaccount &auml;ndern");
+define('ADMIN_SPONSOR_ADD_POINTS_LINK_TITLE', "{!POINTS!} gutschreiben");
+define('ADMIN_SPONSOR_SUB_POINTS_LINK_TITLE', "{!POINTS!} abziehen");
+
+// Performable actions on a sponsor's account
+define('ADMIN_SPONSOR_EDIT', "Sponsor &auml;ndern");
+define('ADMIN_SPONSOR_DEL', "Sponsor l&ouml;schen");
+define('ADMIN_SPONSOR_LOCK', "Sponsoren ent-/sperren");
+define('ADMIN_LIST_SPONSOR_ORDERS', "Bestellungen bearbeiten");
+
+// Subject lines
+define('SPONSOR_UNLOCKED_SUBJ', "Freischaltung Ihres Sponsorenaccounts");
+define('SPONSOR_ADMIN_ADD_POINTS', "Gutschrift durch den Admin!");
+define('SPONSOR_ADMIN_SUB_POINTS', "Abzug durch den Admin!");
+define('SPONSOR_SUBJECT_LOCKED', "HINWEIS: Sperrung Ihres Sponsorenaccounts!");
+define('SPONSOR_SUBJECT_UNLOCKED', "HINWEIS: Freigabe Ihres Sponsorenaccounts!");
+define('SPONSOR_ADMIN_EDIT_SUBJECT', "HINWEIS: Sponsorenaccount geaendert durch Admin!");
+define('SPONSOR_ADMIN_DEL_SUBJECT', "HINWEIS: Sponsorenaccount geloescht durch Admin!");
+define('SPONSOR_PLEASE_CONFIRM_SUBJ', "HINWEIS: Bitte bestaetigen Sie Ihren Account!");
+define('SPONSOR_ACCOUNT_PENDING_SUBJ', "HINWEIS: Ihr Account warten auf Freischaltung!");
+define('ADMIN_NEW_SPONSOR', "Neue Anmeldung eines Sponsors");
+define('SPONSOR_ACTIVATION_LINK_SUBJ', "HINWEIS: Erneute Aussendung Ihres Bestaetigunglinkes!");
+define('SPONSOR_LOST_PASSWORD_SUBJ', "HINWEIS: Ihr neues Passwort");
+define('SPONSOR_ACC_DATA_SUBJ', "HINWEIS: Aenderung Ihrer Daten");
+define('SPONSOR_ACC_EMAIL_SUBJ', "HINWEIS: Bitte neue EMail-Adresse bestaetigen!");
+define('ADMIN_SPONSOR_ACC_EMAIL_SUBJ', "Sponsor hat seine EMail-Adresse geaendert!");
+define('ADMIN_SPONSOR_ACC_DATA_SUBJ', "Sponsor hat seine Daten geaendert!");
+define('ADMIN_SPONSOR_SETTINGS_SUBJ', "Sponsor hat seine Einstellungen geaendert!");
+define('SPONSOR_SETTINGS_SUBJ', "HINWEIS: Aenderung Ihrer Einstellungen");
+
+// Sponsor registration errors
+define('SPONSOR_SURNAME_IS_EMPTY', "Sie haben keinen Vornamen eingegeben!");
+define('SPONSOR_FAMILY_IS_EMPTY', "Sie haben keinen Nachnamen eingegeben!");
+define('SPONSOR_STREET_NR1_IS_EMPTY', "Sie haben keine Stra&szlig;e eingegeben!");
+define('SPONSOR_COUNTRY_IS_EMPTY', "Sie haben nicht den 2-stelligen L&auml;ndercode eingegeben!");
+define('SPONSOR_COUNTRY_IS_INVALID', "Der von Ihnen eingegebene 2-stellige L&auml;ndercode ist nicht korrekt!");
+define('SPONSOR_ZIP_IS_EMPTY', "Sie haben keine Postleitzahl eingegeben!");
+define('SPONSOR_CITY_IS_EMPTY', "Sie haben keinen Wohnort/Firmensitz eingegeben!");
+define('SPONSOR_PHONE_IS_EMPTY', "Sie haben keine Telefonnummer eingegeben!");
+define('SPONSOR_URL_IS_INVALID', "Die von Ihnen eingegebene Homepage-Adresse ist nicht korrekt!");
+define('SPONSOR_URL_IS_EMPTY', "Sie haben keine Homepage-URL eingegeben!");
+define('SPONSOR_EMAIL_IS_INVALID', "Die von Ihnen eingegebene EMail-Adresse ist nicht korrekt!");
+define('SPONSOR_PASSWORD1_EMPTY', "Sie haben kein Passwort eingegeben!");
+define('SPONSOR_PASSWORD2_EMPTY', "Sie haben keine Passwortbest&auml;tigung eingegeben!");
+define('SPONSOR_COMPANY_IS_EMPTY', "Sie haben keine Firmennamen eingegeben!");
+define('SPONSOR_POSITION_IS_EMPTY', "Sie haben keine Position eingegeben!");
+define('SPONSOR_TAX_IDENT_IS_EMPTY', "Sie haben keine Ust-Ident-Nr. eingegeben!");
+define('SPONSOR_REGISTER_SOMETHING_MISSING', "Die Sponsorenanmeldung konnte wegen der folgenden Punkte nicht durchgef&uuml;hrt werden");
+define('SPONSOR_PASSWORDS_MISMATCH', "Die beiden von Ihnen eingegebenen Passw&ouml;rter stimmen nicht &uuml;berein!");
+define('SPONSOR_TERMS_NOT_ACCEPTED', "Bitte akzeptieren Sie unsere [<B><A href=\"".URL."/modules.php?module=index&amp;what=sponsor_agb\" target=\"_blank\">AGBs</A></B>] !");
+define('SPONSOR_NO_PAYTYPE_SELECTED', "Bitte w&auml;hlen Sie noch ein Buchungspaket aus!");
+define('SPONSOR_NO_WARNING_INTERVAL_SELECTED', "Bitte w&auml;hlen Sie noch den Zeitabstand zwischen zwei Sponsorenberichten aus!");
+define('SPONSOR_NO_RECEIVE_WARNINGS_SELECTED', "Bitte w&auml;hlen Sie noch aus, ob Sie bei jeder Aktion Best&auml;tigungsmails empfangen wollen oder nicht!");
+define('SPONSOR_EMAIL_IS_ALREADY_REGISTERED', "Die von Ihnen eingegebene Email-Adresse existiert bereits in unserer Datenbank!");
+define('SPONSOR_ALREADY_FOUND_1', "Ein Sponsor ist bereits mit der Email-Adresse <U>");
+define('SPONSOR_ALREADY_FOUND_2', "</U> bei uns angemeldet!");
+define('SPONSOR_REGISTRATION_FAILED', "Anmeldung ist fehlgeschlagen!");
+define('SPONSOR_REGISTRATION_COMPLETED', "Anmeldung war erfolgreich! Es ist eine Mail zu Ihnen unterwegs, die weitere Anweisungen enth&auml;lt, um die Anmeldung abzuschliessen.");
+define('SPONSOR_UNKOWN_STATUS_1', "Bei der Anmeldung wurde ein unbekannter R&uuml;ckgabewert <U>");
+define('SPONSOR_UNKOWN_STATUS_2', "</U> erkannt. Bitte melden Sie dies dem Betreiber dieses ".MT_WORD2."!<br />Vielen Dank.");
+define('SPONSOR_EMAIL_404_1', "Bei der Anmeldung ist uns ein Fehler unterlaufen: Ihr Sponsor-Account mit der EMail-Adresse <U>");
+define('SPONSOR_EMAIL_404_2', "</U> wurde nicht gefunden!");
+define('SPONSOR_ACCOUNT_404', "Sponsorenaccount nicht gefunden oder Link ist ung&uuml;tig. Oder haben Sie bereits den Best&auml;tigungslink angeklickt?");
+define('SPONSOR_ACCOUNT_PENDING_FAILED', "Bei der Umschaltung Ihres Sponorenaccounts auf <I>Wartend</I> trat ein unerwarteter Fehler auf!");
+define('SPONSOR_ACCOUNT_404_1', "Sponsorenaccount <U>");
+define('SPONSOR_ACCOUNT_404_2', "</U> nicht gefunden!");
+define('SPONSOR_ACCOUNT_FAILED_1', "Sponsorenaccount konnte nicht geladen werden: <U>");
+define('SPONSOR_ACCOUNT_FAILED_2', "</U>");
+define('SPONSOR_ACCOUNT_EMAIL_FAILED', "Konnten Sponsorenaccount nicht freigeben! Bitte benachrichtigen Sie den Support!");
+
+// Login form
+define('SPONSOR_LOGIN_WELCOME', "Willkommen zum Sponsorenlogin");
+define('SPONSOR_ENTER_ID', "Sponsor-ID");
+define('SPONSOR_ENTER_PASSWORD', "Passwort");
+define('SPONSOR_PASSWORD_LOST', "Zugangsdaten zum Sponsorenbereich erneut anfordern");
+define('SPONSOR_ACTIVATION_LINK_LOST', "Best&auml;tigungslink erneut anfordern");
+define('SPONSOR_SEND_ACTIVATION_LINK', "Best&auml;tigungslink anfordern");
+define('SPONSOR_BACK_TO_LOGIN', "Zur&uuml;ck zum Login-Formular");
+define('SPONSOR_ACTIVATION_SUBMIT', "Link erneut anfordern");
+define('SPONSOR_HOWTO_GET_ACTIVATION_LINK', "Geben Sie oben Ihre EMail-Adresse ein, die Sie bei der Anmeldung als Sponsor eingegeben haben. Sollten Sie diese auch nicht mehr wissen, kontaktieren Sie uns bitte.");
+define('SPONSOR_ACTIVATION_LINK_404', "Best&auml;tigungscode nicht aussendbar: Wir konnten entweder Ihren Account nicht finden, oder Sie haben bereits Ihren Account best&auml;tigt oder Sie wurden gesperrt.");
+define('SPONSOR_ACTIVATION_LINK_SENT', "Es ist eine EMail mit Ihrem Best&auml;tigungslink zu Ihnen unterwegs.");
+define('SPONSOR_SEND_LOST_PASSWORD', "Verlorenes Passwort aussenden");
+define('SPONSOR_LOST_PASS_SUBMIT', "Passwort zusenden");
+define('SPONSOR_HOWTO_GET_LOST_PASSWORD', "Geben Sie oben Ihre EMail-Adresse und die dazu geh&ouml;hrige Sponsor-ID ein, die Sie bei der Anmeldung als Sponsor eingegeben haben. Sie erhalten dann umgehnst ein neues Passwort zugesandt. Das alte Passwort k&ouml;nnen wir Ihnen leiter nicht zusenden. Sollten Sie diese Daten auch nicht mehr wissen, kontaktieren Sie uns bitte.");
+define('SPONSOR_LOST_PASSWORD_SENT', "Es ist eine EMail zu Ihnen unterwegs, die Ihr neues Passwort enth&auml;lt.");
+define('SPONSOR_LOST_PASSWORD_404', "Neues Passwort nicht aussendbar: Wir konnten entweder Ihren Account nicht finden, oder Sie haben noch nicht Ihren Account best&auml;tigt oder Sie wurden gesperrt.");
+define('SPONSOR_LOGIN_FAILED_404_WRONG_PASS', "Sponsoren-Account existiert nicht oder falsches Passwort!");
+define('SPONSOR_LOGIN_FAILED_UNCONFIRMED', "Sie haben noch nicht Ihre Email-Adresse best&auml;tigt!");
+define('SPONSOR_LOGIN_FAILED_PENDING', "Ihr Account wartet noch auf Freischaltung durch den Administrator!");
+define('SPONSOR_LOGIN_FAILED_LOCKED', "Ihr Account wurde gesperrt, vermutlich wegen Nichteinhaltung von Regeln!");
+define('SPONSOR_LOGIN_FAILED_EMAIL', "Sie haben Ihre Email-Adresse ge&auml;ndert und diese noch nicht best&auml;tigt!");
+define('SPONSPOR_COOKIE_SETUP_FAILED', "Es konnten keine Cookies gesetzt werden. Bitte Sicherheitseinstellungen in Ihrem Browser &uuml;berpr&uuml;fen!");
+define('SPONSOR_ONLY_AREA_ENTERED', "Sie haben einen Bereich aufgerufen, der nur den Sponsoren vorenthalten ist, die auch bezahlt haben. Bitte kehren Sie zur [&nbsp;<STRONG><A href=\"".URL."/index.php\">Eingangsseite</A></STRONG>&nbsp;] zur&uuml;ck!");
+define('SPONSOR_ACCOUNT_STATUS_FAILED', "Unerwarteter Zustand des Scriptes erreicht! Bitte Support benachrichtigen!");
+define('SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN', "Ihr Sponsorenaccount ist wieder freigegeben! Sie k&ouml;nnen sich nun erneut einloggen!");
+
+// Sponsor area
+define('SPONSOR_NO_MAIN_MENUS_ACTIVE', "Keine Hauptmen&uuml;s aktiviert!");
+define('SPONSOR_NO_SUB_MENUS_ACTIVE', "Keine Untermen&uuml;s aktiviert!");
+define('SPONSOR_CONTENT_404_1', "Konnte das Sponsor-Modul <U>");
+define('SPONSOR_CONTENT_404_2', "</U> auf dem Server nicht finden!");
+define('SPONSOR_WELCOME_TO', "Willkommen zum Sponsorenbereich!");
+define('SPONSOR_PASSWORD_NOTE', "Wollen Sie nur Ihre Daten, aber nicht das Passwort &auml;ndern, geben Sie Ihr aktuelles Passwort unter &quot;{--SPONSOR_ENTER_OLD_PASSWORD--}&quot; ein. Wollen Sie Ihr Passwort &auml;ndern, geben Sie Ihr derzeiges und zweimal das neue Passwort ein.");
+define('SPONSOR_POINTS_OVERVIEW', "Ihre {--POINTS--}-&Uuml;bersicht");
+define('SPONSOR_POINTS_TOTAL', "Gesamtanzahl {--POINTS--}");
+define('SPONSOR_FILL_UP_POINTS', "Jetzt {--POINTS--}-Guthaben auff&uuml;llen...");
+define('SPONSOR_ENTER_OLD_PASSWORD', "Geben Sie Ihr derzeitiges Passwort ein");
+define('SPONSOR_CHANGE_PASSWORD', "Neues Passwort einstellen");
+define('SPONSOR_ACCOUNT_DATA_SAVED', "Ihre Daten wurden gespeichert.");
+define('SPONSOR_ACCOUNT_EMAIL_CHANGED', "Sie haben Ihre EMail-Adresse ge&auml;ndert, Account wurde tempor&auml;r gesperrt. Bitte [<A href=\"".URL."/index.php\">hier klicken</A>], um in den Gastbereich zu gelangen.");
+define('SPONSOR_SETTINGS_HEADER', "Einstellungen Ihres Sponsorenaccounts");
+define('SPONSOR_UNKNOWN_WHAT_1', "Scripte-Fehler: Unbekannte Sponsor-Aktion <U>");
+define('SPONSOR_UNKNOWN_WHAT_2', "</U> erkannt!");
+define('SPONSOR_SETTINGS_SAVED', "Neue Einstellungen gespeichert.");
+
+// Error messages
+define('SPONSOR_NO_MESSAGE_GENERATED', "Fehler bei der Verarbeitung: Keine Nachricht generiert!");
+define('SPONSOR_NO_CURRENT_PASSWORD_ENTERED', "Sie haben Ihr derzeit gespeichertes Passwort nicht eingegeben!");
+define('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB', "Das von Ihnen und das in der Datenbank hinterlegte Passwort stimmen nicht &uuml;berein!");
+define('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH', "Die von Ihnen eingegebenen neuen Passw&ouml;rter stimmen nicht &uuml;berein!");
+define('SPONSOR_PASSWORD_ONE_EMPTY', "Erstes einzugebenes Passwort ist leer!");
+define('SPONSOR_PASSWORD_TWO_EMPTY', "Zweites einzugebenes Passwort ist leer!");
+define('SPONSOR_PASSWORD_TOO_SHORT_1', "Eingegebenes Passwort entspricht nicht der Mindestl&auml;nge von <U>");
+define('SPONSOR_PASSWORD_TOO_SHORT_2', "</U> Zeichen!");
+define('SPONSOR_ACCOUNT_DATA_NOT_SAVED', "Ihre Daten wurden <U>nicht</U> gespeichert!");
+
+//
+?>
diff --git a/inc/language/support_de.php b/inc/language/support_de.php
new file mode 100644 (file)
index 0000000..f3be1f2
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/19/2004 *
+ * ===============                              Last change: 09/19/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : support_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language constans
+define('SUPPORT_SUBJ_ADMIN_ORDER', "[Support:] Mailbuchung");
+define('SUPPORT_SUBJ_ADMIN_REFLINK', "[Support:] Referal-Link");
+define('SUPPORT_SUBJ_ADMIN_UNCONFIRMED', "[Support:] Unbestaetigte Mails");
+define('SUPPORT_SUBJ_MEMBER_ORDER', "Ihr Anfrage an den Support: Mailbuchung");
+define('SUPPORT_SUBJ_MEMBER_REFLINK', "Ihr Anfrage an den Support: Referal-Link");
+define('SUPPORT_SUBJ_MEMBER_UNCONFIRMED', "Ihr Anfrage an den Support: Unbestaetigte Mails");
+define('ADMIN_TASK_IS_SUPPORT_MEMBER', "Mitglieder-Support");
+define('ADMIN_UNKNOWN_SUPPORT_MODE_1', "Unbekannter Support-Modus <STRONG>");
+define('ADMIN_UNKNOWN_SUPPORT_MODE_2', "</STRONG> erkannt!");
+define('ADMIN_TASK_SUPPORT_MODE', "Support-Art");
+
+//
+?>
diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php
new file mode 100644 (file)
index 0000000..294e2c0
--- /dev/null
@@ -0,0 +1,192 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ===============                              Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : surfbar_de.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Configuration strings in admin area
+define('ADMIN_CONFIG_SURFBAR_TITLE', "Konfiguration der Surfbar");
+define('ADMIN_CONFIG_SURFBAR_STATIC_REWARD', "Statische Verg&uuml;tung:");
+define('ADMIN_CONFIG_SURFBAR_STATIC_COSTS', "Statische Kosten:");
+define('ADMIN_CONFIG_SURFBAR_STATIC_TIME', "Statische Verweildauer bis n&auml;chste Seite geladen wird in Sekunden:");
+define('ADMIN_CONFIG_SURFBAR_STATIC_LOCK', "Statische Reload-Sperre (oberes Frame oder ges. Surfbar):");
+define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL', "Verg&uuml;tungsmodel ausw&auml;hlen:");
+define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC', "Statische Werte verwenden.");
+define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC', "Dynamische Werte errechnen.");
+define('ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT', "Prozent auf dynamische Verg&uuml;tung/ Verweildauer/Reload-Sperre:");
+define('ADMIN_CONFIG_SURFBAR_MAX_ORDER', "Maximal durch Mitglied in Surfbar buchbare URLs:");
+define('ADMIN_CONFIG_SURFBAR_RESTART_TIME', "Ruhezeit der Surfbar, wenn alle URLs in Reload-Lock sind:&nbsp;");
+define('ADMIN_CONFIG_SURFBAR_AUTOSTART', "Surfbar soll nach Ruhezeit automatisch starten?");
+define('ADMIN_CONFIG_SURFBAR_STATS_RELOAD', "Reload-Zeit der Statistik unterhalb der beworbenen Seite:");
+define('ADMIN_CONFIG_SURFBAR_PURGE_DELETED', "Verweildauer gel&ouml;schter URLs in der Datenbank:");
+define('ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED', "Verweildauer migrierter URLs in der Datenbank:");
+define('ADMIN_CONFIG_SURFBAR_NOTE', "<strong>Hinweise:</strong>&nbsp;Es wird empfohlen, die Ruhezeit etwas l&auml;nger als die Reload-Sperre einzustellen. Migrierte URLs sind aus Mailbuchungen &uuml;bernommene URLs, die das Mitglied noch best&auml;tigen muss. Werden URLs aus freigeschalteten Mailbuchungen in die Surfbar &quot;migriert&quot; so muss erst das Mitglied der Aufnahme zustimmen. Tut es dies nicht, wird die URL wieder aus der Surfbar entfernt. Eine sofortige Freischaltung ist nicht m&ouml;glich.");
+define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE', "Auf welche Seite soll umgeleitet werden, wenn der User alle gebuchten URLs besucht hat? (Wenn sie also im Reload-Lock sind)");
+define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "Auf interne Pausenseite umleiten.");
+define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "Auf externe Seite umleiten.<br /><span class=\"admin_note\">(Bitte angeben)</span>");
+define('ADMIN_CONFIG_SURFBAR_PAUSE_URL', "Externe Pausenseite (leer lassen, wenn auf interne umgeleitet werden soll)");
+define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf &quot;pausierend&quot; gesetzt sind?");
+define('ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS', "Mitglied warnen, wenn {!POINTS!}-Guthaben unterschritten ist: (0=keine Warnung aussenden)");
+define('ADMIN_CONFIG_SURFBAR_MIGRATE_ORDER', "Sollen URLs aus Mailfreischaltungen in die Surfbar migriert werden?");
+define('ADMIN_CONFIG_SURFBAR_LOW_INTERVAL', "Wiederholungsinterval f&uuml;r Nachrichten wegen niedrigem {!POINTS!}-Guthaben:");
+define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE', "Benachrichtigungen sofort oder beim t&auml;g;lichen Reset aussenden? (&quot;Sofort&quot; kann zu Verz&ouml;gerungen und/oder Belastung des Servers f&uuml;hren!");
+define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', "Sofort aussenden");
+define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_RESET', "Beim t&auml;glichen Reset");
+
+// General admin text
+define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen f&uuml;r die Surfbar eingestellt.<br />\nBitte installieren Sie die Erweiterung <strong>surfbar</strong> neu.");
+define('ADMIN_SURFBAR_ADD_NEW_REFDEPTH', "Neue Referal-Ebene zur Surfbar hinzuf&uuml;gen");
+define('ADMIN_SURFBAR_NO_URLS_FOUND', "Es konnten keine URLs in der Surfbar gefunden werden.");
+define('ADMIN_SURFBAR_REWARD', "Verg&uuml;tung");
+define('ADMIN_SURFBAR_COSTS', "Kosten");
+define('ADMIN_SURFBAR_PAYMENT', "Payment");
+define('ADMIN_SURFBAR_VIEWS_TOTAL', "Gesamtaufrufe");
+define('ADMIN_SURFBAR_STATUS', "URL-Status");
+define('ADMIN_SURFBAR_REGISTERED', "URL aufgenommen");
+define('ADMIN_SURFBAR_LAST_LOCKED', "Zuletzt gesperrt");
+define('ADMIN_SURFBAR_LOCK_REASON', "Sperrgrund");
+define('ADMIN_SURFBAR_EDIT_URL', "URLs &auml;ndern");
+define('ADMIN_SURFBAR_EDIT_URL_NOW', "URLs jetzt &auml;ndern");
+define('ADMIN_SURFBAR_DEL_URL', "URLs l&ouml;schen");
+define('ADMIN_SURFBAR_DEL_URL_NOW', "URLs jetzt entfernen");
+define('ADMIN_SURFBAR_UNDELETE_URL', "L&ouml;schung zur&uuml;cknehmen");
+define('ADMIN_SURFBAR_UNDELETE_URL_NOW', "URLs jetzt wiederherstellen");
+define('ADMIN_SURFBAR_UNLOCK_URL', "URL ent-/sperren");
+define('ADMIN_SURFBAR_LOCK_URL_NOW', "URL jetzt ent-/sperren");
+define('ADMIN_SURFBAR_CONFIRM_URL', "URL(s) freigeben");
+define('ADMIN_SURFBAR_REJECT_URL', "URL(s) ablehnen");
+define('ADMIN_SURFBAR_UNLOCK_DONE', "Freischaltung ausgew&auml;hlter URL(s) vollst&auml;ndig. :-)");
+define('ADMIN_SURFBAR_UNLOCK_FAILED', "Freischaltung fehlgeschlagen. Bitte nachschauen, welche URLs nicht freigegeben wurden.");
+define('ADMIN_SURFBAR_URL_ADDED', "URL wurde der Surfbar hinzugef&uuml;gt.");
+define('ADMIN_SURFBAR_URL_NOT_ADDED', "URL wurde wegen Fehler nicht hinzugef&uuml;gt. Ist die URL bereits vorhanden?");
+define('ADMIN_SURFBAR_ADD_URL', "URL hinzuf&uuml;gen");
+define('ADMIN_BUILD_STATUS_HANDLER', "Status-Handler");
+
+// Admin titles
+define('ADMIN_SURFBAR_LIST_URLS_TITLE', "Surfbar - URLs aufisten");
+define('ADMIN_SURFBAR_DELETE_URLS_TITLE', "Surfbar - URLs entfernen");
+define('ADMIN_SURFBAR_EDIT_URLS_TITLE', "Surfbar - URLs editieren");
+define('ADMIN_SURFBAR_LOCK_URLS_TITLE', "Surfbar - URLs sperren/entsperren");
+define('ADMIN_SURFBAR_UNDELETE_URLS_TITLE', "Surfbar - gel&ouml;schte URLs wiederherstellen");
+
+// Member titles
+define('MEMBER_SURFBAR_LIST_TITLE', "Ihre URLs in der Surfbar verwalten");
+
+// General member text
+define('MEMBER_SURFBAR_URL_ADDED', "URL hinzugef&uuml;gt und wartet auf Freischaltung.");
+define('MEMBER_SURFBAR_URL_NOT_ADDED', "URL konnte nicht hinzugef&uuml;gt werden, da ein Fehler vorliegt.");
+define('MEMBER_SURFBAR_ADD_URL', "URL in Surfbar buchen");
+define('MEMBER_SURFBAR_NO_MORE_ALLOWED', "Sie k&ouml;nnen leider nicht mehr URLs in der Surfbar buchen, da Sie das Maximum erreicht haben.");
+define('MEMBER_SURFBAR_NO_URLS_FOUND', "Sie haben noch keine URLs f&uuml;r die Surfbar gebucht.");
+define('MEMBER_SURFBAR_VIEWS_TOTAL', "Views");
+define('MEMBER_SURFBAR_STATUS', "Anmeldestatus");
+define('MEMBER_SURFBAR_REGISTERED', "Angemeldet");
+define('MEMBER_SURFBAR_LAST_LOCKED', "Letzte Sperre");
+define('MEMBER_SURFBAR_LOCK_REASON', "Sperrgrund");
+define('MEMBER_SURFBAR_ACTIONS', "Aktionen");
+define('MEMBER_SURFBAR_TEST_URL', "URL anzeigen");
+define('MEMBER_SURFBAR_LIST_NOTE', "<strong>Hinweise:</strong> Bitte beachten Sie, dass Editieren, erneutes Aktivieren von gestoppten URLs und nochmalige Anmeldung nach Ablehnung eine Freischaltung durch unsere Administratoren n&ouml;tig ist. Migrierte URLs sind in der Surfbar nicht freigegeben und bedarfen einer Buchungsbest&auml;tigung (&quot;Jetzt buchen&quot; bitte dazu anklicken) Ihrerseits, da die Bewerbung Ihrer URL in der Surfbar zus&auml;tzliche {!POINTS!}-Kosten bedeuten. Die aktuellen Kosten entnehmen Sie bitte der Seite &quot;Surfbar starten&quot; oder &quot;URL buchen&quot; aus dem Surfbar-Mitgliedsmen&uuml;.");
+define('MEMBER_SURFBAR_ACTION_DONE', "Ausgew&auml;hlte Aktion ausgef&uuml;hrt.");
+define('MEMBER_SURFBAR_ACTION_FAILED', "Ausgew&auml;hlte Aktion konnte nicht vollst&auml;ndig ausgef&uuml;hrt werden!");
+define('MEMBER_SURFBAR_UNLIMITED_VIEWS', "Unbegrenzt");
+
+// Subject lines for admins
+define('ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "[Surfbar:] URL hinzugef&uuml;gt durch Admin");
+define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "[Surfbar:] Mitgliedsbuchung einer URL");
+define('ADMIN_SURFBAR_NOTIFY_URL_MIGRATE_SUBJECT', "[Surfbar:] Migrierung einer Mailbuchung");
+define('ADMIN_SURFBAR_NOTIFY_URL_ACTIVE_SUBJECT', "[Surfbar:] Freigabe einer URL");
+define('ADMIN_SURFBAR_NOTIFY_URL_DELETED_SUBJECT', "[Surfbar:] URL gel&ouml;scht");
+define('ADMIN_SURFBAR_NOTIFY_URL_REJECTED_SUBJECT', "[Surfbar:] URL abgelehnt");
+define('ADMIN_SURFBAR_NOTIFY_URL_PENDING_SUBJECT', "[Surfbar:] URL-Buchung zugestimmt");
+define('ADMIN_SURFBAR_NOTIFY_URL_DEPLETED_SUBJECT', "[Surfbar:] URL automatisch angehalten");
+define('ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT', "Problem in Surfbar-Betreff");
+
+// Auto-generated admin subject lines
+define('ADMIN_DEL_SURFBAR_URLS_SUBJECT', "[Surfbar:] URL entfernt");
+define('ADMIN_EDIT_SURFBAR_URLS_SUBJECT', "[Surfbar:] URL ge&auml;ndert");
+define('ADMIN_ACTIVE_SURFBAR_URLS_SUBJECT', "[Surfbar:] Freigabe einer URL");
+define('ADMIN_LOCKED_SURFBAR_URLS_SUBJECT', "[Surfbar:] Sperrung einer URL");
+
+// Subject lines for members
+define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen");
+define('MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Ihre URL in der Surfbar wartet auf Freischaltung");
+define('MEMBER_SURFBAR_NOTIFY_URL_MIGRATE_SUBJECT', "Ihre Mailbuchung wurde in die Surfbar migriert");
+define('MEMBER_SURFBAR_NOTIFY_URL_ACTIVE_SUBJECT', "Ihre URL wurde f&uuml;r die Surfbar freigegeben");
+define('MEMBER_SURFBAR_NOTIFY_URL_DELETED_SUBJECT', "L&ouml;schung Ihrer URL aus der Surfbar");
+define('MEMBER_SURFBAR_NOTIFY_URL_REJECTED_SUBJECT', "Ihre URL wurde f&uuml;r die Surfbar abgelehnt!");
+define('MEMBER_SURFBAR_NOTIFY_URL_PENDING_SUBJECT', "Zustimmung zur URL-Buchung in Surfbar erhalten");
+define('MEMBER_SURFBAR_NOTIFY_URL_DEPLETED_SUBJECT', "Ihre URL wurde automatisch angehalten");
+define('MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT', "[Fehler:] Bitte leiten Sie diese Mail an uns weiter!");
+define('MEMBER_SURFBAR_NOTIFY_LOW_POINTS_SUBJECT', "Ihr {!POINTS!}-Stand ist sehr niedrig!");
+
+// Auto-generated member subject lines
+define('MEMBER_DEL_SURFBAR_URLS_SUBJECT', "Ihre URL wurde aus der Surfbar entfernt");
+define('MEMBER_EDIT_SURFBAR_URLS_SUBJECT', "&Auml;nderung Ihrer URL in der Surfbar");
+define('MEMBER_LOCKED_SURFBAR_URLS_SUBJECT', "Sperrung Ihrer URL in Surfbar, bitte AGBs beachten!");
+define('MEMBER_ACTIVE_SURFBAR_URLS_SUBJECT', "Freigabe Ihrer URL in Surfbar");
+
+// URL status
+define('SURFBAR_URL_STATUS_ACTIVE', "Freigegeben");
+define('SURFBAR_URL_STATUS_LOCKED', "Gesperrt");
+define('SURFBAR_URL_STATUS_PENDING', "Wartend");
+define('SURFBAR_URL_STATUS_STOPPED', "Angehalten");
+define('SURFBAR_URL_STATUS_DEPLETED', "Views ersch&ouml;pft");
+define('SURFBAR_URL_STATUS_REJECTED', "Abgelehnt");
+define('SURFBAR_URL_STATUS_DELETED', "Gel&ouml;scht");
+define('SURFBAR_URL_STATUS_MIGRATED', "Migriert");
+
+// Member actions - submit buttons
+define('MEMBER_SURFBAR_ACTION_RETREAT_SUBMIT', "Zur&uuml;cknehmen");
+define('MEMBER_SURFBAR_ACTION_FRAMETEST_SUBMIT', "Framkiller-Test");
+define('MEMBER_SURFBAR_ACTION_EDIT_SUBMIT', "&Auml;ndern");
+define('MEMBER_SURFBAR_ACTION_DELETE_SUBMIT', "L&ouml;schen");
+define('MEMBER_SURFBAR_ACTION_RESUBMIT_SUBMIT', "Nochmal anmelden");
+define('MEMBER_SURFBAR_ACTION_BOOKNOW_SUBMIT', "Jetzt buchen");
+define('MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT', "Anhalten");
+define('MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT', "Fortfahren");
+
+// Member actions - button titles
+define('MEMBER_SURFBAR_ACTION_RETREAT_TITLE', "Nehmen Sie hiermit Ihre Buchung wieder zur&uuml;ck, falls Sie diese doch nicht bewerben wollten.");
+define('MEMBER_SURFBAR_ACTION_FRAMETEST_TITLE', "Testen Sie die Seite auf Framekiller hin, diese sind in unserer Surfbar grunds&auml;tzlich nicht gestattet.");
+define('MEMBER_SURFBAR_ACTION_EDIT_TITLE', "&Auml;ndern Sie hier Ihre URL, wenn diese nicht stimmen sollte. Allerdings wird Ihre URL dann auf Freischaltung wartend gesetzt, damit wir sie vor Aufnahme nochmals kontrollieren k&ouml;nnen.");
+define('MEMBER_SURFBAR_ACTION_DELETE_TITLE', "L&ouml;schen Sie URLs, die in unserem System nicht mehr beworben werden sollen. Ihre URL wird dann als zu L&ouml;schen markiert und wird dann von uns entg&uuml;ltig gel&ouml;scht. Dies gilt als Vorsichtsma&szlig;nahme.");
+define('MEMBER_SURFBAR_ACTION_RESUBMIT_TITLE', "Melden Sie Ihre URL erneut an, wenn Sie diese an unsere AGBs angepasst haben, wie z.B. Framekiller oder Hardcore/Erotik entfernt. Diese sind bei uns nicht gestattet.");
+define('MEMBER_SURFBAR_ACTION_BOOKNOW_TITLE', "Die URL wurde aus einer Mailbuchung migriert. Hiermit k&ouml;nnen Sie die URL jetzt in der Surfbar buchen.");
+define('MEMBER_SURFBAR_ACTION_PAUSE_TITLE', "Halten Sie die URL in der Surfbar kurz an, wenn sie gerade nicht erreichbar ist. Dies geschieht nicht automatisch.");
+define('MEMBER_SURFBAR_ACTION_UNPAUSE_TITLE', "Lassen Sie die URL in der Surfbar weiterlaufen, wenn Sie dies m&ouml;chten. Wir m&uuml;ssen die URL jedoch erneut freigeben.");
+
+//
+?>
diff --git a/inc/language/task_de.php b/inc/language/task_de.php
new file mode 100644 (file)
index 0000000..24801c6
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/03/2004 *
+ * ===============                              Last change: 12/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : task_de.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('TASK_ADMIN_OVERVIEW_HEADER', "Admin-&Uuml;bersicht zum {!MT_WORD!}-System");
+define('TASK_ADMIN_OVERVIEW_MEMBERS', "Mitglieder&uuml;bersicht");
+define('TASK_ADMIN_OVERVIEW_TASKS', "Task-&Uuml;bersicht");
+define('TASK_ADMIN_OVERVIEW_MAILS', "Mail-&Uuml;bersicht");
+define('TASK_ADMIN_OVERVIEW_EXTRAS', "Extra-&Uuml;bersichten");
+define('TASK_ADMIN_CONFIRMED', "Best&auml;tigt");
+define('TASK_ADMIN_UNCONFIRMED', "Unbest&auml;tigt");
+define('TASK_ADMIN_LOCKED', "Gesperrt");
+define('TASK_ADMIN_NEW_TASKS', "Ohne Zuweisung");
+define('TASK_ADMIN_CLOSED_TASKS', "Geschlossen");
+define('TASK_ADMIN_YOUR_TASKS', "Ihre Aufgaben");
+define('TASK_ADMIN_DELETED_TASKS', "Gel&ouml;scht");
+define('TASK_ADMIN_SOLVED_TASKS', "Erledigt");
+define('TASK_ADMIN_UPDATE_TASKS', "Updates");
+define('TASK_ADMIN_MAIL_ADMIN', "Wartende Mailbuchungen");
+define('TASK_ADMIN_MAIL_TEMP', "Abgebrochene Mailbuchungen");
+define('TASK_ADMIN_MAIL_SEND', "Versendete Mails");
+define('TASK_ADMIN_MAIL_DELETED', "Bereinigte Mails");
+define('TASK_ADMIN_MAIL_BONUS_AP', "Bereinigte Bonus-Mails");
+define('TASK_ADMIN_MAIL_BONUS_SEND', "Versendete Bonus-Mails");
+define('TASK_ADMIN_UNKNOWN_MODE_1', "Unbekannter Modus <U>");
+define('TASK_ADMIN_UNKNOWN_MODE_2', "</U> erkannt!");
+define('ADMIN_OVERVIEW_TASK_YOUR_TYPE', "Ihre zugewiesen Aufgaben (ohne Updates)");
+define('ADMIN_OVERVIEW_TASK_UPDATES_TYPE', "Automatisch durchgef&uuml;hrte Updates");
+define('ADMIN_OVERVIEW_TASK_SOLVED_TYPE', "Ihre erledigten Aufgaben");
+define('ADMIN_OVERVIEW_TASK_UNASSIGNED_TYPE', "Nicht zugewiesene und nicht gel&ouml;schte Aufgaben");
+define('ADMIN_OVERVIEW_TASK_DELETED_TYPE', "Als zu l&ouml;schende markierte Aufgaben");
+define('ADMIN_OVERVIEW_TASK_CLOSED_TYPE', "Ihre geschlossenen Aufgaben");
+define('TASK_ADMIN_DELETE_ENTRIES', "Sofort l&ouml;schen");
+define('TASK_DELETE_MODE_NOTE', "Diese Aufgaben sind zum automatischen L&ouml;schen freigegeben.<br />
+Die automatische L&ouml;schung erfolgt durch die autopurge-Erweiterung.<br />
+Sie k&ouml;nnen die Aufgaben aber auch jetzt endg&uuml;ltig l&ouml;schen!");
+define('TASK_ADMIN_UNKNOWN_LIST_TITLE', "Linktitel nicht gesetzt!");
+
+define('TASK_ADMIN_INACTIVE_AUTOPURGE', "Inaktive Accounts");
+define('TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE', "Es gibt inaktiv gewordene Mitglieder in Ihrem ".MT_WORD."!");
+define('TASK_ADMIN_LIST_PAYOUTS_WAITING', "Wart. Auszahlungen");
+define('TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE', "Es warten Auszahlungsanfragen auf Ihre Bearbeitung!");
+define('TASK_ADMIN_LIST_PAYOUTS_ALL', "Alle Auszahlungen");
+define('TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE', "Es gibt Auszahlungsanfragen!");
+define('TASK_ADMIN_LIST_HOLIDAYS', "Urlaubssanfragen");
+define('TASK_ADMIN_LIST_HOLIDAYS_TITLE', "Einige Ihrer Mitglieder haben Urlaub beantragt!");
+define('TASK_ADMIN_LIST_COUNTRY', "L&auml;ndercodes");
+define('TASK_ADMIN_LIST_COUNTRY_TITLE', "Sie haben L&auml;ndercodes eingerichtet!");
+define('TASK_ADMIN_LIST_DOUBLER_WAITING', "Wart. Verdopplungen");
+define('TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE', "Es warten Vedopplungen auf Verg&uuml;tung!");
+define('TASK_ADMIN_LIST_DOUBLER_ALL', "Alle Verdopplungen");
+define('TASK_ADMIN_LIST_DOUBLER_ALL_TITLE', "In Ihrem ".MT_WORD." wurde verdoppelt!");
+define('TASK_ADMIN_LIST_BONUS', "Aktiv-Rallye-Teilnehmer");
+define('TASK_ADMIN_LIST_BONUS_TITLE', "Es gibt Teilnehmer in Ihrer Aktiv-Rallye!");
+define('TASK_ADMIN_LIST_SPONSOR', "Sponsorenaccounts");
+define('TASK_ADMIN_LIST_SPONSOR_TITLE', "Sie haben Sponsoren in Ihrem ".MT_WORD."!");
+define('TASK_ADMIN_LIST_SPONSOR_PENDING', "Wart. Sponsorenac.");
+define('TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE', "Es warten Sponsorenaccounts auf Ihre Begutachtung wegen Freischaltung!");
+define('TASK_ADMIN_LIST_SPONSOR_CONFIRMED', "Best. Sponsorenac.");
+define('TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE', "Es sind Sponsorenaccounts freigeschaltet.");
+define('TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED', "Unbest. Sponsorenac.");
+define('TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE', "Es m&uuml;ssen Sponsoren noch ihre Accounts best&auml;tigen!");
+define('TASK_ADMIN_LIST_SPONSOR_LOCKED', "Gesprte. Sponsorenac.");
+define('TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE', "Es wurden Sponsorenaccounts gesperrt!");
+define('TASK_ADMIN_LIST_SPONSOR_ORDERS', "Wart. Buch. d. Spons.");
+define('TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE', "Es warten Buchungen Ihrer Sponsoren wegen Annahme/Ablehnung!");
+define('TASK_ADMIN_LIST_THEME_ALL', "Alle inst. Themes");
+define('TASK_ADMIN_LIST_THEME_ALL_TITLE', "Es sind Themes installiert!");
+define('TASK_ADMIN_LIST_THEME_ACTIVE', "Aktivierte Themes");
+define('TASK_ADMIN_LIST_THEME_ACTIVE_TITLE', "Sie haben Themes in Ihrem ".MT_WORD." aktiviert!");
+define('TASK_ADMIN_LIST_ADMINS_ALL', "Administratoren");
+define('TASK_ADMIN_LIST_ADMINS_ALL_TITLE', "Es existieren Administratoren-Accounts in Ihrem Mailtausch!");
+define('TASK_ADMIN_LIST_REFBANNER_ALL', "Alle Referral-Banner");
+define('TASK_ADMIN_LIST_REFBANNER_ALL_TITLE', "Es exisitieren Erweiterungen in Ihrem ".MT_WORD.".");
+define('TASK_ADMIN_LIST_REFBANNER_ACTIVE', "Aktivierte Ref-Banner");
+define('TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE', "Ihre Mitglieder k&ouml;nnen Referral-Banner ausw&auml;hlen!");
+define('TASK_ADMIN_LIST_EXTENSIONS_ALL', "Alle Erweiterungen");
+define('TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE', "Es exisitieren Erweiterungen in Ihrem ".MT_WORD.".");
+define('TASK_ADMIN_LIST_EXTENSIONS_ACTIVE', "Aktivierte Erweit.");
+define('TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE', "Sie haben Erweiterungen aktiviert!");
+define('TASK_ADMIN_LIST_ACCOUNT_NOREF', "Accounts ohne Werber");
+define('TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE', "Es wurden Accounts ohne Werber-ID (refid=0) gefunden!");
+define('TASK_ADMIN_LIST_SURFBAR_URLS_ALL', "Alle URLs in Surfbar");
+define('TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE', "In der Surfbar sind URLs gebucht worden.");
+define('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING', "Wartende URLs in Surfbar");
+define('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE', "Es warten noch URLs auf Freischaltung f&uuml;r die Surfbar");
+
+//
+?>
diff --git a/inc/language/theme_de.php b/inc/language/theme_de.php
new file mode 100644 (file)
index 0000000..82ce511
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/29/2005 *
+ * ===============                              Last change: 05/29/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : theme_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_THEME_NEW_FOUND_TITLE', "Neue Themes gefunden!");
+define('ADMIN_THEME_FILE_CTIME', "Theme erstellt");
+define('ADMIN_THEME_TOTAL_FOUND', "Themes gesamt gefunden");
+define('ADMIN_THEME_ALREADY_INSTALLED_1', "Alle <U>");
+define('ADMIN_THEME_ALREADY_INSTALLED_2', "</U> Themes bereits installiert!");
+define('ADMIN_THEME_NOTHING_FOUND', "Keine Themes auf dem Server gefunden!");
+
+//
+?>
diff --git a/inc/language/top10_de.php b/inc/language/top10_de.php
new file mode 100644 (file)
index 0000000..9bf4337
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/24/2004 *
+ * ===============                              Last change: 11/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : top10_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('TOP10_ADMIN_CONFIG_HEADER', "Einstellungen an TOP-Listen");
+define('TOP10_ADMIN_MAX_TOP10', "Maximale Pl&auml;tze pro Liste");
+define('GUEST_TOP10_LOGIN_HEADER_1', "TOP");
+define('GUEST_TOP10_LOGIN_HEADER_2', "Logins");
+define('GUEST_TOP10_LOGIN_FOOTER', "Diese Liste zeigt Ihnen, wer am h&auml;ufigsten eingeloggt hat.");
+define('TOP10_RANKING', "Platz");
+define('GUEST_TOP10_POINTS_HEADER_1', "TOP");
+define('GUEST_TOP10_POINTS_HEADER_2', "{!POINTS!}-Verdiener");
+define('GUEST_TOP10_POINTS_FOOTER', "Diese Liste zeigt Ihnen, wer die meisten {!POINTS!} verdient hat.");
+define('GUEST_TOP10_REFS_HEADER_1', "TOP");
+define('GUEST_TOP10_REFS_HEADER_2', "Werber");
+define('GUEST_TOP10_REFS_FOOTER', "Diese Liste zeigt Ihnen, wer die meisten Mitglieder geworben hat.");
+
+//
+?>
diff --git a/inc/language/transfer_de.php b/inc/language/transfer_de.php
new file mode 100644 (file)
index 0000000..b08ae72
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/07/2004 *
+ * ===============                              Last change: 11/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : transfer_de.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('ADMIN_CONFIG_TRANSFER_HEADER', "Einstellungen zu {!POINTS!}-&Uuml;berweisungen");
+define('ADMIN_TRANSFER_MAX', "Maximal angezeigte Eintr&auml;ge");
+define('ADMIN_TRANSFER_AGE', "Maximales Alter von Eintr&auml;gen");
+define('ADMIN_TRANSFER_TIMEOUT', "Sperrung der Einstellungen nach {!POINTS!}-&Uuml;berweisung");
+define('ADMIN_TRANSFER_BALANCE', "Restbetrag nach &Uuml;berweisung auf Account");
+define('ADMIN_TRANSFER_CODE', "L&auml;nge des Touring-Codes");
+define('ADMIN_TRANSFER_CODE_NOTE', "<STRONG>0</STRONG> deaktiviert den Touring-Code!");
+define('ADMIN_AUTOPURGE_TRANSFER', "Veraltete Eintr&auml;ge automatisch l&ouml;schen? (purge)");
+define('TRANSFER_LIST_INCOMING', "Eingehende &Uuml;berweisungen");
+define('TRANSFER_LIST_OUTGOING', "Ausgehende &Uuml;berweisungen");
+define('TRANSFER_ALLOW_OPT_IN', "Wollen Sie {!POINTS!}-&Uuml;berweisungen von anderen Mitgliedern erhalten?");
+define('TRANSFER_TO_MEMBER_NOW', "Neue {!POINTS!}-&Uuml;berweisung starten");
+define('TRANSFER_PLEASE_ALLOW_OPT_IN', "Bitte erst Empfangen von &Uuml;berweisungen erlauben!");
+define('TRANSFER_NOW_LINK', "&Uuml;berweisung zum anderen Mitglied t&auml;tigen");
+define('TRANSFER_SELECT_TARGET_UID', "Empf&auml;nger ausw&auml;hlen");
+define('TRANSFER_NO_ONE_ELSE_OPT_IN', "Niemand weiteres m&ouml;chte &Uuml;berweisungen empfangen!");
+define('TRANSFER_POINTS_MAXIMUM', "Maximaler Betrag");
+define('TRANSFER_POINTS_AMOUNT', "Zu &uuml;berweisende {!POINTS!}");
+define('TRANSFER_NO_CODE', "Nicht erforderlich!");
+define('TRANSFER_POINTS_REASON', "Verwendungszweck");
+define('TRANSFER_POINTS_SECURITY_CODE', "Touring-Code eingeben");
+define('TRANSFER_ENTER_PASSWORD', "Ihr Passwort eingeben");
+define('TRANSFER_ADD_NEW', "Transfer abschliessen");
+define('TRANSFER_INVALID_CODE', "Ung&uuml;tigen Touring-Code eingegeben!");
+define('TRANSFER_INVALID_PASSWORD', "Eingegebenes und gespeichertes Passwort stimmen nicht &uuml;berein!");
+define('TRANSFER_INVALID_POINTS', "Kann nicht mehr &uuml;berweisen, als dass Sie an Guthaben haben!");
+define('TRANSFER_INVALID_REASON', "Bitte einen Verwendungszweck eingeben!");
+define('TRANSFER_INVALID_RECIPIENT', "Bitte w&auml;hlen Sie einen Empf&auml;nger aus!");
+define('TRANSFER_INVALID_DATA', "Konnte Absender- und Empf&auml;ngerdaten nicht verifizieren!");
+define('TRANSFER_ADMIN_SUBJECT', "{!POINTS!}-Transfer abgeschlossen");
+define('TRANSFER_MEMBER_RECIPIENT_SUBJ', "{!POINTS!}-Ueberweisung durch Mitglied");
+define('TRANSFER_MEMBER_SENDER_SUBJ', "{!POINTS!}-Ueberweisung an Mitglied");
+define('TRANSFER_ADMIN_AUTOPURGE', "Auto-Loeschung von Transfer-Eintraegen");
+define('TRANSFER_COMPLETED', "&Uuml;berweisung vollst&auml;ndig.");
+define('TRANSFER_CONTINUE_OVERVIEW', "Weiter zur &Uuml;bersichtsseite...");
+define('TRANSFER_LATEST_IS_1', "Einstellung gesperrt, letzte &Uuml;berweisung war am <STRONG>");
+define('TRANSFER_LATEST_IS_2', "</STRONG>");
+define('TRANSFER_LIST_ALL', "Gesamte &Uuml;berweisungsliste anzeigen");
+define('TRANSFER_NO_INCOMING_TRANSFERS', "Keine eingehenden &Uuml;berweisungen gefunden.");
+define('TRANSFER_NO_OUTGOING_TRANSFERS', "Keine ausgehenden &Uuml;berweisungen gefunden.");
+define('TRANSFER_NO_INOUT_TRANSFERS', "Keine &Uuml;berweisungen gefunden.");
+define('TRANSFER_TOTAL_INCOMING', "Gesamteing&auml;nge");
+define('TRANSFER_TOTAL_OUTGOING', "Gesamtausg&auml;nge");
+define('TRANSFER_TOTAL_BALANCE', "Saldo");
+define('TRANSFER_ID', "Trans-ID");
+define('TRANSFER_STAMP', "Buchungstag");
+define('TRANSFER_PARTY', "Empf./Sender");
+define('TRANSFER_FROM_UID', "Sender");
+define('TRANSFER_TO_UID', "Empf&auml;nger");
+define('TRANSFER_TOTAL_SUM', "Gesamt transferierte {!POINTS!}");
+define('TRANSFER_DELETE', "Eintr&auml;ge l&ouml;schen");
+
+//
+?>
diff --git a/inc/language/user_de.php b/inc/language/user_de.php
new file mode 100644 (file)
index 0000000..28aa38b
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/11/2004 *
+ * ===============                              Last change: 12/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : user_de.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('USER_PAGENAV', "Seiten");
+define('RECEIVED_MAILS', "Empfangene Mails");
+define('SENT_MAILS', "Versendete Mails");
+define('USER_ADMIN_CONFIG_HEADER', "Konfiguration - Mitgliederliste");
+define('USER_ADMIN_LIMIT_USER', "Anzahl Mitglieder pro Seite");
+define('USER_ADMIN_ALPHA_USER', "Azanhl Buchstaben pro Zeile");
+define('USER_ACCOUNT_SAVED', "Mitgliedsaccount gespeichert.");
+define('USER_ACCOUNT_NOT_SAVED', "Mitgliedsaccount <U>nicht</U> gespeichert.");
+define('USER_ACCOUNT_LOCKED_1', "Mitgliedsaccount <U>");
+define('USER_ACCOUNT_LOCKED_2', "</U> wurde gesperrt.");
+define('USER_ACCOUNT_UNLOCKED_1', "Mitgliedsaccount <U>");
+define('USER_ACCOUNT_UNLOCKED_2', "</U> wurde freigegeben.");
+
+//
+?>
diff --git a/inc/language/wernis_de.php b/inc/language/wernis_de.php
new file mode 100644 (file)
index 0000000..0efed1d
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ===============                              Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : wernis_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Language definitions
+define('TASK_ADMIN_LIST_WERNIS_ALL', "Alle Wernis-Ein-/Auszahlungen");
+define('TASK_ADMIN_LIST_WERNIS_ALL_TITLE', "Listet alle Wernis-Ein- und Auszahlungen auf.");
+define('MEMBER_WERNIS_MODE_WITHDRAW', "Wernis einzahlen");
+define('MEMBER_WERNIS_MODE_PAYOUT', "Wernis auszahlen");
+define('WERNIS_STATUS_UNKNWOWN', "Wernis-Typ <u>%s</u> unbekannt.");
+define('WERNIS_STATUS_WITHDRAW', "Einzahlung von WDS66");
+define('WERNIS_STATUS_PAYOUT', "Auszahlung an WDS66");
+define('WERNIS_STATUS_FAILED', "Fehlgeschlagen");
+define('WERNIS_TIMESTAMP', "Buchungszeitmarke");
+define('WERNIS_ACCOUNT', "WDS66-Hauptaccount");
+define('WERNIS_TOTAL_WERNIS', "Gesamt &uuml;berwiesen");
+define('WERNIS_MEMBER_LIST_WERNIS', "&Uuml;berweisungsliste von/an WDS66-Hauptaccount");
+
+// Admin messages
+define('WERNIS_ADMIN_CONFIG_TITLE', "Einstellungen zum WDS66-Hauptaccount:");
+define('WERNIS_ADMIN_MIN_PAYOUT', "Minimumguthaben f&uuml;r Auszahlungen.");
+define('WERNIS_ADMIN_MIN_WITHDRAW', "Minimumguthaben f&uuml;r Einzahlungen.");
+define('WERNIS_ADMIN_API_ID', "WDS66-API-ID (api_id=x)");
+define('WERNIS_ADMIN_API_MD5', "WDS66-API-Key (api_md5=xxxxx; 32-stellig)");
+define('WERNIS_ADMIN_API_URL', "Basis-URL der API-Skripte");
+define('WERNIS_ADMIN_REFID', "Ihre Referral-ID bei WDS66-Portal (= Ihr Username!)");
+define('WERNIS_ADMIN_CONFIG_NOTE', "<A href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</A> k&ouml;nnen Sie schon f&uuml;r <strong>5,00&euro;</strong>=<strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> Wernis-Account dennoch n&ouml;tig!) Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von und nach WDS66-Wernis-Portal ben&ouml;tigt. Die Betreibergeb&uuml;hren und Umrechnungsfaktoren sind f&uuml;r den Betrieb Ihres {!MT_WORD2!} komplett in Wernis ausgelegt, diese m&uuml;ssen Sie also noch anpassen, wenn Sie z.B. Punkte haben und in Wernis auszahlen lassen wollen.");
+define('WERNIS_ADMIN_NO_TRANSFERS', "Derzeit keine Wernis transferiert!");
+define('WERNIS_ADMIN_WDS66_ACCOUNT', "Account bei WDS66-Portal");
+define('WERNIS_ADMIN_TRANSFERED', "Wernis transferiert");
+define('WERNIS_ADMIN_TIMESTAMP', "Zeitpunkt &Uuml;berweisung");
+define('WERNIS_ADMIN_TYPE', "&Uuml;berweisungsrichtung");
+define('WERNIS_ADMIN_API_MESSAGE', "Nachricht von WDS66-API");
+define('WERNIS_ADMIN_API_STATUS', "Status von WDS66-API");
+define('WERNIS_ADMIN_PAYOUT_ACTIVE', "Auszahlungen zum WDS66-Portal aktiviert?");
+define('WERNIS_ADMIN_WITHDRAW_ACTIVE', "Einzahlungen vom WDS66-Portal aktiviert?");
+define('WERNIS_ADMIN_PAYOUT_FACTOR', "Umrechnungsfaktor von {!POINTS!} in Wernis f&uuml;r Auszahlungen");
+define('WERNIS_ADMIN_WITHDRAW_FACTOR', "Umrechnungsfaktor von Wernis in {!POINTS!} f&uuml;r Einzahlungen");
+define('WERNIS_ADMIN_PAYOUT_FEE_PERCENT', "Prozentuale Betreibergeb&uuml;hr f&uuml;r Auszahlungen");
+define('WERNIS_ADMIN_WITHDRAW_FEE_PERCENT', "Prozentuale Betreibergeb&uuml;hr f&uuml;r Einzahlungen");
+define('WERNIS_ADMIN_PAYOUT_FEE_FIX', "Fixe Betreibergeb&uuml;hr f&uuml;r Auszahlungen");
+define('WERNIS_ADMIN_WITHDRAW_FEE_FIX', "Fixe Betreibergeb&uuml;hr f&uuml;r Einzahlungen");
+
+// API messages
+define('WERNIS_API_REQUEST_DATA_INVALID', "Interner Fehler: Abfragedaten sind defekt!");
+define('WERNIS_API_REQUEST_DATA_MISSING', "Interner Fehler: Abfragedaten sind nicht komplett!");
+define('WERNIS_API_REQUEST_ERROR', "Abfragefehler: <u>%s</u>");
+define('WERNIS_API_REQUEST_FAILED', "Unbekannter Fehler <u>%s</u> von API erhalten! Bitte im [<A href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</A>], den Fehlercode nennen und wie es dazu gekommen ist.");
+define('WERNIS_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte API-ID und Key &uuml;berpr&uuml;fen. [<A href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</A>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
+define('WERNIS_API_REQUEST_FAILED_USER', "Useraccount nicht gefunden oder Wernis-Passwort ist ung&uuml;ltig!");
+define('WERNIS_API_REQUEST_FAILED_OWN', "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.");
+define('WERNIS_API_REQUEST_FAILED_AMOUNT', "Konto weist nicht gen&uuml;gend Deckung auf.");
+define('WERNIS_API_REQUEST_FAILED_API_AMOUNT', "API-Konto weist nicht gen&uuml;gend Deckung auf.");
+define('WERNIS_API_PURPOSE_WITHDRAW', "Einzahlung auf {!MAIN_TITLE!} ({!URL!}), ID: %s");
+define('WERNIS_API_PURPOSE_PAYOUT', "Auszahlung von {!MAIN_TITLE!} ({!URL!}), ID: %s");
+
+// Error messages
+define('WERNIS_ERROR_STATUS', "Fehler-Status <u>%s</u> erhalten.");
+define('WERNIS_UNKNOWN_ERROR', "Unbekannter Fehler aufgetreten!");
+
+// Member messages
+define('MEMBER_WERNIS_MODE_CHOOSE', "M&ouml;chten Sie Wernis zu Ihrem WDS66-Hauptaccount ausbezahlt bekommen oder Wernis hier einzahlen?");
+define('MEMBER_WERNIS_MODE_CHOOSE2', "Hier klicken um neue &Uuml;berweisung zu starten...");
+define('WERNIS_MEMBER_NO_ACCOUNT', "Noch kein WDS66-Account? Hier entlang!");
+define('WERNIS_MEMBER_API_DATA_MISSING', "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten m&uuml;ssen.");
+define('WERNIS_MEMBER_MIN_PAYOUT', "Sie haben nicht gen&uuml;gend Wernis zum Auszahlen! Mindestens: <u>%s</u> Wernis.");
+define('WERNIS_MEMBER_WITHDRAW_TITLE', "Wernis bei {!MAIN_TITLE!} einzahlen:");
+define('WERNIS_MEMBER_WITHDRAW_POINTS_ACCOUNT', "Wernis hier im Account:");
+define('WERNIS_MEMBER_WITHDRAW_MIN_POINTS', "Mindest einzuzahlendes Wernis-Guthaben:");
+define('WERNIS_MEMBER_WITHDRAW_SUBMIT', "Wernis jetzt einzahlen");
+define('WERNIS_MEMBER_WITHDRAW_NOTE', "Ihr Wernis-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! Ihr WDS66-Konto sollte ausreichend Deckung aufweisen!");
+define('WERNIS_MEMBER_PAYOUT_TITLE', "Wernis auf Ihr WDS66-Hauptaccount auszahlen");
+define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes Wernis-Guthaben");
+define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes Wernis-Guthaben");
+define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
+define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr Wernis-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.");
+define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_PASSWORD', "Wernis-Passwort (nicht Accountpasswort!): [<A href=\"http://www.wds66.com/modules.php?module=wpass&amp;mode=new\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
+define('WERNIS_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <u>%s</u> erkannt! Bitte links im Men&uuml; fortfahren.");
+define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben.");
+define('WERNIS_MEMBER_EMPTY_PASSWORD', "Sieh haben kein Wernis-Passwort eingegeben.");
+define('WERNIS_MEMBER_EMPTY_AMOUNT', "Sie haben keine zu &uuml;berweisende Betrag angegeben.");
+define('WERNIS_MEMBER_INVALID_USERNAME', "Bitte nur Zahlen f&uuml;r den WDS66-Usernamen eingeben!");
+define('WERNIS_MEMBER_INVALID_AMOUNT', "Bitte nur Zahlen f&uuml;r den zu &uuml;berweisenden Betrag eingeben!");
+define('WERNIS_MEMBER_AMOUNT_SMALLER_MIN', "Bitte geben Sie mindestens <u>%s</u> Wernis an!");
+define('WERNIS_MEMBER_WITHDRAW_FAILED', "Die Einzahlung hat nicht geklappt! R&uuml;ckmeldung f&uuml;r den Support: <em>%s</em>.");
+define('WERNIS_MEMBER_WITHDRAW_DONE', "Einzahlung auf Ihr {!MAIN_TITLE!} Konto erfolgreich abgeschlossen. :-)");
+define('WERNIS_MEMBER_PAYOUT_DONE', "Auszahlung auf WDS66-Hauptaccount erfolgreich abgeschlossen. :-)");
+define('WERNIS_MEMBER_PAYOUT_POINTS_DEPLETED', "Sie k&ouml;nnen nicht <u>%s</u> Wernis auszahlen, da Sie nur <u>%s</u> &uuml;brig haben.");
+define('WERNIS_MEMBER_STATUS', "&Uuml;berweisungsart");
+define('WERNIS_MEMBER_PAYOUT_DISABLED', "Auszahlung wurde administrativ deaktiviert.");
+define('WERNIS_MEMBER_WITHDRAW_DISABLED', "Einzahlung wurde administrativ deaktiviert.");
+
+//
+?>
diff --git a/inc/libs/.htaccess b/inc/libs/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php
new file mode 100644 (file)
index 0000000..65325e1
--- /dev/null
@@ -0,0 +1,415 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/30/2003 *
+ * ===============                              Last change: 11/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : admins_functions.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the admins extension               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die admins-Erweiterung           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check ACL for menu combination
+function ADMINS_CHECK_ACL($act, $wht) {
+       global $cacheArray, $_CONFIG, $cacheInstance;
+       // If action is login or logout allow allways!
+       $default = "allow";
+       if (($act == "login") || ($act == "logout")) return true;
+
+       // Default is deny
+       $ret = false;
+
+       // Get admin's defult access right
+       if (!empty($cacheArray['admins']['def_acl'][get_session('admin_login')])) {
+               // Load from cache
+               $default = $cacheArray['admins']['def_acl'][get_session('admin_login')];
+
+               // Count cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!is_object($cacheInstance)) {
+               // Load from database
+               $default = GET_ADMIN_DEFAULT_ACL(get_session('admin_login'));
+       }
+
+       // Get admin's ID
+       $aid = GET_ADMIN_ID(get_session('admin_login'));
+
+       if (!empty($wht)) {
+               // Check for parent menu:
+               // First get it's action value
+               $parent_action = GET_ACTION("admin", $wht);
+
+               // Check with this function...
+               $parent = ADMINS_CHECK_ACL($parent_action, "");
+       } else {
+               // Anything else is true!
+               $parent = false;
+       }
+
+       // Shall I test for a main or sub menu? (action or what?)
+       $lines = 0; $acl_mode = "failed";
+       if (GET_EXT_VERSION("cache") >= "0.1.2") {
+               // Load only from array when there are lines!
+               if ((isset($cacheArray['admin_acls'])) && (is_array($cacheArray['admin_acls'])) && (count($cacheArray['admin_acls']) > 0)) {
+                       // Load ACL from array
+                       foreach ($cacheArray['admin_acls']['admin_id'] as $id => $aid_acls) {
+                               if ($aid == $aid_acls) {
+                                       // Okay, one line was found!
+                                       if ((!empty($act)) && ($cacheArray['admin_acls']['action_menu'][$id] == $act)) {
+                                               // Main menu line found
+                                               $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
+                                               $lines = 1;
+                                       }
+                                        elseif ((!empty($wht)) && ($cacheArray['admin_acls']['what_menu'][$id] == $wht)) {
+                                               // Check sub menu
+                                               $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
+                                               $lines = 1;
+                                       }
+                                       if ($lines == 1) {
+                                               // Count cache hits
+                                               $_CONFIG['cache_hits']++;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       // No ACL found?
+                       if ($acl_mode == "failed") {
+                               $acl_mode = "";
+                               $lines = 0;
+                       }
+               } else {
+                       // No lines here
+                       $lines = 0;
+               }
+       } else {
+               // Old version, so load it from database
+               if (!empty($act))
+               {
+                       // Main menu
+                       $result = SQL_QUERY_ESC("SELECT access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE admin_id=%s AND action_menu='%s' LIMIT 1",
+                        array(bigintval($aid), $act), __FILE__, __LINE__);
+               } elseif (!empty($wht)) {
+                       // Sub menu
+                       $result = SQL_QUERY_ESC("SELECT access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE admin_id=%s AND what_menu='%s' LIMIT 1",
+                        array(bigintval($aid), $wht), __FILE__, __LINE__);
+               }
+
+               // Get number of lines
+               $lines = SQL_NUMROWS($result);
+
+               // Load ACL
+               list($acl_mode) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+       }
+
+       // Check ACL and (maybe) allow
+       if ((($default == "allow") && ($lines == 0)) || (($default == "deny") && ($lines == "1") && ($acl_mode == "allow")) || (($lines == 0) && ($parent))) $ret = true;
+
+       // Return value
+       return $ret;
+}
+
+// Create email link to admins's account
+function ADMINS_CREATE_EMAIL_LINK($email, $mod="admin") {
+       $locked = " AND status='CONFIRMED'";
+       if (IS_ADMIN()) $locked = "";
+       if (strpos("@", $email) > 0) {
+               // Create email link
+               $result = SQL_QUERY_ESC("SELECT id
+FROM "._MYSQL_PREFIX."_admins
+WHERE email='%s'".$locked." LIMIT 1",
+ array($email), __FILE__, __LINE__);
+
+               // Is there an entry?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load userid
+                       list($uid) = SQL_FETCHROW($result);
+
+                       // Rewrite email address to contact link
+                       $email = URL."/modules.php?module=".$mod."&amp;what=user_contct&amp;u_id=".bigintval($uid);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } elseif (bigintval($email) > 0) {
+               // Direct ID given
+               $email = URL."/modules.php?module=".$mod."&amp;what=admins_contct&amp;admin=".bigintval($email);
+       }
+
+       // Return rewritten (?) email address
+       return $email;
+}
+
+// Change a lot admin account
+function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
+       global $cacheInstance;
+
+       // Begin the update
+       $cache_update = 0;
+       foreach ($POST['login'] as $id => $login) {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // When both passwords match update admin account
+               if ($POST['pass1'][$id] == $POST['pass2'][$id]) {
+                       // Save only when both passwords are the same (also when they are empty)
+                       $ADD = ""; $cache_update = "1";
+
+                       // Generate hash
+                       $hash = generateHash($POST['pass1'][$id]);
+
+                       // Save password when set
+                       if (!empty($POST['pass1'][$id])) $ADD = sprintf(", password='%s'", SQL_ESCAPE($hash));
+
+                       // Get admin's ID
+                       $salt = substr(GET_ADMIN_HASH(get_session('admin_login')), 0, -40);
+                       $aid = GET_ADMIN_ID(get_session('admin_login'));
+
+                       // Rewrite cookie when it's own account
+                       if ($aid == $id) {
+                               // Set timeout cookie
+                               set_session("admin_last", time());
+
+                               if ($login != get_session('admin_login')) {
+                                       // Update login cookie
+                                       set_session("admin_login", $login);
+
+                                       // Update password cookie as well?
+                                       if (!empty($ADD)) set_session("admin_md5", $hash);
+                               } elseif (generateHash($POST['pass1'][$id], $salt) != get_session('admin_md5')) {
+                                       // Update password cookie
+                                       set_session("admin_md5", $hash);
+                               }
+                       } // END - if
+
+                       // Get default ACL from admin to check if we can allow him to change the default ACL
+                       $default = GET_ADMIN_DEFAULT_ACL(get_session('admin_login'));
+
+                       // Update admin account
+                       if ($default == "allow") {
+                               // Allow changing default ACL
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET
+login='%s'".$ADD.",
+email='%s',
+default_acl='%s',
+la_mode='%s'
+WHERE id=%s LIMIT 1",
+ array(
+       $login,
+       $POST['email'][$id],
+       $POST['mode'][$id],
+       $POST['la_mode'][$id],
+       $id
+), __FILE__, __LINE__);
+                       } else {
+                               // Do not allow it here
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET
+login='%s'".$ADD.",
+email='%s',
+la_mode='%s'
+WHERE id=%s LIMIT 1",
+ array(
+       $login,
+       $POST['email'][$id],
+       $POST['la_mode'][$id],
+       $id
+), __FILE__, __LINE__);
+                       }
+
+                       // Purge cache
+                       CACHE_PURGE_ADMIN_MENU($id);
+
+                       // Admin account saved
+                       $MSG = ADMIN_ACCOUNT_SAVED;
+               } else {
+                       // Passwords did not match
+                       $MSG = ADMINS_ERROR_PASS_MISMATCH;
+               }
+
+               // Display message
+               if (!empty($MSG)) {
+                       LOAD_TEMPLATE("admin_settings_saved", false, "<SPAN class=\"admin_done\">".$MSG."</SPAN>");
+               }
+       }
+
+       // Remove cache file
+       if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) {
+               if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+       }
+}
+
+// Make admin accounts editable
+function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) {
+       // Begin the edit loop
+       $SW = 2; $OUT = "";
+       foreach ($POST['sel'] as $id => $sel) {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // Get the admin's data
+               $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                array($id), __FILE__, __LINE__);
+               if ((SQL_NUMROWS($result) == 1) && ($sel == 1)) {
+                       // Entry found
+                       $content = SQL_FETCHARRAY($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare some more data for the template
+                       $content['sw'] = $SW;
+                       $content['id'] = $id;
+
+                       // Shall we allow changing default ACL?
+                       if ($content['mode'] == "allow") {
+                               // Allow chaning it
+                               $content['mode']    = ADD_OPTION_LINES("/ARRAY/", array("allow", "deny"), array(ADMINS_ALLOW_MODE, ADMINS_DENY_MODE), $content['mode']);
+                       } else {
+                               // Don't allow it
+                               $content['mode'] = "&nbsp;";
+                       }
+                       $content['la_mode'] = ADD_OPTION_LINES("/ARRAY/", array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_edit_admins_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__ADMINS_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_edit_admins");
+}
+
+// Delete given admin accounts
+function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
+       // Check if this account is the last one which cannot be deleted...
+       $result_main = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_admins", __FILE__, __LINE__);
+       $accounts = SQL_NUMROWS($result_main);
+       SQL_FREERESULT($result_main);
+       if ($accounts > 1) {
+               // Delete accounts
+               $SW = 2; $OUT = "";
+               foreach ($POST['sel'] as $id => $sel) {
+                       // Secure ID number
+                       $id = bigintval($id);
+
+                       // Get the admin's data
+                       $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                        array($id), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1) {
+                               // Entry found
+                               $content = SQL_FETCHARRAY($result);
+                               SQL_FREERESULT($result);
+                               $eval = "\$content['mode'] = ADMINS_".strtoupper($content['mode'])."_MODE;";
+                               eval($eval);
+                               $eval = "\$content['la_mode'] = ADMINS_".strtoupper($content['la_mode'])."_LA_SETTING;";
+                               eval($eval);
+
+                               // Prepare some more data
+                               $content['sw'] = $SW;
+                               $content['id'] = $id;
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_del_admins_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+               }
+               define('__ADMINS_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_del_admins");
+       } else {
+               // Cannot delete last account!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_CANNOT_DELETE_LAST);
+       }
+}
+
+// Remove the given accounts
+function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
+       // Begin removal
+       $cache_update = 0;
+       foreach ($POST['sel'] as $id => $del) {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // Delete only when it's not your own account!
+               if (($del == 1) && (GET_ADMIN_ID(get_session('admin_login')) != $id)) {
+                       // Rewrite his tasks to all admins
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin=0 WHERE assigned_admin=%s",
+                        array($id), __FILE__, __LINE__);
+
+                       // Remove account
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                        array($id), __FILE__, __LINE__);
+
+                       // Purge cache
+                       CACHE_PURGE_ADMIN_MENU($id);
+                       $cache_update = "1";
+               }
+       }
+
+       // Remove cache if cache system is activated
+       if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) {
+               if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+       }
+}
+
+// List all admin accounts
+function ADMINS_LIST_ADMIN_ACCOUNTS() {
+       // Select all admin accounts
+       $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM "._MYSQL_PREFIX."_admins ORDER BY login ASC", __FILE__, __LINE__);
+       $SW = 2; $OUT = "";
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Compile some variables
+               $eval = "\$content['mode'] = ADMINS_".strtoupper($content['mode'])."_MODE;";
+               eval($eval);
+               $eval = "\$content['la_mode'] = ADMINS_".strtoupper($content['la_mode'])."_LA_SETTING;";
+               eval($eval);
+
+               // Prepare some more data
+               $content['sw']         = $SW;
+               $content['email_link'] = CREATE_EMAIL_LINK($content['id']);
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_list_admins_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__ADMINS_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_list_admins");
+}
+
+//
+?>
diff --git a/inc/libs/autopurge_functions.php b/inc/libs/autopurge_functions.php
new file mode 100644 (file)
index 0000000..7305ba5
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/30/2004 *
+ * ===============                              Last change: 08/09/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : autopurge_functions.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktionen                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+function AUTOPURGE_ADD_POINTS($uid, $points)
+{
+       global $jackpot;
+       // Check if he has locked points or not
+       $result = SQL_QUERY_ESC("SELECT ref_payout FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($uid)), __FILE__, __LINE__);
+       list($payout) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+       if (($payout > 0) && (!empty($payout)))
+       {
+               // Yes, he has.
+               $target = "locked_points";
+       }
+        elseif ($payout == "0")
+       {
+               // No, he has not
+               $target = "points";
+       }
+       // Add points...
+       if (empty($payout))
+       {
+               // ... to jackpot account
+               ADD_JACKPOT($points);
+               if (empty($jackpot)) $jackpot = 0;
+               $jackpot += $points;
+       }
+        else
+       {
+               // .. to user's account
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1",
+                array($target, $target, $points, bigintval($uid)), __FILE__, __LINE__);
+
+               // Update mediadata as well
+               if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($target == "points"))
+               {
+                       // Update database
+                       MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points);
+               }
+
+               // Send out mail to user
+               $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_points", TRANSLATE_COMMA($points), $uid);
+               SEND_EMAIL($uid, AUTOPURGE_MEMBER_SUBJECT, $msg);
+       }
+}
+
+//
+?>
diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php
new file mode 100644 (file)
index 0000000..1404119
--- /dev/null
@@ -0,0 +1,249 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/10/2004 *
+ * ===============                              Last change: 03/18/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : bonus_functions.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for bonus extension            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer bonus-Erweiterung        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// This function must be run *BEFORE* a link is removed from table 'mxchange_user_links' !
+function BONUS_ADD_TURBO_POINTS($mid, $uid, $type)
+{
+       global $_CONFIG;
+
+       // Shall we add bonus points?
+       if ($_CONFIG['bonus_active'] == "N") return;
+
+       // Select SQL command
+       $SQL = "";
+       switch ($type)
+       {
+       case "bonusid":
+               $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+                array($mid), __FILE__, __LINE__);
+               $bonus = $mid; $mail = 0;
+               break;
+
+       case "mailid" :
+               $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
+                array($mid), __FILE__, __LINE__);
+               $bonus = 0; $mail = $mid;
+               break;
+       }
+
+       // Load clicks from table as current rank
+       list($rank) = SQL_FETCHROW($result);
+
+       if ($rank == 1)
+       {
+               // First rank!
+               $rank = 1;
+               $points = $_CONFIG['turbo_bonus'];
+       }
+        else
+       {
+               // Anything else so let's explode all entered rank points
+               $test = explode(";", $_CONFIG['bonus_ranks']);
+               if (!empty($test[$rank - 2]))
+               {
+                       // Level found
+                       $points = $test[$rank - 2];
+               }
+                else
+               {
+                       // Level not found!
+                       $points = "0.00000";
+               }
+       }
+
+       // Add points to his account directly
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET turbo_bonus=turbo_bonus+".$points." WHERE userid=%s LIMIT 1",
+        array(bigintval($uid)), __FILE__, __LINE__);
+
+       // Rember this whole data for displaying ranking list
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus_turbo (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '".$rank."', '".$points."', UNIX_TIMESTAMP())",
+        array(bigintval($uid), bigintval($mail), bigintval($bonus)), __FILE__, __LINE__);
+
+       if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points);
+}
+//
+function BONUS_MAKE_RANK_ROWS($data, $type, $uid)
+{
+       global $_CONFIG;
+       $self = false; $OUT = "";
+
+       // How many ranks do we have?
+       $ranks = sizeof(explode(";", $_CONFIG['bonus_ranks'])) + 1;
+
+       // Load current user's data
+       $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND userid=%s LIMIT 1",
+        array($type, $data, $uid), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Load data
+               list($rank, $points, $mark) = SQL_FETCHROW($result);
+
+               // Remember all values for later use
+               $self  = true; $points = TRANSLATE_COMMA($points);
+
+               // Transfer data to template
+               define('__YR_LEVEL' , $rank);
+               define('__YR_POINTS', $points);
+               define('__YR_TMARK' , MAKE_DATETIME($mark, "1"));
+
+               // Load template
+               define('__YOUR_RANKING_LINE', LOAD_TEMPLATE("show_bonus_yr", true));
+       }
+
+       // Load rankings
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s ORDER BY level LIMIT %s",
+        array($type, $data, $_CONFIG['bonus_lines']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Start generating the ranking list
+               $max = SQL_NUMROWS($result);
+
+               $SW = 2;
+               for ($rank = 1; $rank <= $max; $rank++)
+               {
+                       // Load data
+                       $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND level='%s' LIMIT 1",
+                        array($type, $data, $rank), __FILE__, __LINE__);
+                       list($userid, $points, $mark) = SQL_FETCHROW($result_users);
+
+                       // Are you one of them?
+                       if (empty($userid))
+                       {
+                               // Nothing found
+                               $userid = "---"; $points = "---";
+                       }
+                        else
+                       {
+                               // Translate comma
+                               $points = TRANSLATE_COMMA($points);
+                       }
+
+                       // Output row
+                       $OUT .= "<TR>
+  <TD class=\"bonus_rank_".$rank." bottom2 switch_sw".$SW."\">&nbsp;".$rank.".</TD>
+  <TD class=\"bonus_rank_".$rank." bottom2 switch_sw".$SW."\" align=\"center\">".$userid."</TD>
+  <TD class=\"bonus_rank_".$rank." bottom2 switch_sw".$SW."\" align=\"center\">".$points."</TD>
+</TR>\n";
+                       $SW = 3 - $SW;
+               }
+               if (!$self)
+               {
+                       // If current user was not found set constant
+                       define('__YOUR_RANKING_LINE', BONUS_RANK_YOU_ARE_NOT_FOUND);
+               }
+       }
+        else
+       {
+               // No entries found!
+               $OUT = "<TR>
+  <TD colspan=\"3\" align=\"center\" height=\"30\" class=\"bottom2\">
+    <STRONG class=\"guest_failed\">".BONUS_NO_RANKS_1.$data.BONUS_NO_RANKS_2."</STRONG>
+  </TD>
+</TR>\n";
+               define('__YOUR_RANKING_LINE', "");
+       }
+       return $OUT;
+}
+//
+function BONUS_POINTS_HANDLER($MODE)
+{
+       global $_CONFIG;
+
+       // Shall we add bonus points?
+       if ($_CONFIG['bonus_active'] == "N") return;
+
+       // Switch to jackpot-mode when no UID is supplied but userid-mode is selected
+       if (($_CONFIG['bonus_mode'] == "UID") && ($_CONFIG['bonus_uid'] == "0")) $_CONFIG['bonus_mode'] = "JACKPOT";
+
+       if ($MODE == "login_bonus")
+       {
+               // Login bonus detected
+               $points = $_CONFIG['login_bonus'];
+       }
+        else
+       {
+               // Direct points supplied
+               $points = $MODE;
+       }
+
+       // Subtract points from...
+       switch ($_CONFIG['bonus_mode'])
+       {
+       case "JACKPOT": // ... jackpot
+               if ((SUB_JACKPOT($points) == -1) && ($_CONFIG['bonus_uid'] > 0))
+               {
+                       // Check points amount first...
+                       $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points");
+                       if ($TOTAL >= $points)
+                       {
+                               // Subtract points from userid's account
+                               SUB_POINTS($_CONFIG['bonus_uid'], $points);
+                       }
+               }
+               break;
+
+       case "UID": // ... userid's account
+               // Check his amount first
+               $TOTAL = GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_points", "points") - GET_TOTAL_DATA($_CONFIG['bonus_uid'], "user_data", "used_points");
+               if ($TOTAL >= $points)
+               {
+                       // Subtract points from userid's account
+                       SUB_POINTS($_CONFIG['bonus_uid'], $points);
+               }
+                else
+               {
+                       // Try to subtract from jackpot
+                       $dummy = SUB_JACKPOT($points);
+               }
+               break;
+       }
+}
+//
+function BONUS_PURGE_EXPIRED_TURBO_BONUS()
+{
+       global $_CONFIG;
+       // Remove entries
+       $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus_turbo WHERE timemark < (UNIX_TIMESTAMP() - ".$_CONFIG['bonus_timeout'].")", __FILE__, __LINE__);
+       if (SQL_AFFECTEDROWS() > 0) {
+               // Send out email to admin
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", $DELETED, "");
+       }
+}
+//
+?>
diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php
new file mode 100644 (file)
index 0000000..ba490d5
--- /dev/null
@@ -0,0 +1,391 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2003 *
+ * ===============                              Last change: 10/11/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : admins_functions.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the admins extension               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die admins-Erweiterung           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Caching class
+class mxchange_cache
+{
+       // Define variables
+       var $update_interval = 0;
+       var $ret = "init";
+       var $cache_path = "";
+       var $cache_inc = "";
+       var $cache_ctime = 0;
+       var $cache_pointer = false;
+       var $cache_data = "";
+       var $cache_version = "";
+
+       // Constructor
+       function mxchange_cache($interval, $path, $tested) {
+               // Failed is the default
+               $this->ret = "failed";
+
+               // Remember interval in class
+               $this->update_interval = $interval;
+
+               // Remeber path
+               $this->cache_path = $path;
+
+               // Check if path exists
+               if ((is_dir($path)) && (!$tested)) {
+                       // Check if we can create a file inside the path
+                       @touch($path."dummy.tmp", 'w');
+                       if (FILE_READABLE($path."dummy.tmp")) {
+                               // Yes, we can do. So let's remove it
+                               @unlink($path."dummy.tmp");
+
+                               // Is there a .htaccess file?
+                               if (FILE_READABLE($path.".htaccess")) {
+                                       // Update database that we have tested it
+                                       UPDATE_CONFIG("cache_tested", 1);
+
+                                       // All done!
+                                       $this->ret = "done";
+                               } else {
+                                       // Stop! Set a .htaccess file first
+                                       $this->ret = "htaccess";
+                               }
+                       }
+               } elseif ($tested) {
+                       // System already tested
+                       $this->ret = "done";
+               }
+       }
+
+       function cache_file($file, $ignore_ctime=false) {
+               global $INC;
+               // Construct FQFN (full qualified file name)
+               $inc = $this->cache_path.$file.".cache";
+
+               // Rember it + filename in class
+               $this->cache_inc = $inc;
+
+               // Check if file exists
+               $status = (FILE_READABLE($inc) && (is_writeable($inc)));
+               if ($status) {
+                       // Yes, it does. So let's get it's last changed date/time
+                       $ctime = filectime($inc);
+               } else {
+                       // No, it doesn't. Zero date/time
+                       $ctime = 0;
+               }
+
+               // Remember change date/time in class
+               $this->cache_ctime = $ctime;
+
+               // Is the cache file outdated?
+               if (((time() - $ctime) >= $this->update_interval) && (!$ignore_ctime)) {
+                       // Ok, we need an update!
+                       $status = false;
+               }
+
+               // Return status
+               return $status;
+       }
+
+       function cache_init($array) {
+               // This will destory an existing cache file!
+               if ($this->ret == "done") {
+                       // Create file
+                       if (FILE_READABLE($this->cache_inc)) @chmod($this->cache_inc, 0666);
+                       $fp = @fopen($this->cache_inc, 'w') or mxchange_die("Cannot write to cache ".$this->cache_inc." !");
+
+                       // Begin of cache file
+                       fwrite($fp, "\$ARRAY = \"".$array."\";\n\n");
+
+                       // Remember file pointer
+                       $this->cache_pointer = $fp;
+               } else {
+                       // Cannot create file
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function add_row ($data) {
+               global $cacheArray;
+
+               if (is_resource($this->cache_pointer)) {
+                       // Write every array element to cache file
+                       foreach ($data as $k => $v) {
+                               // Write global cache array for immediate access
+                               if ((substr($k, 0, 4) == "ext_") && (isset($data['ext_name'])) && (isset($data['ext_id']))) {
+                                       if ($k != "ext_name") {
+                                               $cacheArray['extensions'][$k][$data['ext_name']] = $v;
+                                       } else {
+                                               $cacheArray['extensions'][$k][$data['ext_id']] = $v;
+                                       }
+                                       if (($k == "ext_keep") && ($v == "Y")) {
+                                               $cacheArray['active_extensions'][$data['ext_name']] = $v;
+                                       } // END - if
+                               } elseif (is_array($v)) {
+                                       // Serialize and BASE64-encode the array
+                                       $v = base64_encode(serialize($v));
+                               }
+
+                               // Write cache line to file
+                               @fwrite($this->cache_pointer, $this->add_raw_row($k, $v));
+                       }
+               } else {
+                       // Cannot create file
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function cache_close()
+       {
+               // Quit function when no pointer is set
+               if (empty($this->cache_pointer)) return;
+               if ($this->cache_pointer)
+               {
+                       // Close file add destroy handler
+                       @fclose($this->cache_pointer);
+
+                       // Set rights
+                       if (FILE_READABLE($this->cache_inc)) @chmod($this->cache_inc, 0666);
+
+                       // Remove pointer
+                       unset($this->cache_pointer);
+               }
+               else
+               {
+                       // Cannot create file
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function cache_load() {
+               // Is the cache file there?
+               if (FILE_READABLE($this->cache_inc)) {
+                       // Prepare temporary array
+                       $data = array();
+                       $cache_version = null;
+
+                       // Load cache file
+                       $this->cache_data = implode("", file($this->cache_inc));
+
+                       // Execute cache file
+                       eval($this->cache_data);
+
+                       if (is_array($data)) {
+                               // Cache data
+                               $this->cache_data = $data;
+
+                               // Cache version found?
+                               if ((isset($cache_version)) && (is_array($cache_version))) {
+                                       // Remember it as well...
+                                       $this->cache_version = $cache_version;
+                               } // END - if
+
+                               // Return cache
+                               return $this->cache_data;
+                       } else {
+                               // Cache problem detected!
+                               $this->cache_destroy();
+                       }
+               } else {
+                       // Cache file not found or not readable
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_LOAD_1.$this->cache_inc.CACHE_CANNOT_LOAD_2);
+               }
+       }
+
+       // Destroy an existing cache file
+       function cache_destroy() {
+               // Is the cache file there?
+               if (FILE_READABLE($this->cache_inc)) {
+                       // Remove cache file from system
+                       @unlink($this->cache_inc);
+                       if (!FILE_READABLE($this->cache_inc)) {
+                               // Close cache automatically (we don't need it anymore!)
+                               $this->cache_close();
+                       } else {
+                               // Not removed!
+                               ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
+                       }
+               } else {
+                       // Does not exist!
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_UNLINK_1.$this->cache_inc.CACHE_CANNOT_UNLINK_2);
+               }
+       }
+
+       function cache_remove($search, $data, $array)
+       {
+               global $ARRAY;
+               if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc))) {
+                       // Load cache into dummy array
+                       $dummy = $this->cache_load();
+
+                       // Search for key in array
+                       $key = array_search($data, $dummy[$search]);
+                       if (!empty($key)) {
+                               // Key (hopefully) found?
+                               foreach ($array as $a) {
+                                       // So we can remove all elements as requested
+                                       unset($dummy[$a][$key]);
+                               }
+
+                               // Flush array to cache file
+                               $fp = fopen($this->cache_inc, 'w');
+                               fwrite($fp, "\$ARRAY = \"".$ARRAY."\";\n");
+                               foreach ($dummy as $k => $v) {
+                                       if (is_array($v)) {
+                                               // Multi line(s) found
+                                               $LINE = "";
+                                               foreach($v as $k2 => $v2) {
+                                                       // Put every array element in a row...
+                                                       $LINE .= $this->add_raw_row($k, $v2);
+                                               }
+                                       } else {
+                                               // Single line found
+                                               $LINE = $this->add_raw_row($k, $v);
+                                       }
+
+                                       // Write line(s)
+                                       fwrite($fp, $LINE);
+                               }
+
+                               // Close cache file
+                               fclose($fp);
+                       }
+               } else {
+                       // Cannot write to cache!
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function cache_replace($search, $replace, $search_key, $array)
+       {
+               global $ARRAY;
+               if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc)))
+               {
+                       // Load cache into dummy array
+                       $dummy = $this->cache_load();
+
+                       // Check if $dummy is valid (prevents some errors)
+                       if ((is_array($dummy)) && (isset($dummy[$search])) && (is_array($dummy[$search]))) {
+                               // Search for key in array
+                               $key_found = array_key_exists($search_key, $dummy[$search]);
+                               if ($key_found == true) {
+                                       $key = $search_key;
+                                       // Key (hopefully) found?
+                                       foreach ($dummy as $a => $v) {
+                                               // So we can update all entries
+                                               if ($a == $search) {
+                                                       // Update now...
+                                                       $dummy[$a][$search_key] = $replace;
+                                               }
+                                       }
+
+                                       // Flush array to cache file
+                                       $fp = fopen($this->cache_inc, 'w');
+                                       fwrite($fp, "\$dummy = \"".$ARRAY."\";\n");
+                                       foreach ($dummy as $k => $v) {
+                                               if (is_array($v)) {
+                                                       // Multi line(s) found
+                                                       $LINE = "";
+                                                       foreach($v as $k2 => $v2) {
+                                                               // Put every array element in a row...
+                                                               $LINE .= $this->add_raw_row($k, $v2);
+                                                       }
+                                               } else {
+                                                       // Single line found
+                                                       $LINE = $this->add_raw_row($k, $v);
+                                               }
+
+                                               // Write line(s)
+                                               fwrite($fp, $LINE);
+                                       }
+
+                                       // Close cache file
+                                       fclose($fp);
+                               }
+                       }
+               } else {
+                       // Cannot write to cache!
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function store_extension_version ($ext_name) {
+               // Valid cache pointer?
+               if (is_resource($this->cache_pointer)) {
+                       // Get extension version
+                       $ext_ver = GET_EXT_VERSION($ext_name);
+
+                       // Write cache line to file
+                       @fwrite($this->cache_pointer, "\$cache_version['".$ext_name."'] = \"".$ext_ver."\";\n");
+               } else {
+                       // Cannot create file
+                       ADD_FATAL(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_PROBLEMS_DETECTED);
+               }
+       }
+
+       function ext_version_matches ($ext_name) {
+               // Load cache (dummy)
+               $this->cache_load();
+
+               // Get extension version
+               $ext_ver = GET_EXT_VERSION($ext_name);
+
+               //* DEBUG: */ echo __METHOD__.": ext_name={$ext_name},ext_ver={$ext_ver},cache_version={$this->cache_version}<br />\n";
+               // Compare both
+               return ((isset($this->cache_version[$ext_name])) && ($this->cache_version[$ext_name] == $ext_ver));
+       }
+
+       function add_raw_row ($key, $value) {
+               // Init line
+               $line = "";
+
+               // String or non-string? ;-)
+               if (is_string($value)) {
+                       // String...
+                       $line = "\$data['".$key."'][] = \"".$value."\";\n";
+               } else {
+                       // Non-string
+                       $line = "\$data['".$key."'][] = ".$value.";\n";
+               }
+
+               // Return line
+               return $line;
+       }
+
+       function getStatus () {
+               return $this->ret;
+       }
+}
+//
+?>
diff --git a/inc/libs/country_functions.php b/inc/libs/country_functions.php
new file mode 100644 (file)
index 0000000..6f31bb5
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/30/2005 *
+ * ===============                              Last change: 04/30/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : country_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the guest's newsletter             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer den Newsletter an die Gaeste     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function COUNTRY_GENERATE_INFO($ID)
+{
+       $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%s LIMIT 1",
+        array(bigintval($ID)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               list($code, $descr) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+               $ret = $descr." (".$code.")";
+       }
+        else
+       {
+               // Not found!
+               $ret = COUNTRY_NOT_FOUND;
+       }
+
+       // Return info
+       return $ret;
+}
+//
+?>
diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php
new file mode 100644 (file)
index 0000000..3c44736
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/17/2005 *
+ * ===============                              Last change: 02/17/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : doubler_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the guest's newsletter             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer den Newsletter an die Gaeste     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC")
+{
+       global $_CONFIG;
+       if (empty($cnt)) $cnt = 0;
+       $ADD = ""; $DT_MODE = 0;
+       if ($uid > 0)
+       {
+               // Load entries only from a single user
+               $ADD = " AND userid='".bigintval($uid)."'";
+               $MODE = "member"; $COLS = "4"; $DT_MODE = "2";
+               $NOT_FOUND = DOUBLER_MEMBER_NO_ENTRIES_FOUND;
+       }
+        else
+       {
+               // Guest mode!
+               $MODE = "guest"; $COLS = "3"; $DT_MODE = "3";
+               $NOT_FOUND = DOUBLER_GUEST_NO_ENTRIES_FOUND;
+       }
+
+       if (($done == "Y") && ($sort == "ASC"))
+       {
+               // Already payed out points (latest payouts first)
+               $limit = $_CONFIG['doubler_display_old'];
+       }
+        elseif ($sort == "ASC")
+       {
+               // List entries which will receive their payout soon
+               $limit = $_CONFIG['doubler_display_pay'];
+       }
+        elseif ($sort == "DESC")
+       {
+               // Newest entries
+               $limit = $_CONFIG['doubler_display_new'];
+       }
+
+       // List entries
+       $result = SQL_QUERY("SELECT userid, refid, points, timemark
+FROM "._MYSQL_PREFIX."_doubler
+WHERE completed='".$done."' AND is_ref='".$ref."'".$ADD."
+ORDER BY timemark ".$sort."
+LIMIT ".$limit, __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List entries
+               $OUT = ""; $SW = 2;
+               while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result))
+               {
+                       if (IS_ADMIN())
+                       {
+                               // Set links to admin area
+                               if ($uid > 0) { $uid = ADMIN_USER_PROFILE_LINK($uid); } else { $uid = "---"; }
+                               if ($rid > 0) { $rid = ADMIN_USER_PROFILE_LINK($rid); } else { $rid = "---"; }
+                       }
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'uid'    => $uid,
+                               'rid'    => $rid,
+                               'points' => TRANSLATE_COMMA($points),
+                               'stamp'  => MAKE_DATETIME($time, $DT_MODE),
+                               'sw'     => $SW,
+                       );
+
+                       // Load template and switch color
+                       $OUT .= LOAD_TEMPLATE($MODE."_doubler_list_rows", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // List no entries
+               $OUT = "<TR>
+  <TD colspan=\"".$COLS."\" align=\"center\" class=\"doubler_big_row bottom2\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, $NOT_FOUND)."
+  </TD>
+</TR>\n";
+       }
+
+       // Return template
+       return LOAD_TEMPLATE($MODE."_doubler_list", true, $OUT);
+}
+//
+function DOUBLER_GET_TOTAL_POINTS_LEFT()
+{
+       global $_CONFIG;
+       // Initialize variables
+       $points = 0;
+
+       if ($_CONFIG['doubler_own'] == "Y")
+       {
+               // Take points from doubler's own account
+               $points += $_CONFIG['doubler_points'] - $_CONFIG['doubler_used'];
+       }
+
+       if ($_CONFIG['doubler_jackpot'] == "Y")
+       {
+               // Load jackpot
+               $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
+               list($jackpot) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               if (!empty($jackpot)) $points += $jackpot;
+       }
+
+       if ($_CONFIG['doubler_uid'] > 0)
+       {
+               // Get user's points
+               $user = GET_TOTAL_DATA($_CONFIG['doubler_uid'], "user_points", "points");
+               $points += $user;
+       }
+
+       // Return value
+       return $points;
+}
+//
+?>
diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php
new file mode 100644 (file)
index 0000000..61ce6ab
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/31/2003 *
+ * ===============                              Last change: 08/02/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : holiday_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the admins extension               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die admins-Erweiterung           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function HOLIDAY_STOP_HOLIDAYS()
+{
+       // Let's find some expired holiday requests...
+       $result_stop = SQL_QUERY("SELECT userid, holiday_start, holiday_end, comments
+FROM "._MYSQL_PREFIX."_user_holidays
+WHERE holiday_end <= UNIX_TIMESTAMP()
+ORDER BY userid", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_stop) > 0)
+       {
+               // We foud at least one
+               $admin = "";
+               while (list($uid, $start, $end, $comments) = SQL_FETCHROW($result_stop))
+               {
+                       // Stop holiday
+                       $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_holidays WHERE userid=%s LIMIT 1",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+
+                       // Unlock account
+                       $result_del = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET holiday_active='N', holiday_activated='0'
+WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
+
+                       // Prepare array
+                       $content = array(
+                               'holiday_end'      => MAKE_DATETIME($end  , "3"),
+                               'holiday_start'    => MAKE_DATETIME($start, "3"),
+                               'holiday_comments' => $comments
+                       );
+
+                       // Send mail to user
+                       $msg = LOAD_EMAIL_TEMPLATE("member_holiday_unlock", $content, $uid);
+                       SEND_EMAIL($uid, HOLIDAY_MEMBER_UNLOCK_SUBJ, $msg);
+
+                       // Remember userid for admin
+                       $admin .= $uid."\n";
+               }
+
+               // Send mail to admins
+               SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_UNLOCK_SUBJ, "admin_holiday_unlock", $admin, "0");
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_stop);
+}
+
+//
+?>
diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php
new file mode 100644 (file)
index 0000000..18419e3
--- /dev/null
@@ -0,0 +1,172 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/25/2004 *
+ * ================                             Last change: 04/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : html_mail_functions.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the HTML extension                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die HTML-Erweiterung             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function HTML_ADD_VALID_TAGS()
+{
+       global $HTML_TAGS; $OUT = "";
+       if (!is_array($HTML_TAGS)) return "";
+       foreach ($HTML_TAGS as $tag)
+       {
+               $OUT .= ", ".strtoupper($tag);
+       }
+       $OUT = substr($OUT, 2);
+       return $OUT;
+}
+//
+function HTML_CHECK_TAGS($html)
+{
+       global $HTML_TAGS;
+       $test = stripslashes($html);
+       while (ereg("<", $test) && ereg(">", $test))
+       {
+               $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1));
+               $check = str_replace("/", "", $check);
+               if (!in_array($check, $HTML_TAGS))
+               {
+                       // Invalid tag found!
+                       return "";
+               }
+               $test = substr($test, strpos($test, ">") + 1);
+       }
+       // Return tested code
+       return $html;
+}
+//
+function HTML_INSERT_URLS($text)
+{
+       global $URL_ENDS, $VALID_EMAIL_CHARS;
+       $test = $text;
+
+       // First replace URLs...
+       while (ereg("http://", $test))
+       {
+               $check = substr($test, strpos($test, "http://")); $check2 = $check;
+
+               // See ext-html.php if you want to add more URL ends...
+               foreach ($URL_ENDS as $end)
+               {
+                       if (ereg($end, $check)) $check = substr($check, 0, strpos($check, $end));
+               }
+
+               // Now replace the URL against anchor container and pray...
+               $text = substr($text, 0, strpos($text, $check2))."<A href=\"".DEREFERER($check)."\" target=\"_blank\">".$check."</A>".substr($text, strpos($text, $check2) + strlen($check));
+
+               // Finally remove the url from testing string (or we have a loop and maybe server overload!)
+               $test = substr($test, strpos($test, $check) + strlen($check));
+       }
+
+       // Now do the (nearly) same thing with email addresses
+       // but now we have the problem that email addresses didn't have
+       // a start mark like http:// and our templates are lame didn't have
+       // a mailto: ... :-(
+       $test = $text;
+
+       // ... what will the email address be out the @... ;-)
+       $PARTS = array();
+       while (ereg("@", $test))
+       {
+               $pos = strpos($test, "@");
+               $test2 = substr($test, 0, $pos);
+
+               // First check backwards
+               $idx = $pos - 1;
+               while ($idx > 0)
+               {
+                       $check = substr($test2, $idx, 1);
+                       if (!in_array($check, $VALID_EMAIL_CHARS))
+                       {
+                               // Char found so we end here
+                               break;
+                       }
+                       $idx--;
+               }
+               if ($idx > 0)
+               {
+                       // Starting mark is found
+                       $check2 = substr($test, 0, ($idx + 1));
+                       $test = substr($test, ($idx + 1));
+               }
+
+               // And now go forward...
+               $idx = 0;
+               while ($idx < strlen($test))
+               {
+                       $check = substr($test, $idx, 1);
+                       if ((!in_array($check, $VALID_EMAIL_CHARS)) && ($check != "@"))
+                       {
+                               // Char found so end here again
+                               break;
+                       }
+                       $idx++;
+               }
+               if ($idx > 0)
+               {
+                       // Maybe this is the email address?
+                       $check = substr($test, 0, $idx);
+               }
+
+               // Now replace the email against anchor with mailto and pray...
+               $PARTS[] = $check2."<A href=\"mailto:".$check."\">".$check."</A>";
+
+               // Remove email from testing string (see above why...)
+               $test = substr($test, strlen($check));
+       }
+       // Now put all parts together
+       $text = ""; $PARTS[] = $test;
+       foreach ($PARTS as $part)
+       {
+               $text .= $part;
+       }
+
+       // Replace new-lines agains <br />-s and finally compile possible own HTML tags out...
+       return COMPILE_CODE(str_replace("\n", "<br />\n", $text));
+}
+//
+function SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM)
+{
+       if (EXT_IS_ACTIVE("html_mail"))
+       {
+               // Send mail away as HTML
+               $FROM = "Content-Type: text/html\n".$FROM;
+               SEND_EMAIL($TO, $SUBJECT, $MSG, 'N', $FROM);
+       }
+}
+//
+?>
diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php
new file mode 100644 (file)
index 0000000..f367203
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/08/2005 *
+ * ===============                              Last change: 10/08/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mediadata_functions.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the mediadata extension            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die verbesserten Mediendaten     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value)
+{
+       if (is_array($keys_array) && ($value > 0))
+       {
+               // Is an array so we can run it through
+               foreach ($keys_array as $key)
+               {
+                       // First check if it does exist
+                       $result_media = SQL_QUERY_ESC("SELECT media_key FROM "._MYSQL_PREFIX."_mediadata
+WHERE media_key = '%s' LIMIT 1", array($key), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result_media) == 0)
+                       {
+                               // Not found so we create it (mode will be ignored here!)
+                               $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_mediadata (media_key, media_value)
+VALUES ('%s', '%s')", array($key, $value), __FILE__, __LINE__);
+                       }
+                        else
+                       {
+                               // Update entry
+                               switch ($mode)
+                               {
+                                       case "add": $mode = "+"; break;
+                                       case "sub": $mode = "-"; break;
+                               }
+                               if ($mode == "init")
+                               {
+                                       // Initialize entry
+                                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_mediadata SET media_value=%s WHERE media_key='%s' LIMIT 1",
+                                        array($value, $key), __FILE__, __LINE__);
+                               }
+                                else
+                               {
+                                       // Update entry
+                                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_mediadata SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1",
+                                        array($value, $key), __FILE__, __LINE__);
+                               }
+                       }
+               }
+       }
+}
+//
+function MEDIA_GET_ENTRY($key)
+{
+       // Return nothing by default
+       $value = "";
+
+       // Check for entry
+       $result = SQL_QUERY_ESC("SELECT media_value FROM "._MYSQL_PREFIX."_mediadata WHERE media_key='%s' LIMIT 1",
+        array($key), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Load data
+               list($value) = SQL_FETCHROW($result);
+       }
+
+       // Return data
+       return $value;
+}
+//
+?>
diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php
new file mode 100644 (file)
index 0000000..2b03a73
--- /dev/null
@@ -0,0 +1,185 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/25/2004 *
+ * ================                             Last change: 04/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : newsletter_functions.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the HTML extension                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die HTML-Erweiterung             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function NL_ADD_VALID_TAGS()
+{
+       global $HTML_TAGS; $OUT = "";
+       if (!is_array($HTML_TAGS)) return "";
+       foreach ($HTML_TAGS as $tag)
+       {
+               $OUT .= ", ".strtoupper($tag);
+       }
+       $OUT = substr($OUT, 2);
+       return $OUT;
+}
+//
+function NL_CHECK_TAGS($html)
+{
+       global $HTML_TAGS;
+       $test = stripslashes($html);
+       while (ereg("<", $test) && ereg(">", $test))
+       {
+               $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1));
+               $check = str_replace("/", "", $check);
+               if (!in_array($check, $HTML_TAGS))
+               {
+                       // Invalid tag found!
+                       return "";
+               }
+               $test = substr($test, strpos($test, ">") + 1);
+       }
+       // Return tested code
+       return $html;
+}
+//
+function NL_INSERT_URLS($text)
+{
+       global $URL_ENDS, $VALID_EMAIL_CHARS;
+       $test = $text;
+
+       // First replace URLs...
+       while (ereg("http://", $test))
+       {
+               $check = substr($test, strpos($test, "http://")); $check2 = $check;
+
+               // See ext-html.php if you want to add more URL ends...
+               foreach ($URL_ENDS as $end)
+               {
+                       if (ereg($end, $check)) $check = substr($check, 0, strpos($check, $end));
+               }
+
+               // Now replace the URL against anchor container and pray...
+               $text = substr($text, 0, strpos($text, $check2)) . DEREFERER($check) . substr($text, strpos($text, $check2) + strlen($check));
+
+               // Finally remove the url from testing string (or we have a loop and maybe server overload!)
+               $test = substr($test, strpos($test, $check) + strlen($check));
+       }
+
+       // Now do the (nearly) same thing with email addresses
+       // but now we have the problem that email addresses didn't have
+       // a start mark like http:// and our templates are lame didn't have
+       // a mailto: ... :-(
+       $test = $text;
+
+       // ... what will the email address be out the @... ;-)
+       $PARTS = array();
+       while (ereg("@", $test))
+       {
+               $pos = strpos($test, "@");
+               $test2 = substr($test, 0, $pos);
+
+               // First check backwards
+               $idx = $pos - 1;
+               while ($idx > 0)
+               {
+                       $check = substr($test2, $idx, 1);
+                       if (!in_array($check, $VALID_EMAIL_CHARS))
+                       {
+                               // Char found so we end here
+                               break;
+                       }
+                       $idx--;
+               }
+               if ($idx > 0)
+               {
+                       // Starting mark is found
+                       $check2 = substr($test, 0, ($idx + 1));
+                       $test = substr($test, ($idx + 1));
+               }
+
+               // And now go forward...
+               $idx = 0;
+               while ($idx < strlen($test))
+               {
+                       $check = substr($test, $idx, 1);
+                       if ((!in_array($check, $VALID_EMAIL_CHARS)) && ($check != "@"))
+                       {
+                               // Char found so end here again
+                               break;
+                       }
+                       $idx++;
+               }
+               if ($idx > 0)
+               {
+                       // Maybe this is the email address?
+                       $check = substr($test, 0, $idx);
+               }
+
+               // Now replace the email against anchor with mailto and pray...
+               $PARTS[] = $check2.$check;
+
+               // Remove email from testing string (see above why...)
+               $test = substr($test, strlen($check));
+       }
+       // Now put all parts together
+       $text = ""; $PARTS[] = $test;
+       foreach ($PARTS as $part)
+       {
+               $text .= $part;
+       }
+
+       // Compile possible own HTML tags out...
+       return COMPILE_CODE($text);
+}
+//
+function SEND_NEWSLETTER($TO, $SUBJECT, $MSG, $MODE)
+{
+       global $_POST;
+       // Send mail away as HTML
+       if ($_POST['auto_urls'] == "Y") {
+               // Automatically insert URLs into newsletter
+               if ((EXT_IS_ACTIVE("html")) && ($MODE == "html")) {
+                       // Send HTML mail
+                       SEND_EMAIL($TO, $SUBJECT, HTML_INSERT_URLS($MSG), "Y");
+               } else {
+                       // Send normal mail
+                       SEND_EMAIL($TO, $SUBJECT, NL_INSERT_URLS($MSG), "N");
+               }
+       } else {
+               // Regular send-out
+               if ((EXT_IS_ACTIVE("html")) && ($MODE == "html")) {
+                       SEND_EMAIL($TO, $SUBJECT, $MSG, "Y");
+               } else {
+                       SEND_EMAIL($TO, $SUBJECT, $MSG, "N");
+               }
+       }
+}
+//
+?>
diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php
new file mode 100644 (file)
index 0000000..fde09ea
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/25/2004 *
+ * ================                             Last change: 06/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : nickname_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Nickname functions                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Nickname-Funktionen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function NICKNAME_IS_ACTIVE($uidNick)
+{
+       $ret = false;
+       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE (userid=%s AND userid > 0) OR nickname='%s' LIMIT 1",
+        array(bigintval($uidNick), $uidNick), __FILE__, __LINE__);
+
+       // Check existence of nickname
+       if (SQL_NUMROWS($result) == 1) $ret = true;
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return nickname
+       return $ret;
+}
+//
+function NICKNAME_GET_NICK($userid)
+{
+       // If not found...
+       $ret = "";
+
+       // Search for non-empty nickname
+       $result = SQL_QUERY_ESC("SELECT nickname FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND nickname != '' LIMIT 1",
+        array(bigintval($userid)), __FILE__, __LINE__);
+
+       // Found?
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Load nickname from database
+               list($ret) = SQL_FETCHROW($result);
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return nickname
+       return $ret;
+}
+//
+?>
diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php
new file mode 100644 (file)
index 0000000..cefbd46
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/17/2004 *
+ * ================                             Last change: 09/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : optimize_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Optimize functions                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Optimize-Funktionen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+// Part taken from admin optimize module of PHPNuke (http://www.phpnuke.org)
+//
+function REPAIR_OPTIMIZE_DB()
+{
+       global $MySQL;
+       $ret = array();
+       $tot_data = 0; $tabs = 0; $opts = 0;
+       $tot_idx = 0; $total_gain = 0;
+       $tot_all = 0;
+       $result = @SQL_QUERY("SHOW TABLE STATUS FROM ".$MySQL['dbase'], __FILE__, __LINE__);
+       $tabs = @SQL_NUMROWS($result);
+       $ret['total_size'] = 0;
+       $ret['total_tabs'] = $tabs;
+       if ($tabs > 0)
+       {
+               while ($row = SQL_FETCHARRAY($result))
+               {
+                       $tot_data = $row['Data_length'];
+                       $tot_idx  = $row['Index_length'];
+                       $total = $tot_data + $tot_idx;
+                       $total = $total / 1024;
+                       $total = round ($total, 3);
+                       $gain  = $row['Data_free'];
+                       $gain  = $gain / 1024;
+                       $total_gain += $gain;
+                       $gain = round ($gain, 3);
+
+                       // Repair table
+                       $result1 = SQL_QUERY("REPAIR TABLE ".$row['Name'], __FILE__, __LINE__);
+                       $rep = SQL_FETCHARRAY($result1);
+
+                       // Optimize table
+                       $result1 = SQL_QUERY("OPTIMIZE TABLE ".$row['Name'], __FILE__, __LINE__);
+                       $opt = SQL_FETCHARRAY($result1);
+
+                       // Add data to array
+                       $ret['tables'][] = array($row['Name'], $opt['Msg_text'], $rep['Msg_text'], $total, $gain);
+
+                       // Count total table data
+                       $ret['total_size'] += $total;
+               }
+       }
+       // Total optimized data
+       $total_gain = round ($total_gain,3);
+       $ret['total_gain'] = $total_gain;
+
+       // Insert new row
+       $result = SQL_QUERY("INSERT INTO "._MYSQL_PREFIX."_optimize_gain (gain) VALUES ('".$total_gain."')", __FILE__, __LINE__);
+
+       // Get total runs and total optimization count
+       $result = SQL_QUERY("SELECT COUNT(id) AS rows, SUM(gain) AS opti FROM "._MYSQL_PREFIX."_optimize_gain", __FILE__, __LINE__);
+       list($total_rows, $total_opti) = SQL_FETCHROW($result);
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Transfer data
+       $ret['total_rows'] = $total_rows;
+       $ret['total_opti'] = $total_opti;
+
+       // Return array
+       return $ret;
+}
+//
+?>
diff --git a/inc/libs/order_functions.php b/inc/libs/order_functions.php
new file mode 100644 (file)
index 0000000..50cde42
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/05/2005 *
+ * ===============                              Last change: 04/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : order_functions.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the guest's newsletter             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer den Newsletter an die Gaeste     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+function ORDER_SELECT_OPTION_LIST($default) {
+       // Currenty the list is hardcoded...
+       $LIST = array("userid", "zip", "country", "email", "birth_year", "last_online", "ref_clicks", "total_logins", "mail_orders");
+       $OUT = "";
+       foreach ($LIST as $item) {
+               $selected = "";
+               if ($item == $default) $selected = " selected=\"selected\"";
+               $OUT .= "<OPTION value=\"".$item."\"".$selected.">{--ORDER_SELECT_COLUMN_".strtoupper($item)."--}</OPTION>\n";
+       }
+
+       // Return the output
+       return $OUT;
+}
+
+//
+?>
diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php
new file mode 100644 (file)
index 0000000..95d03c0
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-points.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : All your collected points...                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Ihrer gesammelten Punkte                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function PAYOUT_OUTPUT_PAYOUT_LIST($points)
+{
+       // Replace german decimal comma with CPU's decimal dot
+       $points = strval(str_replace(",", ".", $points));
+       if ($points > 0)
+       {
+               // Pay this out!
+               $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points
+FROM "._MYSQL_PREFIX."_payout_types
+WHERE %s >= min_points
+ORDER BY type", array($points), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       OUTPUT_HTML("<br /><DIV align=\"center\">
+<DIV align=\"center\"><STRONG>".PAYOUT_NOW.":</STRONG></DIV><br />
+<UL>");
+                       // Now let's check
+                       while (list($id, $type, $rate, $mpoi) = SQL_FETCHROW($result))
+                       {
+                               $type = COMPILE_CODE($type);
+                               if ($points >= $mpoi)
+                               {
+                                       // Ok we found one
+                                       $P = $points * $rate - 0.5;
+                                       OUTPUT_HTML("<LI>".PAYOUT_IN.": <STRONG><A href=\"".URL."/modules.php?module=login&amp;what=payout&amp;payout=".$id."\">".$type." (".PAYOUT_MAX." ".round($P)." ".$type.")</A></STRONG></LI>");
+                               }
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+                       OUTPUT_HTML("</UL></DIV>");
+               }
+                else
+               {
+                       // No payout types setup so far
+                       OUTPUT_HTML("<P><FONT class=\"guest_failed\">".PAYOUT_NO_PAYOUT_TYPES."</FONT></P>");
+               }
+       }
+        else
+       {
+               // Points is empty
+               OUTPUT_HTML("<P><FONT class=\"guest_failed\">".PAYOUT_NO_POINTS_ENTERED."</FONT></P>");
+       }
+}
+//
+?>
diff --git a/inc/libs/primera_functions.php b/inc/libs/primera_functions.php
new file mode 100644 (file)
index 0000000..1d19c96
--- /dev/null
@@ -0,0 +1,282 @@
+<?php
+/**
+ * PrimeraApi
+ * -------------------------------------------
+ * Mit dieser Klasse ist ein einfacher Primeratransfer von Ihrem Account
+ * zu dem Account eines bei Primusportal.de registrierten Mitglieds möglich.
+ *
+ *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
+ * Klasse umbenannt nach PrimeraApi, damit sie in das Framework besser passt.
+ * Zudem sind alle oeffentlichen Attribute nun privat, der Konstruktor hat den
+ * neuen "magischen" Namen __construct() und "normale" Konstanten sind nach
+ * Klassenkonstanten umbenannt. Unsinnige else-Bloecke sind noch umgewandelt.
+ * Methodennamen fangen nun immer mit einem kleinen Buchstaben an. Zudem sind
+ * die Methoden Pay,Query und Parse umbenannt.
+ *------------------ Aenderungen durch Roland Haeder 09.08.2008 ----------------
+ *
+ * Die Einbindung des Interfaces geschieht folgendermaßen:
+ *  1. Einbindung der Klasse in Ihr PHP-Auszahlungsskript:
+ *     CODE:
+ *       require_once( "PFAD/ZU/DER/KLASSE/PrimeraApi.class.php" );
+ *       $PPUsername = "username"; // Ihr Username bei Primusportal
+ *       $PPPassword = "passwort"; // Ihr Passwort bei Primusportal
+ *
+ *       $Interface = new PrimeraApi($PPUsername, $PPPassword);
+ *  2. Durchführen einer Auszahlung:
+ *     CODE:
+ *       $Status = $Interface->payPrimera($PayReceiver, $PayAmount, $PayDescription);
+ *
+ *     Wobei $PayReicer der Username des Empfängers bei
+ *     Primusportal.de ist. $PayAmount ist der gerundete( !! ) Betrag an Primera,
+ *     die der Empfänger erhalten soll. $PayDescription ist eine von Ihnen 
+ *     festgelegte kurze Beschreibung. Die Länge dieses Textes darf 100 Zeichen
+ *     nicht überschreiten. Beispiel:
+ *       $status = $Interface->payPrimera("garbage", 10000, "Auszahlung IhreSeite.de - ID: 12345");
+ *  3. Überprüfung des Status (Rückgabecode):
+ *     CODE:
+ *       if (!$status) {
+ *         // Ein Fehler ist aufgetreten
+ *     // Fehlerbehandlung hier einfügen...
+ *       }else {
+ *         // Auszahlung erfolgreich durchgeführt
+ *         // Führen Sie hier Ihre Datenbankabfragen durch, um die Auszahlung zu
+ *         // bestätigen...
+ *       }
+ *
+ *     Die komplette Rückgabe des Interfaces wird als assoziatives Array in der Klassen-
+ *     variable __data gespeichert:
+ *     __data => array("status" => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
+ *                     "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgeführt"),
+ *                     ")
+ *
+ *
+ * @author             Andreas Schmidt <xxgarbagexx@web.de>
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            1.0 - beta
+ * @copyright  (c) 2007 by Primusportal.de
+ * @copyright  (c) 2008 by Roland Haeder
+ */
+class PrimeraApi {
+       /**
+        * Fehler - Interfacebenutzer
+        */
+       const PI_ERROR = -1;
+
+       /**
+        * Statuscode für erfolgreich ausgeführte Transaktion
+        */
+       const PI_DONE = 200;
+
+       /**
+        * Fehler - User existiert nicht oder ist gesperrt
+        */
+       const PI_RECEIVER_ERROR = 301;
+
+       /**
+        * Sender-Account Fehler (User nicht existent, gesperrt, ...)
+        */
+       const PI_SENDER_ERROR = 401;
+
+       /**
+        * Betrag fehler
+        */
+       const PI_AMOUNT_ERROR = 501;
+
+       /**
+        * Zu wenig Primera
+        */
+       const PI_TOO_LESS_PRIMERA = 502;
+
+       /**
+        * User nicht aktiv oder existiert nicht
+        */
+       const PI_USER_CHECK_ERROR = 601;
+
+       /**
+        * User aktiv
+        */
+       const PI_USER_CHECK_OK = 602;
+
+       /**
+        * Primerastand erfolgreich geholt
+        */
+       const PI_GET_PRIMERA_DONE = 701;
+
+       /**
+        * URL für das Interface auf dem Primusserver:
+        */
+       var $host = "http://www.primusportal.de";
+       var $path = "/transfer.interface.2.0.php";
+
+       var $errno = 0;
+       var $err = "";
+
+       var $seperator = ":";
+
+       var $username = "";
+       var $password = "";
+
+       var $data = array();
+
+       var $headers = "";
+
+       /**
+        * Konstruktor
+        */
+       function PrimeraApi ($PPUsername, $PPPassword) {
+               // Set data
+               $this->username = $PPUsername;
+               $this->password = $PPPassword;
+       }
+
+       /**
+        * Anfrage senden und Rückgabecode in Variable speichern
+        */
+       function queryApi ( $data = array() ) {
+               // Base64-encode username and password hash
+               $data["PrimusInterface_Username"] = base64_encode($this->username);
+               $data["PrimusInterface_Password"] = base64_encode($this->password);
+
+               // Send POST request
+               $return = POST_URL($this->host.$this->path, $data);
+
+               // Convert the array into a full string
+               $returnStr = implode("\n", $return);
+
+               // Extract the real content, strip header away
+               $content = explode("<!-- return-start -->", $returnStr);
+
+               // Store headers away for debugging
+               $this->headers = $content[0];
+
+               // Return the content
+               return $content[1];
+       }
+
+       /**
+        * Funktion parst die Rückgabe vom Transferskript:
+        */
+       function parseContent ( $content ) {
+               $x = explode("\n", $content);
+               $return = array();
+               foreach($x as $currentLine) {
+                       $line_exploded = explode(":", $currentLine,2);
+                       if (count($line_exploded) > 1) {
+                               $return[$line_exploded[0]] = $line_exploded[1];
+                       }
+               }
+               return $return;
+       }
+
+       /**
+        * @param int/string $Receiver UserID / Username des Empfängers
+        * @param int $Amount Betrag in ganzzahligen Primera
+        * @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
+        */
+       function payPrimera ($Receiver, $Amount, $Description = "") {
+               $valid = false;
+               $postData = array("PrimusInterface_Action" => "Pay",
+                       "PrimusInterface_Receiver" => base64_encode($Receiver),
+                       "PrimusInterface_Amount" => base64_encode($Amount),
+                       "PrimusInterface_Description" => base64_encode($Description) );
+
+               $postReturn = $this->parseContent( $this->queryApi($postData) );
+
+               $this->data = $postReturn;
+               if ($postReturn["status"] == "200") {
+                       $valid = true;
+               }
+               return $valid;
+       }
+
+       /**
+        * Überprüft den Status eines Primus-Users
+        * - existiert der User
+        * - ist er aktiv
+        * @param string/int $User Userid / Username
+        */
+       function CheckPrimusUser($User) {
+               $valid = false;
+               $postData = array("PrimusInterface_Action"=> "CheckPrimusUser",
+                       "PrimusInterface_CheckPrimusUser" => $User);
+
+               $postReturn = $this->parseContent( $this->queryApi($postData) );
+
+               $this->data = $postReturn;
+
+               if ($postReturn["status"] == self::PI_USER_CHECK_OK) {
+                       $valid = true;
+               }
+               return $valid;
+       }
+
+       /**
+        * Die Funktion liefer den aktuellen Primerastand
+        */
+       function getPrimera() {
+               $primera = false;
+               $postData = array( "PrimusInterface_Action" => "GetPrimera" );
+               $postReturn = $this->parseContent( $this->queryApi($postData) );
+
+               $this->data = $postReturn;
+               if ($postReturn["status"] == self::PI_GET_PRIMERA_DONE) {
+                       $primera = $postReturn["primera"];
+               }
+               return $primera;
+       }
+       /**
+        * Getter fuer data
+        */
+       function getData () {
+               return $this->data;
+       }
+}
+
+// Function to test the Primera API by getting the amount. If the returned value
+// is not false the API data is valid, else invalid
+function PRIMERA_TEST_API () {
+       // Get new instance
+       $api = new PrimeraApi($_POST['primera_api_name'], $_POST['primera_api_md5']);
+
+       // Was that fine?
+       return ($api->getPrimera() !== false);
+}
+// Execute the withdraw of a sponsor only!
+function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) {
+       global $_CONFIG;
+
+       // Is the sponsor extension installed?
+       if (!EXT_IS_ACTIVE("sponsor")) {
+               // No, abort here
+               return false;
+       } elseif (!IS_SPONSOR()) {
+               // No sponsor, not allowed to withdraw!
+               return false;
+       }
+
+       // Get new instance
+       $api = new PrimeraApi($primusNick, $userMd5);
+
+       // Prepare purpose
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_WITHDRAW, $_COOKIE['sponsorid']))."\";";
+       eval($eval);
+
+       // Pay the Primera
+       return $api->payPrimera($primusNick, $amount, $purpose);
+}
+// Execute the payout
+function PRIMERA_EXECUTE_PAYOUT ($primusNick, $userMd5, $amount) {
+       global $_CONFIG;
+
+       // Get new instance
+       $api = new PrimeraApi($_CONFIG['primera_api_name'], $_CONFIG['primera_api_md5']);
+
+       // Prepare purpose
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(PRIMERA_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";";
+       eval($eval);
+
+       // Pay the Primera
+       return $api->payPrimera($primusNick, $amount, $purpose);
+}
+// [EOF]
+?>
diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php
new file mode 100644 (file)
index 0000000..643c53f
--- /dev/null
@@ -0,0 +1,823 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/22/2004 *
+ * ===============                              Last change: 08/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : rallye_functions.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for rallye extension           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer rallye-Erweiterung       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function RALLYE_AUTOSTART_RALLYES($result)
+{
+       // Global data array for LOAD_EMAIL_TEMPLATE()
+       $DATA = array();
+       global $DATA, $_CONFIG;
+
+       // Load all rallyes (usally we have only one rallye active per time!
+       list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Set notified to Y
+       $result_notified = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET notified='Y' WHERE id=%s LIMIT 1",
+        array(bigintval($id)), __FILE__, __LINE__);
+
+       // Do a snapshot off all user refs
+       $result_user = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+
+       // Transfer all neccessary data to the global $DATA array
+       $DATA['uid_cnt']    = SQL_NUMROWS($result_user);
+       $DATA['start']      = MAKE_DATETIME($start, "2");
+       $DATA['end']        = MAKE_DATETIME($end  , "2");
+       $DATA['now_t']      = MAKE_DATETIME(time(), "2");
+       $DATA['title']      = $title;
+       $DATA['id']         = $id;  // ID for the rallye details link
+
+       if ($min_users == 0) {
+               // Rallye ends without user limitation
+               $DATA['min_users'] = RALLYE_END_NO_USER_LIMITATION;
+       } else {
+               // Rallye ends when X members are totally in your exchange
+               $DATA['min_users'] = RALLYE_END_USERS_1." ".$min_users." ".RALLYE_END_USERS_2;
+       }
+
+       if ($min_prices == 0) {
+               // Rallye ends without user limitation
+               $DATA['min_prices'] = RALLYE_END_NO_PRICE_LIMITATION;
+       } else {
+               // Rallye ends when X members are totally in your exchange
+               $DATA['min_prices'] = RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2;
+       }
+
+       // Load prices
+       $prices = RALLYE_ADD_PRICES($id);
+
+       // Let's begin with the userids...
+       while (list($uid) = SQL_FETCHROW($result_user)) {
+               $un = false;
+
+               // Get refs by userid
+               $cnt = RALLYE_GET_REFCOUNT($uid);
+               if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
+
+               // Check if line is already included...
+               $result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
+                array(bigintval($id), bigintval($uid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result_ref) == 0) {
+                       // Free memory
+                       SQL_FREERESULT($result_ref);
+
+                       // Add userid and his ref count to table
+                       $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(p.points)
+FROM "._MYSQL_PREFIX."_user_points AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON p.userid=d.userid
+WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s",
+ array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+                       list($cpoints) = SQL_FETCHROW($result_ref);
+                       SQL_FREERESULT($result_ref);
+
+                       if (empty($cpoints)) $cpoints = "0.00000";
+
+                       // Add info line
+                       $result_ref = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_rallye_users (rallye_id, userid, refs, curr_points)
+VALUES ('%s','%s','%s','%s')",
+ array(bigintval($id), bigintval($uid), bigintval($cnt), $cpoints), __FILE__, __LINE__);
+                       $un = true;
+               } // END - if
+
+               // Ignored but for the template required refs (made before start of rallye)
+               $DATA['refs']  = $cnt;
+
+               // Shall I notify this member?
+               if (($notify == "Y") && ($un)) {
+                       // Load email template and send it to the user
+                       $msg = LOAD_EMAIL_TEMPLATE("member_rallye_notify", array('prices' => $prices), $uid);
+                       SEND_EMAIL($uid, RALLYE_MEMBER_NOTIFY.$title, $msg);
+               } // END - if
+       } // END - while
+
+       // Choose the right admin template
+       $templ = "admin_rallye_no_notify";
+       if ($notify == "Y") $templ = "admin_rallye_notify";
+
+       // Send email to admin
+       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_NOTIFY.$title, $templ, $prices, "0");
+
+       // Free memory
+       SQL_FREERESULT($result_user);
+}
+//
+function RALLYE_ADD_PRICES($rallye,$mode="email")
+{
+       // Output mode
+       switch($mode)
+       {
+               case "email": $mode = "\n";     break;
+               case "html" : $mode = "<br />\n"; break;
+       }
+
+       // Load prices
+       $result_prices = SQL_QUERY("SELECT price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_prices) > 0)
+       {
+               // Load prices
+               if ($mode == "\n") $prices = RALLYE_MEMBER_PRICES_ADDED.":".$mode."------------------------------".$mode;
+               $prices = "";
+               while (list($level, $points, $info) = SQL_FETCHROW($result_prices))
+               {
+                       $prices .= $level.RALLYE_PRICE.": ";
+                       if (!empty($info))
+                       {
+                               $prices .= $info;
+                       }
+                        else
+                       {
+                               $prices .= $points." ".POINTS;
+                       }
+                       $prices .= "".$mode;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_prices);
+       }
+        else
+       {
+               // No prices???
+               $prices = RALLYE_MEMBER_NO_PRICES.$mode;
+       }
+       // Add last line for email mode
+       if ($mode == "\n") $prices .= "------------------------------";
+
+       // Return price list
+       return $prices;
+}
+//
+function RALLYE_ADD_TOPUSERS($rallye,$default=0)
+{
+       global $_CONFIG;
+       // Init variable
+       $since = 0;
+       if (EXT_IS_ACTIVE("autopurge")) {
+               $since = $_CONFIG['ap_inactive_since'];
+       } // END - if
+
+       // First check how many prices are set
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
+        array(bigintval($rallye)), __FILE__, __LINE__);
+       $prices = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       // And load only limited users
+       $result = SQL_QUERY_ESC("SELECT DISTINCT u.userid, u.refs, u.curr_points FROM "._MYSQL_PREFIX."_rallye_users AS u
+LEFT JOIN "._MYSQL_PREFIX."_refsystem AS r
+ON u.userid=r.userid
+WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC",
+ array(bigintval($rallye)), __FILE__, __LINE__);
+
+       // Load users
+       $DATA = array(
+               'uid'      => array(),
+               'ref'      => array(),
+               'cpoints'  => array()
+       );
+
+       while(list($uid, $refs, $cpoints) = SQL_FETCHROW($result))
+       {
+               // Get current refs
+               $cnt = RALLYE_GET_REFCOUNT($uid, $refs);
+
+               // Points of ref's
+               $result_ref = SQL_QUERY_ESC("SELECT DISTINCT p.points FROM "._MYSQL_PREFIX."_user_points AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON p.userid=d.userid
+WHERE d.userid=%s AND d.status='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s AND d.last_online >= (UNIX_TIMESTAMP() - %s)
+LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout'], $since), __FILE__, __LINE__);
+               list($refpoints) = SQL_FETCHROW($result_ref);
+               SQL_FREERESULT($result_ref);
+
+               if (empty($refpoints)) $refpoints = 0;
+
+               // And subtract start refs
+               $cnt -= $refs;
+
+               $_uid = "---";
+               // List only users with at least one ref!
+               if (($cnt > 0) && ($refpoints > $cpoints)) { $_uid = $uid; } else { $cnt = ""; }
+
+               // Save values to array
+               $DATA['uid'][]     = $_uid;
+               $DATA['ref'][]     = $cnt;
+               $DATA['cpoints'][] = $cpoints;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Sort whole array
+       array_pk_sort($DATA, array("ref", "cpoints"), 0, 1, true);
+
+       // Generate table
+       $OUT = LOAD_TEMPLATE("guest_rallye_header", true);
+       $SW = 2;
+       for ($idx = 0; $idx < $prices; $idx++)
+       {
+               if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = "---";
+               if (empty($DATA['ref'][$idx])) $DATA['ref'][$idx] = "---";
+               // Add row
+               $OUT .= "<TR>
+  <TD class=\"switch_sw".$SW." bottom2\">&nbsp;&nbsp;".($idx+1).".</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2\">";
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+               $OUT .= $DATA['uid'][$idx];
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+               $OUT .= "</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2\">";
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+               $OUT .= $DATA['ref'][$idx];
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+               $OUT .= "</TD>
+</TR>\n";
+               $SW = 3 - $SW;
+       }
+       // Add footer
+       $OUT .= LOAD_TEMPLATE("guest_rallye_footer", true);
+
+       // And finnally return the output
+       return $OUT;
+}
+// Run this function only when a new member has confirmed his email address!
+function RALLYE_AUTOADD_USER($uid)
+{
+       global $DATA;
+       $ADD = "";
+
+       // Updated extension?
+       if (GET_EXT_VERSION("rallye") >= "0.2.0") {
+               $ADD .= ", min_users, min_prices";
+       } // END - if
+
+       // Check for an auto-add rallye
+       $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM "._MYSQL_PREFIX."_rallye_data WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Init variables
+               $min_users = 0; $min_prices = 0;
+               // Load data
+               if (GET_EXT_VERSION("rallye") >= "0.2.0") {
+                       list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
+               } else {
+                       list($id, $title, $start, $end, $notify) = SQL_FETCHROW($result);
+               }
+
+               // Free result
+               SQL_FREERESULT($result);
+
+               // Check if line is already included...
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
+                       array(bigintval($id), bigintval($uid)), __FILE__, __LINE__);
+
+               // Is this user added?
+               if (SQL_NUMROWS($result) == 0) {
+                       // Add userid and his ref count to table
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_rallye_users (rallye_id, userid, refs)
+VALUES ('%s','%s','0')",
+ array(bigintval($id), bigintval($uid)), __FILE__, __LINE__);
+               } else {
+                       // Free memory
+                       SQL_FREERESULT($result);
+               }
+
+               if ($notify == "Y") {
+                       // Transfer all neccessary data to the global $DATA array
+                       $DATA['start'] = MAKE_DATETIME($start, "2");
+                       $DATA['end']   = MAKE_DATETIME($end  , "2");
+                       $DATA['now_t'] = MAKE_DATETIME(time(), "2");
+                       $DATA['title'] = $title;
+                       $DATA['id']    = $id;  // ID for the rallye details link
+                       $DATA['ref']   = 0;
+                       $DATA['refs']  = GET_TOTAL_DATA($uid, "user_data", "userid", "refid", true);
+
+                       // Load prices
+                       $prices = RALLYE_ADD_PRICES($id);
+
+                       if ($min_users == 0) {
+                               // Rallye ends without user limitation
+                               $DATA['min_users'] = RALLYE_END_NO_USER_LIMITATION;
+                       } else {
+                               // Rallye ends when X members are totally in your exchange
+                               $DATA['min_users'] = RALLYE_END_USERS_1." ".$min_users." ".RALLYE_END_USERS_2;
+                       }
+
+                       if ($min_prices == 0) {
+                               // Rallye ends without user limitation
+                               $DATA['min_prices'] = RALLYE_END_NO_PRICE_LIMITATION;
+                       } else {
+                               // Rallye ends when X members are totally in your exchange
+                               $DATA['min_prices'] = RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2;
+                       }
+
+                       // Send notification to member
+                       $msg = LOAD_EMAIL_TEMPLATE("member_rallye_notify", array('prices' => $prices), $uid);
+                       SEND_EMAIL($uid, RALLYE_MEMBER_NOTIFY.$title, $msg);
+               } // END - if
+       } // END - if
+}
+//
+function RALLYE_EXPIRE_RALLYES($result)
+{
+       global $DATA, $_CONFIG;
+
+       // Latest online time
+       $since = 0;
+       if (EXT_IS_ACTIVE("autopurge")) {
+               $since = $_CONFIG['ap_inactive_since'];
+       } // END - if
+
+       // Load rallye data
+       list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Load users array (!) with assigned prices
+       $prices = RALLYE_LOAD_USERS_ARRAY($id);
+
+       // Init array
+       $DATA = array(); $cnt = 0;
+       $users = array();
+       $DATA['title']  = $title;
+       $DATA['start']  = MAKE_DATETIME($start, "1");
+       $DATA['end']    = MAKE_DATETIME($end  , "1");
+       $DATA['now_t']  = MAKE_DATETIME(time(), "1");
+
+       // Just count...
+       $TOTAL = 0;
+       foreach($prices['uid'] as $key => $uid)
+       {
+               // Check status
+               //   active = 1: account is still confirmed
+               //   active = 0: account is deleted or locked
+               $result = SQL_QUERY_ESC("SELECT COUNT(userid) AS active
+FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s AND status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)
+LIMIT 1", array(bigintval($uid), $since), __FILE__, __LINE__);
+               list($active) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               $prices['active'][$key] = $active;
+
+               // Allow valid and active users with at least one ref to get points
+               if (($uid > 0) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0))
+               {
+                       $TOTAL++;
+               }
+       }
+
+       if (($TOTAL < $min_prices) || ($TOTAL == 0))
+       {
+               // Do not end this rallye!
+               return;
+       }
+
+       // Expire rallye
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET expired='Y' WHERE id=%s LIMIT 1",
+        array(bigintval($id)), __FILE__, __LINE__);
+
+       // Run array through (by uid is the most important 2nd-level-array)
+       foreach($prices['uid'] as $key => $uid)
+       {
+               // Allow valid and active users with at least one ref to get points
+               if (($uid > 0) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0))
+               {
+                       // Transfer data to array for the mail template
+                       $DATA['level']  = $prices['level'][$key];
+                       $DATA['points'] = $prices['points'][$key];
+                       $DATA['info']   = $prices['info'][$key];
+                       $DATA['ref']    = $prices['ref'][$key];
+
+                       if ($DATA['points'] > 0) {
+                               // Add points directly to user's account
+                               ADD_POINTS_REFSYSTEM($uid, $DATA['points'], false, "0", false, "direct");
+                       }
+
+                       if ($notify == "Y") {
+                               // Prepare infos for the mail template
+                               if (!empty($DATA['info'])) {
+                                       // Take direct infos
+                                       $DATA['infos'] = $DATA['info'];
+                               } else {
+                                       // Take points
+                                       $DATA['infos'] = $DATA['points']." ".POINTS;
+                               }
+
+                               // Add suffix to template name
+                               $template = "member_rallye_expired";
+                               if ($DATA['level'] == 1) {
+                                       // The winner!
+                                       $template .= "_gold";
+                               } elseif ($DATA['level'] == 2) {
+                                       // The vice winner!
+                                       $template .= "_silver";
+                               } elseif ($DATA['level'] == 3) {
+                                       // The bronce winner
+                                       $template .= "_bronce";
+                               }
+
+                               // Load template
+                               $msg = LOAD_EMAIL_TEMPLATE($template, $DATA, $uid);
+                               SEND_EMAIL($uid, RALLYE_MEMBER_EXPIRED.": ".$DATA['level']." "._RALLYE_PRICE, $msg);
+                       } // END - if
+
+                       // Count userid
+                       $cnt++;
+                       $users['uid'][$uid] = $uid;
+                       $users['poi'][$uid] = $DATA['infos'];
+               }
+       }
+
+       // Select template depending on notfication is switch on / off
+       if ($notify == "Y") {
+               $templ = "admin_rallye_expired";
+       } elseif (is_array($users['uid'])) {
+               $templ = "admin_rallye_expired_no";
+               $cnt = RALLYE_LOAD_USER_DATA($users);
+       }
+
+       // Send mail to admin
+       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0);
+
+       // Add task
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (status, task_type, subject, text, task_created)
+VALUES ('NEW','RALLYE_EXPIRED','".RALLYE_ADMIN_EXPIRED.": %s','".RALLYE_ADMIN_EXPIRED_TEXT."',UNIX_TIMESTAMP())",
+ array($title), __FILE__, __LINE__);
+
+       // All work done here...
+}
+//
+function RALLYE_LOAD_USER_DATA($uids_array)
+{
+       // Implode user ids
+       $uid_string = implode(",", $uids_array['uid']);
+
+       // Load users
+       $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid IN(%s) AND status='CONFIRMED' ORDER BY userid LIMIT %s",
+        array($uid_string, count($uids_array)), __FILE__, __LINE__);
+       $ret = "";
+       while (list($u, $gender, $surname, $family, $email) = SQL_FETCHROW($result))
+       {
+               $ret .= TRANSLATE_GENDER($gender)." ".$surname." ".$family." (".$email.") - ".$uids_array['poi'][$u]."\n";
+       }
+
+       // Return result
+       return substr($ret, 0, -1);
+}
+//
+function RALLYE_LOAD_PRICES_ARRAY($rallye)
+{
+       // Init multi array
+       $prices = array(
+               'level'  => array(),
+               'points' => array(),
+               'info'   => array()
+       );
+
+       // Load prices
+       $result = SQL_QUERY_ESC("SELECT price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
+        array(bigintval($rallye)), __FILE__, __LINE__);
+       while(list($level, $points, $info) = SQL_FETCHROW($result))
+       {
+               $prices['level'][]  = $level;
+               $prices['points'][] = $points;
+               $prices['info'][]   = $info;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Return array
+       return $prices;
+}
+//
+function RALLYE_LOAD_USERS_ARRAY($rallye)
+{
+       global $_CONFIG;
+
+       // Fix zero points to 0.00000
+       if ($_CONFIG['ref_payout'] == "0") $_CONFIG['ref_payout'] = "0.00000";
+
+       // Init multi array
+       $users = array(
+               'uid'     => array(),
+               'ref'     => array(),
+               'cpoints' => array(),
+       );
+
+       // Load users                    uid    old   points earned
+       $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s ORDER BY userid",
+        array(bigintval($rallye)), __FILE__, __LINE__);
+       while(list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user))
+       {
+               // Load current ref count
+               $cnt = RALLYE_GET_REFCOUNT($uid, $refs);
+
+               // Points of ref's
+               $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(p.points)
+FROM "._MYSQL_PREFIX."_user_points AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON p.userid=d.userid
+WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s",
+ array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+               list($refpoints) = SQL_FETCHROW($result_ref);
+               SQL_FREERESULT($result_ref);
+
+               if (empty($refpoints)) $refpoints = 0;
+
+               // Store calculated new refs to array
+               $users['uid'][]     = $uid;
+               $users['ref'][]     = abs($cnt - $refs);
+               $users['cpoints'][] = $refpoints - $cpoints;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_user);
+
+       // Sort array for refs (descending)
+       array_pk_sort($users, array("ref", "cpoints"), 0, 1, true);
+
+       // Load prices array (!)
+       $prices = RALLYE_LOAD_PRICES_ARRAY($rallye);
+
+       // Merge users into prices
+       foreach ($prices['level'] as $k => $lvl)
+       {
+               $prices['uid'][$k]  = $users['uid'][$k];
+               if (empty($prices['uid'][$k])) $prices['uid'][$k]  = "---";
+               $prices['ref'][$k] = $users['ref'][$k];
+               if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
+               $prices['cpoints'][$k] = $users['cpoints'][$k];
+       }
+
+       // Return completed array
+       return $prices;
+}
+//
+function RALLYE_LIST_WINNERS($rallye,$default=0)
+{
+       // First check how many prices are set
+       $result_prices = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
+        array(bigintval($rallye)), __FILE__, __LINE__);
+       $prices = SQL_NUMROWS($result_prices);
+       SQL_FREERESULT($result_prices);
+
+       // Load data
+       $DATA = RALLYE_LOAD_USERS_ARRAY($rallye);
+
+       // Generate table
+       $OUT = LOAD_TEMPLATE("guest_rallye_expired_header", true);
+       $SW = 2;
+       for ($idx = 0; $idx < $prices; $idx++)
+       {
+               // Check status
+               //   active = 1: account is still confirmed
+               //   active = 0: account is deleted or locked
+               $result_active = SQL_QUERY_ESC("SELECT COUNT(userid) FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                array(bigintval($DATA['uid'][$idx])), __FILE__, __LINE__);
+               list($active) = SQL_FETCHROW($result_active);
+               SQL_FREERESULT($result_active);
+
+               if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = "---";
+               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == "0") || (empty($DATA['cpoints'][$idx])))
+               {
+                       // Allow valid and active users with at least one ref to get points
+                       $DATA['ref'][$idx]   = "---";
+                       $DATA['uid'][$idx]   = "---";
+               }
+               if (!empty($DATA['info'][$idx]))
+               {
+                       // Take direct infos
+                       $DATA['infos'][$idx] = $DATA['info'][$idx];
+               }
+                else
+               {
+                       // Take ppints
+                       $DATA['infos'][$idx] = $DATA['points'][$idx]." ".POINTS;
+               }
+
+               // Add row
+               $ADD = "";
+               $OUT .= "<TR>
+  <TD class=\"switch_sw".$SW." bottom2".$ADD."\">&nbsp;&nbsp;".($idx+1).".</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+               $OUT .= $DATA['uid'][$idx];
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+               $OUT .= "</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+               $OUT .= $DATA['ref'][$idx];
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+               $OUT .= "</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<STRONG>";
+               $OUT .= $DATA['infos'][$idx];
+               if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</STRONG>";
+               $OUT .= "</TD>
+</TR>\n";
+               $SW = 3 - $SW;
+       }
+       // Add footer
+       $OUT .= LOAD_TEMPLATE("guest_rallye_expired_footer", true);
+
+       // And finnally return the output
+       return $OUT;
+}
+//
+function RALLYE_DELETE_EXPIRED_RALLYES()
+{
+       global $DATA, $_CONFIG;
+       // Check for expired rallyes
+       $EXPIRE = $_CONFIG['one_day'] * 3; // @TODO The hard-coded value...
+       $result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time
+FROM "._MYSQL_PREFIX."_rallye_data
+WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'",
+               array($EXPIRE), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result_rallye) > 0)
+       {
+               // Expire found rallyes and notify admin
+               while(list($id, $title, $start, $end) = SQL_FETCHROW($result_rallye))
+               {
+                       // Prepare data for mail template
+                       $DATA['title']  = $title;
+                       $DATA['start']  = MAKE_DATETIME($start, "1");
+                       $DATA['end']    = MAKE_DATETIME($end  , "1");
+                       $DATA['now_t']  = MAKE_DATETIME(time(), "1");
+
+                       // Send mail to admin
+                       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0);
+
+                       // Purge whole rallye
+                       $result_purge = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $result_purge = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $result_purge = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+               }
+
+               // Add task
+               $result_task = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (status, task_type, subject, text, task_created)
+VALUES ('NEW','RALLYE_PURGED','".RALLYE_ADMIN_PURGED.": %s','".RALLYE_ADMIN_PURGED_TEXT."',UNIX_TIMESTAMP())",
+ array($title), __FILE__, __LINE__);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_rallye);
+}
+//
+function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
+{
+       // Check templates directory
+       $OUT = ""; $ral = array();
+       $BASE = sprintf("%stemplates/%s/html/rallye/", PATH, GET_LANGUAGE());
+       $dir = opendir($BASE);
+       while ($read = readdir($dir))
+       {
+               // If it is no dir (so a file)
+               if (!is_dir($BASE.$read))
+               {
+                       // Accept only templates matching with rallye_????.tpl.xx
+                       if (eregi("^rallye_.*\.tpl", $read))
+                       {
+                               $read = substr($read, 7, strpos($read, ".") - 7);
+                               // Accept only template names between 1 and 255 chars length
+                               if ((strlen($read) < 256) && (!empty($read))) $ral[] = $read;
+                       }
+               }
+       }
+       closedir($dir);
+
+       // Do we have found templates which we can link with the new rallye?
+       if (!empty($ral[0]))
+       {
+               // Generate selection box for all found templates
+               $OUT  = "<SELECT name=\"".$name."\" size=\"1\" class=\"admin_select\">
+  <OPTION value=\"\">".SELECT_NONE."</OPTION>\n";
+               foreach ($ral as $rallye)
+               {
+                    $OUT .= "  <OPTION value=\"".$rallye."\"";
+                       if ($default == $rallye) $OUT .= " selected default";
+                       $OUT .= ">".$rallye."</OPTION>\n";
+               }
+               $OUT .= "</SELECT>\n";
+       }
+        else
+       {
+               // No rallye templates found
+               $OUT = RALLYE_NO_TEMPLATES_FOUND;
+       }
+
+       // Return selection
+       return $OUT;
+}
+//
+function RALLYE_GET_REFCOUNT($uid, $old=0)
+{
+       global $_CONFIG, $cacheArray;
+       // Check current refs
+       if (GET_EXT_VERSION("cache") >= "0.1.2")
+       {
+               // Get refs from cache
+               $cnt = 0;
+               foreach ($cacheArray['ref_system']['userid'] as $id => $u_id)
+               {
+                       if (($u_id == $uid) && ($cacheArray['ref_system']['level'][$id] == 0))
+                       {
+                               foreach ($cacheArray['ref_depths']['level'] as $level)
+                               {
+                                       if (($level == $cacheArray['ref_system']['level'][$id]) && ($level == 0))
+                                       {
+                                               // Level does exist so abort here
+                                               $cnt = $cacheArray['ref_system']['counter'][$id];
+                                               //* DEBUG: */ echo "*".$uid."/".$cnt."*<br />";
+                                               break;
+                                       }
+                                        elseif ($level > 0)
+                                       {
+                                               // Not interesting here...
+                                               break;
+                                       }
+                               }
+                               // Abort also here!
+                               if ($cnt > 0) break;
+                       }
+               }
+               //* DEBUG: */ echo "<PRE>";
+               //* DEBUG: */ print_r($cacheArray['ref_system']);
+               //* DEBUG: */ echo "</PRE>";
+               //* DEBUG: */ die();
+
+               if ($cnt > 0)
+               {
+                       // Count cache hits
+                       $_CONFIG['cache_hits']++;
+
+                       // Remove old refs
+                       //* DEBUG: */ echo "+".$cnt."/".$old."+<br />";
+                       $cnt -= $old;
+               }
+       }
+        else
+       {
+               // Load current refs from database
+               $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(s.counter) AS cnt
+FROM "._MYSQL_PREFIX."_refsystem AS s
+LEFT JOIN "._MYSQL_PREFIX."_refdepths AS d
+ON s.level=d.level
+WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FILE__, __LINE__);
+               list($cnt) = SQL_FETCHROW($result_ref);
+               SQL_FREERESULT($result_ref);
+               if (empty($cnt))
+               {
+                       $cnt = 0;
+               }
+                else
+               {
+                       $cnt -= $old;
+               }
+       }
+
+       // Return count
+       //* DEBUG: */ echo "*".$uid."/".$old."/".$cnt."*<br />";
+       return $cnt;
+}
+//
+?>
diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php
new file mode 100644 (file)
index 0000000..6e5c911
--- /dev/null
@@ -0,0 +1,395 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2008 *
+ * ===============                              Last change: 09/28/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : refback_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for refback extension                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer Refback-Erweiterung              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Payback refback for refid and reduce it for current user
+function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       global $DEPTH, $cacheArray;
+
+       // Back ref depths
+       $cacheArray['depth'][$uid][$ref] = $DEPTH; 
+
+       // Init points
+       $return = $points;
+
+       // Get all ref levels
+       $result_refs = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths WHERE level > 0 ORDER BY level ASC", __FILE__, __LINE__);
+
+       // "Walk" through all level
+       while (list($level, $perc) = SQL_FETCHROW($result_refs)) {
+               // Reset ref depths
+               $DEPTH = -1;
+
+               // "Walk through all refids
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},level={$level},points={$points}<br />\n";
+               foreach (GET_REFBACK_USERID_ARRAY($uid, $level) as $refid) {
+                       // Skip level zero or if both are the same
+                       if ($uid == $refid) continue;
+
+                       // Get refback percents
+                       $percents = GET_REFBACK_PERCENTS($uid, $refid);
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />\n";
+
+                       // Some percents given?
+                       if ($percents > 0) {
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$perc},percents={$percents},level={$level}<br />\n";
+                               // Get points for refback
+                               $refback = $points * ($perc / 100) * ($percents / 100);
+
+                               // Update refback table ("refid" and "uid" must be exchanged!)
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1",
+                                       array($refback, $refid, $uid), __FILE__, __LINE__);
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+
+                               // Add points again, but only directly
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />\n";
+                               ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct");
+
+                               // Reduce points if refid is found
+                               if ($refid == $ref) {
+                                       // Reduce points here!
+                                       $return = $points * ($perc / 100) - $refback;
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />\n";
+                               } // END - if
+                       } // END - if
+               } // END foreach
+       } // END - while
+
+       // Free result
+       SQL_FREERESULT($result_refs);
+
+       // Restore ref depth
+       $DEPTH = $cacheArray['depth'][$uid][$ref];
+
+       // Return them
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $return;
+}
+// "Getter" for refback percents
+function GET_REFBACK_PERCENTS ($uid, $ref) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+       // Skip identical ids
+       if ($uid == $ref) return 0;
+
+       // Default is zero
+       $percents = 0;
+
+       // Get percents from database
+       $result = SQL_QUERY_ESC("SELECT refback FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND refid=%s LIMIT 1",
+               array($ref, $uid), __FILE__, __LINE__);
+
+       // Entry found? (Should be!)
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch percents
+               list($percents) = SQL_FETCHROW($result);
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />\n";
+       } else {
+               // Debug log
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />\n";
+               DEBUG_LOG(__FUNCTION__.": uid={$uid},ref={$ref} - No entry found! :-(");
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return percents
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $percents;
+}
+// "Getter" for userid array which will return only one entry
+function GET_REFBACK_USERID_ARRAY ($rid, $level) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />\n";
+       // Init userids
+       $userIds = array();
+
+       // Look for all
+       $result = SQL_QUERY_ESC("SELECT userid
+FROM "._MYSQL_PREFIX."_user_refs
+WHERE refid=%s AND level=%s
+ORDER BY userid ASC",
+               array($rid,$level), __FILE__, __LINE__);
+
+       // Entries found?
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />\n";
+       if (SQL_NUMROWS($result) > 0) {
+               // Add all
+               while (list($userid) = SQL_FETCHROW($result)) {
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$userid}<br />\n";
+                       $userIds[] = $userid;
+               } // END - while
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return array
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />\n";
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $userIds;
+}
+// Update "refback table"
+function UPDATE_REFBACK_TABLE($uid) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       global $cacheArray, $cacheInstance;
+
+       // Make it sure referral level zero (member him-/herself) is at least selected
+       if (empty($cacheArray['back_level'])) $cacheArray['back_level'] = 1;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']}<br />\n";
+
+       // Init refid
+       $cacheArray['up_refid'][$cacheArray['back_level']] = 0;
+       $old = 0; $minus = 0;
+
+       // Check for his referral
+       $result_refid = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid=%s ORDER BY userid ASC",
+               array(bigintval($uid)), __FILE__, __LINE__);
+
+       // When no entry was updated then we have to create it here
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
+       if (SQL_NUMROWS($result_refid) > 0) {
+               // Load all refids
+               while(list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) {
+                       // Remmber userid
+                       $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']]] = $uid;
+
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]}<br />\n";
+                       // Refid set?
+                       if (($cacheArray['up_refid'][$cacheArray['back_level']] > 0) && ($cacheArray['up_refid'][$cacheArray['back_level']] != $uid) && (!empty($cacheArray['up_refid'][$cacheArray['back_level']]))) {
+                               // New userid?
+                               if ((isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) && (isset($cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]]))) {
+                                       // New userid!
+                                       $old = $uid;
+                                       $uid = $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]];
+                                       $minus = 1;
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - NEW UID!<br />\n";
+                               } // END - if
+
+                               // Check existence
+                               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                                       array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                               // Do we have no entry?
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
+                               if (SQL_NUMROWS($result) == 0) {
+                                       // Insert this level
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!<br />\n";
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid,level,refid) VALUES (%s,%s,%s)",
+                                               array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                                       // Move to next referral level and count his counter one up!
+                                       $cacheArray['back_level']++; UPDATE_REFBACK_TABLE($cacheArray['up_refid'][($cacheArray['back_level'] - 1)]);
+                               } // END - if
+
+                               // Do we have another level here?
+                               if ((($cacheArray['back_level']-$minus) > 0) && ($old > 0)) {
+                                       // Restore old one
+                                       $uid = $old;
+
+                                       // Shall we add this as well?
+                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                                               array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+
+                                       // Do we have no entry?
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
+                                       if (SQL_NUMROWS($result) == 0) {
+                                               // Insert this level
+                                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_refs (userid,level,refid) VALUES (%s,%s,%s)",
+                                                       array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+                                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!<br />\n";
+                                       } // END - if
+                               } // END - if
+                       } // END - if
+               } // END - while
+
+               // Free memory
+               SQL_FREERESULT($result_refid);
+       } // END - if
+
+       // When he has a referral...
+       if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) {
+               // Remove cache here
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!<br />\n";
+               if ($cacheInstance->cache_file("refback", true)) $cacheInstance->cache_destroy();
+               $cacheArray['back_cached'] = 1;
+       } // END - if
+
+       // "Walk" back here
+       $cacheArray['back_level']--;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']} - LEVEL!<br />\n";
+
+       // Fix empty refid
+       if (!isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) $cacheArray['up_refid'][$cacheArray['back_level']-1] = 0;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']-1]} - BACK!<br />\n";
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+}
+// "Getter" for array for user refs in given level
+function GET_USER_REFS ($uid, $level) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default is no refs and no nickname
+       $ADD = "";
+       $refs = array();
+
+       // Do we have nickname installed?
+       if (EXT_IS_ACTIVE("nickname")) {
+               $ADD = ", d.nickname";
+       } // END - if
+
+       // Get refs from database
+       $result = SQL_QUERY_ESC("SELECT r.id, r.refid, r.refback, r.points, d.status".$ADD."
+FROM "._MYSQL_PREFIX."_user_refs AS r
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON r.refid=d.userid
+WHERE r.userid=%s AND r.level=%s
+ORDER BY r.refid ASC",
+               array(bigintval($uid), bigintval($level)), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) > 0) {
+               // Fetch all entries
+               while ($row = SQL_FETCHARRAY($result)) {
+                       // Add row
+                       $refs[$row['id']] = $row;
+               } // END - while
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $refs;
+}
+// "Getter" for refback entry
+function GET_USER_REF_ENTRY ($id) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default data is nothing
+       $data = array();
+
+       // Secure id number
+       $id = bigintval($id);
+
+       // Get entry from database
+       $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM "._MYSQL_PREFIX."_user_refs WHERE id=%s AND userid=%s LIMIT 1",
+               array($id, $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch data
+               $data = SQL_FETCHARRAY($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return entry
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $data;
+}
+// Update refback percents (but with some sanity-checks!
+function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       // Default status is failed
+       $status['message'] = MEMBER_REFBACK_ERROR_GENERAL;
+
+       // Do some sanity-checks
+       if (!IS_MEMBER()) {
+               // No member!
+               $status['message'] = MEMBER_REFBACK_ERROR_NO_MEMBER;
+               return $status;
+       } elseif ("".$id."" != "".bigintval($id)."") {
+               // No number!
+               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER;
+               return $status;
+       } elseif (($percents < 0) || ($percents > 100)) {
+               // Percentage is not valid!
+               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE;
+               return $status;
+       }
+
+       // Get ref entry
+       $dummy = GET_USER_REF_ENTRY($id);
+
+       // Is this valid?
+       if (count($dummy) == 0) {
+               // ID does not belong to user!
+               $status['message'] = MEMBER_REFBACK_ERROR_ID_MISMATCH;
+               return $status;
+       } // END - if
+
+       // Revert german commata
+       $percents = REVERT_COMMA($percents);
+
+       // Update entry
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1",
+               array($percents, $id, $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Entry updated?
+       if (SQL_AFFECTEDROWS() < 1) {
+               // Entry not updated!
+               $status['message'] = MEMBER_REFBACK_ERROR_NOT_UPDATED;;
+               return $status;
+       } // END - if
+
+       // Prepare email content
+       $content = array(
+               'percents' => TRANSLATE_COMMA($percents),
+               'refid'    => $dummy['refid'],
+               'level'    => $dummy['level']
+       );
+
+       // Load member email template
+       $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, $GLOBALS['userid']);
+
+       // Send email to user
+       SEND_EMAIL($dummy['refid'], MEMBER_REFBACK_SUBJECT, $mail);
+
+       // Send admin notification
+       SEND_ADMIN_NOTIFICATION(ADMIN_REFBACK_SUBJECT, "admin_refback", $content, $GLOBALS['userid']);
+
+       // All fine!
+       $status['ok'] = true;
+
+       // Return status array
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+       return $status;
+}
+//
+?>
diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php
new file mode 100644 (file)
index 0000000..7a74af6
--- /dev/null
@@ -0,0 +1,169 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/10/2004 *
+ * ===============                              Last change: 07/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : register_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for register extension         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer register-Erweiterung     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function REGISTER_FILL_MUST_CONSTANTS()
+{
+       $result = SQL_QUERY("SELECT field_name, field_required FROM "._MYSQL_PREFIX."_must_register ORDER BY id", __FILE__, __LINE__);
+       while(list($name, $required) = SQL_FETCHROW($result))
+       {
+               $value = "";
+               if ($required == "Y") $value = "<FONT class=\\\"guest_failed\\\">&nbsp;(*)</FONT>";
+               $eval = "define('MUST_".strtoupper($name)."', \"".$value."\");";
+               eval($eval);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Also fill other constants
+       define('MUST_GENDER', "<FONT class=\"guest_failed\">&nbsp;(*)</FONT>");
+       define('MUST_ADDY'  , "<FONT class=\"guest_failed\">&nbsp;(*)</FONT>");
+       define('MUST_BIRTH' , "<FONT class=\"guest_failed\">&nbsp;(*)</FONT>");
+       define('MUST_MARKER', "<FONT class=\"guest_failed\">&nbsp;(*)</FONT>");
+}
+//
+function REGISTER_CHECK_REQUIRED_FIELDS(&$array)
+{
+       $ret = false;
+       foreach ($array as $key => $value)
+       {
+               $result = SQL_QUERY("SELECT field_required FROM "._MYSQL_PREFIX."_must_register WHERE field_name='".$key."' LIMIT 1", __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // "Must-line" found
+                       list($chk) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Check if extension country is not found (you have to enter the 2-chars long country code) or
+                       // if extensions is present check if country code was selected
+                       //         01              2         21    12             3         32    234     5      54    4               43    34                      4    4      5      5432    2      3                      3210
+                       $country = ((!EXT_IS_ACTIVE("country")) || ((EXT_IS_ACTIVE("country")) && (((empty($value)) && ($key == "cntry")) || (($key == "country_code") && (!empty($value)))) && (!empty($array['country_code']))));
+                       if ((empty($value)) && ($chk == "Y") && (!$country))
+                       {
+                               // Required field not set
+                               $array[$key] = "!";
+                               $ret = true;
+                       }
+               }
+       }
+       return $ret;
+}
+//
+function REGISTER_OUTPUT_REQUIRE_CHECK(&$array)
+{
+       $result = SQL_QUERY("SELECT field_name, field_required FROM "._MYSQL_PREFIX."_must_register ORDER BY id", __FILE__, __LINE__);
+       while(list($name, $required) = SQL_FETCHROW($result))
+       {
+               if (($array[$name] == "!") && ($required == "Y"))
+               {
+                       // Empty entry found
+                       $array[$name] = "";
+                       $eval = "\$OUT = REGISTER_".strtoupper($name)."_REQUIRED;";
+                       eval($eval);
+                       OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".$OUT."</SPAN></STRONG><br /><br />");
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+//
+function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false)
+{
+       global $_POST, $_CONFIG;
+       $OUT = "";
+
+       // Guests are mostly not interested in how many members has
+       // choosen an individual category
+       $AND = "WHERE visible='Y' ";
+       // Admins are allowed to see every category...
+       if (IS_ADMIN()) $AND = "";
+       $result = SQL_QUERY("SELECT id, cat, visible FROM "._MYSQL_PREFIX."_cats ".$AND." ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List alle visible modules (or all to the admin)
+               $SW = 2;
+               $OUT .= "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";
+               while (list($id, $cat, $visible) = SQL_FETCHROW($result))
+               {
+                       if (empty($_POST['cat'][$id])) $_POST['cat'][$id] = "";
+                       // Prepare array for the template
+                       $content = array(
+                               'sw'    => $SW,
+                               'cat'   => $cat,
+                               'def_y' => "",
+                               'def_n' => "",
+                               'id'    => $id,
+                       );
+
+                       if (($_POST['cat'][$id] == "Y") || (($_CONFIG['register_default'] == "Y") && (empty($_POST['cat'][$id])))) {
+                               $content['def_y'] = " checked=\"checked\"";
+                       } else {
+                               $content['def_n'] = " checked=\"checked\"";
+                       }
+
+                       // Load template and switch color
+                       $OUT .= LOAD_TEMPLATE("guest_cat_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               $OUT .= "</TABLE>\n";
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // No categories setted up so far...
+               $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, NO_CATEGORIES_VISIBLE);
+       }
+
+       if ($return)
+       {
+               // Return generated HTML code
+               return $OUT;
+       }
+        else
+       {
+               // Output directly (default)
+               OUTPUT_HTML($OUT);
+       }
+}
+//
+?>
diff --git a/inc/libs/removeip_functions.php b/inc/libs/removeip_functions.php
new file mode 100644 (file)
index 0000000..8965fbd
--- /dev/null
@@ -0,0 +1,154 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/01/2008 *
+ * ===============                              Last change: 10/01/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : removeip_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for removeip extension         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer removeip-Erweiterung     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// "Getter" for anonymous remote IP number
+function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) {
+       global $_CONFIG;
+
+       // Is config enabled?
+       if ($_CONFIG['removeip_anon_ip'] == "Y") {
+               // Switch way do we like?
+               switch ($_CONFIG['anonymous_ip']) {
+                       case "127.0.0.1": // mod_removeip style
+                       case "0.0.0.0": // Some people may prefer this...
+                               $remoteAddr = $_CONFIG['anonymous_ip'];
+                               break;
+
+                       case "RANDOM": // Pseudo-random IP number
+                               $remoteAddr = mt_rand(1,254).".".mt_rand(0,254).".".mt_rand(0,254).".".mt_rand(1,254);
+                               break;
+               } // END - switch
+       } // END - if
+
+       // Return it
+       return $remoteAddr;
+}
+// "Getter" for anonymous remote hostname
+function GET_ANONYMOUS_REMOTE_HOST ($remoteHost) {
+       global $_CONFIG;
+
+       // Is config enabled?
+       if ($_CONFIG['removeip_anon_host'] == "Y") {
+               // Set anon hostname
+               $remoteHost = "localhost.localnet";
+       } // END - if
+
+       // Return it
+       return $remoteHost;
+}
+// "Getter" for anonymous user agent
+function GET_ANONYMOUS_USER_AGENT ($userAgent) {
+       global $_CONFIG;
+
+       // Is config enabled?
+       if ($_CONFIG['removeip_anon_ua'] == "Y") {
+               // Set anon user agent
+               $userAgent = "-";
+       } // END - if
+
+       // Return it
+       return $userAgent;
+}
+// "Getter" for anonymous referer
+function GET_ANONYMOUS_REFERER ($referer) {
+       global $_CONFIG;
+
+       // Is config enabled?
+       if ($_CONFIG['removeip_anon_ref'] == "Y") {
+               // Set anon user agent
+               $referer = "-";
+       } // END - if
+
+       // Return it
+       return $referer;
+}
+// Adds informations about anonymity/privacy to the menu
+function REMOVEIP_ADD_INFOS () {
+       global $_CONFIG;
+
+       // "Base-privacy" is by default low (we add more later)
+       $anonymity = 0;
+
+       // Is some data anonymized?
+       if ($_CONFIG['removeip_anon_ip']   == "Y") $anonymity++;
+       if ($_CONFIG['removeip_anon_host'] == "Y") $anonymity++;
+       if ($_CONFIG['removeip_anon_ua']   == "Y") $anonymity++;
+       if ($_CONFIG['removeip_anon_ref']  == "Y") $anonymity++;
+
+       // Calculate anonymity level
+       $level = round($anonymity / 4 * 3);
+
+       // Set constant name suffix depending on that level
+       $suffix = "unsupported_{$level}";
+       switch ($level) {
+               case 0:
+                       $suffix = "none";
+                       break;
+
+               case 1:
+                       $suffix = "low";
+                       break;
+
+               case 2:
+                       $suffix = "medium";
+                       break;
+
+               case 3: // High level
+                       $suffix = "high";
+                       break;
+       } // END - while
+
+       // Construct constant name
+       $constantName = strtoupper(sprintf("REMOVEIP_LEVEL_%s", $suffix));
+
+       // Default message
+       $message = sprintf(REMOVEIP_UNKNOWN_LEVEL, $suffix);
+
+       // Is that constant there?
+       if (defined($constantName)) {
+               // Use that string
+               $message = constant($constantName);
+       } // END - if
+
+       // Output message in template
+       return LOAD_TEMPLATE("removeip_level", true, $message);
+}
+
+//
+?>
diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php
new file mode 100644 (file)
index 0000000..13f9a3b
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/24/2004 *
+ * ===============                              Last change: 11/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : rewrite_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for rewrite extension          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer rewrite-Erweiterung      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function REWRITE_LINKS($HTML)
+{
+       global $_CONFIG;
+
+       // Skip rewriting for the admin area (which search engine may enter here???)
+       if (ereg($GLOBALS['module'], $_CONFIG['rewrite_skip'])) return $HTML;
+
+       // Strip slashes with double-backslashes for the preg_replace() function
+       $URL = str_replace("/", "\\/", URL);
+
+       // Generate target URL
+       $target = URL."/cms/";
+
+       // Convert modules.php?module=...
+       $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML);
+
+       if (eregi(SERVER_URL, $test))
+       {
+               // Konvert URLs from my server
+               $URL = str_replace("/", "\\/", SERVER_URL);
+               $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", SERVER_URL."/cms/", $test);
+       }
+
+       // Strip slashes as above for the main URL
+       $target2 = str_replace("/", "\\/", $target);
+
+       // Action variable
+       $act = $target."\$1/act/";
+
+       // Convert &amp;|&action=...
+       $test = preg_replace("/".$target2."(.*)&amp;action=/i", $act, $test);
+
+       // "The same procedure as last variable"... now for &amp;what=
+       $wht = $target."\$1/wht/";
+       $target2 = str_replace("/", "\\/", $target);
+       $test = preg_replace("/".$target2."(.*)&amp;what=/i", $wht, $test);
+
+       if ((EXT_IS_ACTIVE("rallye")) && (eregi("rallye=", $test)))
+       {
+               // Replace data when rallye extension is active
+               // Add more if you need more like these entries
+               $REPLACE = array("rallye", "activate", "auto", "notify", "sub");
+               foreach ($REPLACE as $var)
+               {
+                       // This will replace "&amp;var=" to "/var/"
+                       $test = preg_replace("/&amp;".$var."=/i", "/".$var."/", $test);
+               }
+       }
+
+       // Simple from->to replacements
+       $REPLACE = array(
+               'search'  => array("u_id", "url", "page", "offset", "mid", "bid", "sub", "home"),
+               'replace' => array("u"   , "url", "page", "offset", "m"  , "b"  , "s"  , "h")
+       );
+
+       if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test)))
+       {
+               // Replace &amp;admin= with "/aid/"
+               $REPLACE['search'][]  = "admin";
+               $REPLACE['replace'][] = "aid";
+       }
+
+       // Replace all array elements through
+       foreach ($REPLACE['search'] as $k => $v)
+       {
+               if (eregi("$v=", $test))
+               {
+                       // Replace &amp;u_id= with /u/
+                       $test = preg_replace("/&amp;".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test);
+               }
+       }
+
+       // Repair missed &amp;what=??? entries
+       while (preg_match("/&amp;what=(.*)\/(.*)\/(.*)/i", $test))
+       {
+               $test = preg_replace("/&amp;what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $test);
+       }
+
+       // Return rewritten code
+       return $test;
+}
+//
+?>
diff --git a/inc/libs/security_functions.php b/inc/libs/security_functions.php
new file mode 100644 (file)
index 0000000..0f34c42
--- /dev/null
@@ -0,0 +1,228 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/20/2005 *
+ * ===============                              Last change: 09/20/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : security_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Secure all GET, POST and COOKIE data             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle GET, POST und COOKIE-Daten sichern          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+/**
+ * Function to secure input strings
+ *
+ * @param      $str    The unsecured string
+ * @param      $strip  Strip tags
+ * @return     $str    A (hopefully) secured string against XSS and other bad things
+ */
+function secureString ($str, $strip=true) {
+       // Shall we strip HTML code?
+       if ($strip) $str = strip_tags($str);
+
+       // Trim string
+       $str = trim($str);
+
+       // Encode in entities
+       $str = htmlentities($str, ENT_QUOTES);
+       return $str;
+}
+
+// Run only once this security check/exchange
+if (defined('__SECURITY')) return;
+
+// Fatal messages goes here
+global $FATAL;
+$FATAL = array();
+
+// Runtime/GPC quoting is off now...
+@set_magic_quotes_runtime(false);
+@ini_set('magic_quotes_gpc', false); // This may not work on some systems
+
+// Check if important arrays are found and define them if missing
+if (!isset($_SERVER)) {
+       global $_SERVER;
+       $_SERVER = $GLOBALS['_SERVER'];
+}
+
+if (!isset($_GET)) {
+       global $_GET;
+       $_GET = $GLOBALS['_GET'];
+}
+
+if (!isset($_POST)) {
+       global $_POST;
+       $_POST = $GLOBALS['_POST'];
+}
+
+if (!isset($_COOKIE)) {
+       global $_COOKIE;
+       $_COOKIE = $GLOBALS['_COOKIE'];
+}
+
+// Include IP-Filter here
+//require("/usr/share/php/ipfilter.php");
+
+// Generate arrays which holds the relevante chars to replace
+global $SEC_CHARS, $URL_CHARS;
+$SEC_CHARS = array(
+       // The chars we are looking for...
+       'from' => array("{", "}", "/", ".", "'", "$", "(", ")", '{--', '--}', "%", ";", "[", "]", ":", "--"),
+       // ... and we will replace to.
+       'to'   => array(
+               "{OPEN_ANCHOR2}",
+               "{CLOSE_ANCHOR2}",
+               "{SLASH}",
+               "{DOT}",
+               '{QUOT}',
+               "{DOLLAR}",
+               "{OPEN_ANCHOR}",
+               "{CLOSE_ANCHOR}",
+               "{OPEN_TEMPLATE}",
+               "{CLOSE_TEMPLATE}",
+               "{PER}",
+               "{SEMI}",
+               "{OPEN_INDEX}",
+               "{CLOSE_INDEX}",
+               "{DBL_DOT}",
+               "{COMMENT}"
+       ),
+);
+
+// Characters allowed in URLs
+//
+// Note: Do not replace 'to' with 'from' and vise-versa! When you do this all booked URLs will be
+//       rejected because of the {SLASH}, {DOT} and all below listed items inside the URL.
+$URL_CHARS = array(
+       // Search for these secured characters
+       'to'   => array("{SLASH}", "{DOT}", "{PER}", "{DBL_DOT}", "{COMMENT}"),
+       // Replace with these characters
+       'from' => array("/", ".", "%", ":", "--")
+);
+
+// Overworked security part:
+if (is_array($_GET)) {
+       foreach ($_GET as $seckey => $secvalue) {
+               if (is_array($secvalue)) {
+                       // Throw arrays away...
+                       unset($_GET[$seckey]);
+               } else {
+                       // Only variables are allowed (non-array) but we secure them all!
+                       foreach ($SEC_CHARS['from'] as $key => $char) {
+                               // Pass all through
+                               $_GET[$seckey] = str_replace($char  , $SEC_CHARS['to'][$key], $_GET[$seckey]);
+                       }
+
+                       // Strip all other out
+                       $_GET[$seckey] = strip_tags($_GET[$seckey]);
+               }
+       }
+}
+
+if (basename($_SERVER['PHP_SELF']) != "install.php") {
+       // And POST data
+       foreach ($_POST as $seckey => $secvalue) {
+               if (!is_array($secvalue)) {
+                       // Only variables are allowed (non-array) to be secured...
+                       foreach ($SEC_CHARS['from'] as $key => $char) {
+                               // Pass all through
+                               $_POST[$seckey] = str_replace($char  , $SEC_CHARS['to'][$key], $_POST[$seckey]);
+                       }
+
+                       // Strip all other out
+                       $_POST[$seckey] = strip_tags($_POST[$seckey]);
+               }
+       }
+
+       // ... and finally cookies
+       foreach ($_COOKIE as $seckey => $secvalue) {
+               if (is_array($secvalue)) {
+                       // Throw arrays away...
+                       unset($_COOKIE[$seckey]);
+               } else {
+                       // Only variables are allowed (non-array) but we secure them all!
+                       foreach ($SEC_CHARS['from'] as $key => $char) {
+                               // Pass all through
+                               $_COOKIE[$seckey] = str_replace($char  , $SEC_CHARS['to'][$key], $_COOKIE[$seckey]);
+                       }
+
+                       // Strip all other out
+                       $_COOKIE[$seckey] = strip_tags($_COOKIE[$seckey]);
+               }
+       }
+}
+
+// Activate caching or transparent compressing when it is not already done
+if (!defined('_OB_CACHING')) {
+       if (phpversion() >= '4.0.4pl1' && (strstr(getenv('HTTP_USER_AGENT'),'compatible') || (strstr(getenv('HTTP_USER_AGENT'), "Mozilla")))) {
+               if ((extension_loaded('zlib')) && (function_exists('ob_start'))) {
+                       // Start caching
+                       define('_OB_CACHING', "on");
+                       ob_start();
+               } else {
+                       // Extension not loaded or required function is missing
+                       define('_OB_CACHING', "404");
+               }
+       } else {
+               // Old PHP version
+               define('_OB_CACHING', "old");
+       }
+}
+
+// At last secure the $_SERVER['PHP_SELF'] element
+$_SERVER['PHP_SELF'] = secureString($_SERVER['PHP_SELF']);
+
+// Split it up into path and filename
+$SELF_DIR  = dirname($_SERVER['PHP_SELF']);
+$SELF_FILE = basename($_SERVER['PHP_SELF']);
+
+// Check for a .php inside the $SELF_DIR...
+while (ereg(".php", $SELF_DIR)) {
+       // Correct the dirname
+       $SELF_DIR = substr($SELF_DIR, 0, (strpos($SELF_DIR, ".php") + 4));
+       // Rewrite filename...
+       $SELF_FILE = basename($SELF_DIR);
+       // ... and dirname
+       $SELF_DIR = dirname($SELF_DIR);
+}
+
+// Put both together again and let's pray it is secured now...
+$_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE;
+
+// Remove uneccessary variables
+unset($SELF_DIR);
+unset($SELF_FILE);
+
+// Security system loaded...
+define('__SECURITY', "1");
+
+//
+?>
diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php
new file mode 100644 (file)
index 0000000..3d2f171
--- /dev/null
@@ -0,0 +1,633 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/23/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : sponsor_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for the sponsor area                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer den Sponsorenbereich             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+//
+function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_STATUS=false)
+{
+       $SAVE = true; $UPDATE = false; $skip = false; $ALREADY = false;
+       $ret = "unused";
+
+       // Skip these entries
+       $SKIPPED = array(
+               'ok', 'edit', 'terms', 'pay_type'
+       );
+
+       // Save sponsor data
+       $DATA = array(
+               'keys'   => array(),
+               'values' => array()
+       );
+
+       // Check if sponsor already exists
+       foreach ($POST as $k => $v)
+       {
+               if (!(array_search($k, $SKIPPED) > -1))
+               {
+                       // Check only posted input entries not the submit button
+                       switch ($k)
+                       {
+                       case "email":
+                               $ALREADY = false;
+                               if (!VALIDATE_EMAIL($v))
+                               {
+                                       // Email address is not valid
+                                       $SAVE = false;
+                               }
+                                else
+                               {
+                                       // Do we want to add a new sponsor or update his data?
+                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE email='%s' LIMIT 1",
+                                        array($POST['email']), __FILE__, __LINE__);
+
+                                       // Is a sponsor alread in the db?
+                                       if (SQL_NUMROWS($result) == 1)
+                                       {
+                                               // Free memory
+                                               SQL_FREERESULT($result);
+
+                                               // Yes, he is!
+                                               if (($_GET['what'] == "add_sponsor") || ($NO_UPDATE))
+                                               {
+                                                       // Already found!
+                                                       $ALREADY = true;
+                                               }
+                                                else
+                                               {
+                                                       // Update his data
+                                                       $UPDATE = true;
+                                               }
+                                       }
+                               }
+                               break;
+
+                       case "pass1":
+                               $k = ""; $v = "";
+                               break;
+
+                       case "pass2":
+                               $k = "password"; $v = md5($v);
+                               break;
+
+                       case "url":
+                               if (!VALIDATE_URL($v)) $SAVE = false;
+                               break;
+
+                       default:
+                               // Test if there is are time selections
+                               $TEST = substr($k, -3);
+                               if ((($TEST == "_ye") || ($TEST == "_mo") || ($TEST == "_we") || ($TEST == "_da") || ($TEST == "_ho") || ($TEST == "_mi") || ($TEST == "_se")) && (!empty($v)))
+                               {
+                                       // Found a multi-selection for timings?
+                                       $TEST = substr($k, 0, -3);
+                                       if ((!empty($POST[$TEST."_ye"])) && (!empty($POST[$TEST."_mo"])) && (!empty($POST[$TEST."_we"])) && (!empty($POST[$TEST."_da"])) && (!empty($POST[$TEST."_ho"])) && (!empty($POST[$TEST."_mi"])) && (!empty($POST[$TEST."_se"])) && ($TEST != $TEST2))
+                                       {
+                                               // Generate timestamp
+                                               $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST);
+                                               $DATA['keys'][] = $TEST;
+                                               $DATA['values'][] = $POST[$TEST];
+
+                                               // Remove data from array
+                                               unset($POST[$TEST."_ye"]);
+                                               unset($POST[$TEST."_mo"]);
+                                               unset($POST[$TEST."_we"]);
+                                               unset($POST[$TEST."_da"]);
+                                               unset($POST[$TEST."_ho"]);
+                                               unset($POST[$TEST."_mi"]);
+                                               unset($POST[$TEST."_se"]);
+
+                                               // Skip adding
+                                               $k = ""; $skip = true; $TEST2 = $TEST;
+                                       }
+                               }
+                                else
+                               {
+                                       $skip = false; $TEST2 = "";
+                               }
+                               break;
+                       }
+
+                       if ((!empty($k)) && ($skip == false))
+                       {
+                               // Add data
+                               $DATA['keys'][] = $k; $DATA['values'][] = $v;
+                       }
+               }
+       }
+
+       // Save sponsor?
+       if ($SAVE)
+       {
+               // Default is no force even when a guest want to abuse this force switch
+               if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0;
+
+               // SQL and message string is empty by default
+               $SQL = ""; $MSG = "";
+
+               // Update?
+               if ($UPDATE)
+               {
+                       // Update his data
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET ";
+                       foreach ($DATA['keys'] as $k => $v)
+                       {
+                               $SQL .= $v."='%s', ";
+                       }
+
+                       // Remove last ", " from SQL string
+                       $SQL = substr($SQL, 0, -2)." WHERE id='%s' LIMIT 1";
+                       $DATA['values'][] = bigintval($_GET['id']);
+
+                       // Generate message
+                       $MSG = SPONSOR_SET_MESSAGE(ADMIN_SPONSOR_UPDATED, "updated", $MSGs);
+                       $ret = "updated";
+               }
+                elseif ((!$ALREADY) || (($POST['force'] == "1") && (IS_ADMIN())))
+               {
+                       // Add new sponsor, first add more data
+                       $DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time();
+                       $DATA['keys'][] = "status";
+                       if ((!$NO_UPDATE) && (IS_ADMIN()) && ($_GET['what'] == "add_sponsor"))
+                       {
+                               // Only allowed for admin
+                               $DATA['values'][] = "PENDING";
+                       }
+                        else
+                       {
+                               // Guest area
+                               $DATA['values'][] = "UNCONFIRMED";
+
+                               // Generate hash code
+                               $DATA['keys'][] = "hash";
+                               $DATA['values'][] = md5($_COOKIE['PHPSESSID'].":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time());
+                               $DATA['keys'][] = "remote_addr";
+                               $DATA['values'][] = GET_REMOTE_ADDR();
+                       }
+
+                       // Implode all data into strings
+                       $KEYS   = implode(", "  , $DATA['keys']);
+                       $VALUES = str_repeat("%s', '", count($DATA['values']) - 1);
+
+                       // Generate string
+                       $SQL = "INSERT INTO "._MYSQL_PREFIX."_sponsor_data (".$KEYS.") VALUES('".$VALUES."%s')";
+
+                       // Generate message
+                       $MSG = SPONSOR_SET_MESSAGE(ADMIN_SPONSOR_ADDED, "added", $MSGs);
+                       $ret = "added";
+               }
+                elseif ((!$NO_UPDATE) && (IS_ADMIN()))
+               {
+                       // Add all data as hidden data
+                       $OUT = "";
+                       foreach ($POST as $k => $v)
+                       {
+                               // Do not add 'force' !
+                               if ($k != "force")
+                               {
+                                       $OUT .= "<INPUT type=\"hidden\" name=\"".$k."\" value=\"".stripslashes($v)."\">\n";
+                               }
+                       }
+                       define('__HIDDEN_DATA', $OUT);
+                       define('__EMAIL'      , $POST['email']);
+
+                       // Ask for adding a sponsor with same email address
+                       LOAD_TEMPLATE("admin_add_sponsor_already");
+                       return;
+               }
+                else
+               {
+                       // Already added!
+                       $MSG = SPONSOR_ALREADY_FOUND_1.$POST['email'].SPONSOR_ALREADY_FOUND_2;
+                       $ret = "already";
+               }
+
+               if (!empty($SQL))
+               {
+                       // Run SQL command
+                       $result = SQL_QUERY_ESC($SQL, $DATA['values'], __FILE__, __LINE__);
+               }
+
+               // Output message
+               if ((!$NO_UPDATE) && (IS_ADMIN()))
+               {
+                       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+               }
+       }
+        else
+       {
+               // Error found!
+               $MSG = SPONSOR_SET_MESSAGE(SPONSOR_DATA_NOT_SAVED, "failed", $MSGs);
+               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+       }
+
+       // Shall we return the status?
+       if ($RET_STATUS) return $ret;
+}
+//
+function SPONSOR_TRANSLATE_STATUS($status)
+{
+       switch ($status)
+       {
+       case "UNCONFIRMED":
+               $ret = ACCOUNT_UNCONFIRMED;
+               break;
+
+       case "CONFIRMED":
+               $ret = ACCOUNT_CONFIRMED;
+               break;
+
+       case "LOCKED":
+               $ret = ACCOUNT_LOCKED;
+               break;
+
+       case "PENDING":
+               $ret = ACCOUNT_PENDING;
+               break;
+
+       case "EMAIL":
+               $ret = ACCOUNT_EMAIL;
+               break;
+
+       default:
+               $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
+               break;
+       }
+       return $ret;
+}
+// Search for an email address in the database
+function SPONSOR_FOUND_EMAIL_DB($email)
+{
+       // Default status is failed (as it is always be...)
+       $ret = false;
+
+       // Check for email (and secure input)
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE email='%s' LIMIT 1",
+        array($email), __FILE__, __LINE__);
+
+       // Do we already have the provided email address in our DB?
+       if (SQL_NUMROWS($result) == 1) $ret = true;
+
+       // Return result
+       return $ret;
+}
+//
+function SPONSOR_SET_MESSAGE($msg, $pos, $array)
+{
+       // Check if the requested message was found in array
+       if (isset($array[$pos]))
+       {
+               // ... if yes then use it!
+               $ret = $array[$pos];
+       }
+        else
+       {
+               // ... else use default message
+               $ret = $msg;
+       }
+
+       // Return result
+       return $ret;
+}
+//
+function IS_SPONSOR()
+{
+       global $_COOKIE;
+       // Failed...
+       $ret = false;
+       if ((!empty($_COOKIE['sponsorid'])) && (!empty($_COOKIE['sponsorpass'])))
+       {
+               // Check cookies against database records...
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' AND password='%s' AND status='CONFIRMED' LIMIT 1",
+ array(bigintval($_COOKIE['sponsorid']), $_COOKIE['sponsorpass']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // All is fine
+                       $ret = true;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+
+       // Return status
+       return $ret;
+}
+//
+function GENERATE_SPONSOR_MENU($current)
+{
+       $OUT = "";
+       $WHERE = " AND active='Y'";
+       if (IS_ADMIN()) $WHERE = "";
+
+       // Load main menu entries
+       $result_main = SQL_QUERY("SELECT action, title FROM "._MYSQL_PREFIX."_sponsor_menu
+WHERE (what='' OR what IS NULL) ".$WHERE."
+ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) > 0)
+       {
+               // Load every menu and it's sub menus
+               while(list($action, $title_main) = SQL_FETCHROW($result_main))
+               {
+                       // Load sub menus
+                       $result_sub = SQL_QUERY_ESC("SELECT what, title FROM "._MYSQL_PREFIX."_sponsor_menu
+WHERE action='%s' AND what != '' AND what IS NOT NULL ".$WHERE."
+ORDER BY sort", array($action), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result_sub) > 0)
+                       {
+                               // Load sub menus
+                               $SUB = "";
+                               while(list($what, $title_sub) = SQL_FETCHROW($result_sub))
+                               {
+                                       // Check if current selected menu is matching the loaded one
+                                       if ($current == $what) $title_sub = "<STRONG>".$title_sub."</STRONG>";
+
+                                       // Prepare data for the sub template
+                                       $content = array(
+                                               'what'  => $what,
+                                               'title' => $title_sub
+                                       );
+
+                                       // Load row template
+                                       $SUB .= LOAD_TEMPLATE("sponsor_what", true, $content);
+                               }
+
+                               // Prepare data for the main template
+                               $content = array(
+                                       'title' => $title_main,
+                                       'menu'  => $SUB
+                               );
+
+                               // Load menu template
+                               $OUT .= LOAD_TEMPLATE("sponsor_action", true, $content);
+                       }
+                        else
+                       {
+                               // No sub menus active
+                               $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_SUB_MENUS_ACTIVE);
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result_sub);
+               }
+       }
+        else
+       {
+               // No main menus active
+               $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_MAIN_MENUS_ACTIVE);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_main);
+
+       // Return content
+       return $OUT;
+}
+//
+function GENERATE_SPONSOR_CONTENT($what)
+{
+       global $_CONFIG;
+       $OUT = "";
+       $FILE = sprintf("%sinc/modules/sponsor/%s.php", PATH, $what);
+       if (FILE_READABLE($FILE)) {
+               // Every sponsor action will output nothing directly. It will be written into $OUT!
+               require_once($FILE);
+       } else {
+               // File not found!
+               $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_CONTENT_404_1.$what.SPONSOR_CONTENT_404_2);
+       }
+
+       // Return content
+       return $OUT;
+}
+//
+function UPDATE_SPONSOR_LOGIN()
+{
+       global $_COOKIE, $_CONFIG;
+
+       // Check if cookies are set
+       if ((empty($_COOKIE['sponsorid'])) || (empty($_COOKIE['sponsorpass']))) return false;
+
+       // Calculate cookie lifetime, maybe we have to change this so the admin can setup a
+       // seperate timeout for these two cookies?
+       $life = (time() + $_CONFIG['online_timeout']);
+
+       // Is confirmed so both is fine and we can continue with login procedure
+       $login = ((setcookie("sponsorid"  , bigintval($_COOKIE['sponsorid']), $life, COOKIE_PATH)) &&
+                 (setcookie("sponsorpass", $_COOKIE['sponsorpass']         , $life, COOKIE_PATH)));
+
+       // Update database?
+       if ($login)
+       {
+               // Update last online timestamp
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data
+SET last_online='".time()."'
+WHERE id='%s' AND password='%s' LIMIT 1",
+ array(bigintval($_COOKIE['sponsorid']), $_COOKIE['sponsorpass']), __FILE__, __LINE__);
+       }
+
+       // Return status
+       return $login;
+}
+//
+function SPONSOR_SAVE_DATA($POST, $content)
+{
+       global $_COOKIE, $_SERVER, $_GET;
+       $EMAIL = false;
+
+       // Unsecure data which we don't want
+       $UNSAFE = array('password', 'id', 'remote_addr', 'sponsor_created', 'last_online', 'status', 'ref_count',
+                       'points_amount', 'points_used', 'refid', 'hash', 'last_pay', 'last_curr', 'pass_old',
+                       'ok', 'pass1', 'pass2');
+
+       // Set default message ("not saved")
+       $MSG = SPONSOR_ACCOUNT_DATA_NOT_SAVED;
+
+       // Check for submitted passwords
+       if ((!empty($_POST['pass1'])) && (!empty($_POST['pass2'])))
+       {
+               // Are both passwords the same?
+               if ($_POST['pass1'] == $_POST['pass2'])
+               {
+                       // Okay, then set password and remove pass1 and pass2
+                       $_POST['password'] = md5($_POST['pass1']);
+               }
+       }
+
+       // Remove all (maybe spoofed) unsafe data from array
+       foreach ($UNSAFE as $remove)
+       {
+               unset($POST[$remove]);
+       }
+
+       // This array is for the submitted data which we will use with the SQL_QUERY_ESC() function to
+       // secure the data
+       $DATA = array();
+
+       // Prepare SQL string
+       $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET";
+       foreach ($POST as $key => $value)
+       {
+               // Mmmmm, too less security here???
+               $SQL   .= " ".strip_tags($key)."='%s',";
+
+               // We will secure this later inside the SQL_QUERY_ESC() function
+               $DATA[] = strip_tags($value);
+
+               // Compile {SLASH} and so on for the email templates
+               $POST[$key] = COMPILE_CODE($value);
+       }
+
+       // Check if email has changed
+       if ((!empty($content['email'])) && (!empty($POST['email'])))
+       {
+               if ($content['email'] != $POST['email'])
+               {
+                       // Change email address
+                       $EMAIL = true;
+
+                       // Okay, has changed then add status with UNCONFIRMED and new hash code
+                       $SQL .= " status='EMAIL', hash='%s',";
+
+                       // Generate hash code
+                       $HASH = md5($_COOKIE['PHPSESSID'].":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time());
+                       $DATA[] = $HASH;
+               }
+       }
+
+       // Remove last commata
+       $SQL = substr($SQL, 0, -1);
+
+       // Add SQL tail data
+       $SQL .= " WHERE id='%s' AND password='%s' LIMIT 1";
+       $DATA[] = bigintval($_COOKIE['sponsorid']);
+       $DATA[] = $_COOKIE['sponsorpass'];
+
+       // Saving data was completed... ufff...
+       switch ($_GET['what'])
+       {
+       case "account": // Change account data
+               if ($EMAIL)
+               {
+                       $MSG   = SPONSOR_ACCOUNT_EMAIL_CHANGED;
+                       $templ = "admin_sponsor_change_email";
+                       $subj  = ADMIN_SPONSOR_ACC_EMAIL_SUBJ;
+               }
+                else
+               {
+                       $MSG   = SPONSOR_ACCOUNT_DATA_SAVED;
+                       $templ = "admin_sponsor_change_data";
+                       $subj  = ADMIN_SPONSOR_ACC_DATA_SUBJ;
+               }
+               break;
+
+       case "settings": // Change settings
+               // Translate some data
+               $content['receive']  = TRANSLATE_YESNO($content['receive_warnings']);
+               $content['interval'] = CREATE_FANCY_TIME($content['warning_interval']);
+
+               // Set message template and subject for admin
+               $MSG   = SPONSOR_SETTINGS_SAVED;
+               $templ = "admin_sponsor_settings";
+               $subj  = ADMIN_SPONSOR_SETTINGS_SUBJ;
+               break;
+
+       default: // Unknown sponsor what value!
+               $MSG = SPONSOR_UNKNOWN_WHAT_1.$_GET['what'].SPONSOR_UNKNOWN_WHAT_2;
+               $templ = ""; $subj = "";
+               break;
+       }
+
+       if (SQL_AFFECTEDROWS() == 1)
+       {
+               if (!empty($templ) && !empty($subj))
+               {
+                       // Run SQL command and check for success
+                       $result = SQL_QUERY_ESC($SQL, $DATA, __FILE__, __LINE__);
+
+                       // Add all data to content
+                       global $DATA;
+                       $DATA = $POST;
+
+                       // Change some data
+                       if (isset($content['gender'])) $content['gender'] = TRANSLATE_GENDER($content['gender']);
+                       if (isset($DATA['gender']))    $DATA['gender']    = TRANSLATE_GENDER($DATA['gender']);
+                       if (isset($content['receive_warnings'])) $DATA['receive']     = TRANSLATE_YESNO($POST['receive_warnings']);
+                       if (isset($content['warning_interval'])) $DATA['interval']    = CREATE_FANCY_TIME($POST['warning_interval']);
+
+                       // Send email to admins
+                       SEND_ADMIN_NOTIFICATION($subj, $templ, $content);
+
+                       // Shall we send mail to the sponsor's new email address?
+                       if ($content['receive_warnings'] == "Y")
+                       {
+                               // Okay send email with confirmation link to new address and with no confirmation link
+                               // to the old address
+
+                               // First to old address
+                               switch ($_GET['what'])
+                               {
+                               case "account": // Change account data
+                                       $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content);
+                                       SEND_EMAIL($content['email'], SPONSOR_ACC_DATA_SUBJ, $email_msg);
+
+                                       if ($EMAIL)
+                                       {
+                                               // Add hash code to content array
+                                               $content['hash'] = $HASH;
+
+                                               // Second mail goes to the new address
+                                               $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_email", $content);
+                                               SEND_EMAIL($content['email'], SPONSOR_ACC_EMAIL_SUBJ, $email_msg);
+                                       }
+                                       break;
+
+                               case "settings": // Change settings
+                                       // Send email
+                                       $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_settings", $content);
+                                       SEND_EMAIL($content['email'], SPONSOR_SETTINGS_SUBJ, $email_msg);
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       // Return final message
+       return $MSG;
+}
+//
+?>
diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php
new file mode 100644 (file)
index 0000000..f83d4fa
--- /dev/null
@@ -0,0 +1,1465 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ===============                              Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : surfbar_functions.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for surfbar                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer die Surfbar                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// -----------------------------------------------------------------------------
+//                               Admin functions
+// -----------------------------------------------------------------------------
+//
+// Admin has added an URL with given user id and so on
+function SURFBAR_ADMIN_ADD_URL ($url, $limit) {
+       // Do some pre-checks
+       if (!IS_ADMIN()) {
+               // Not an admin
+               return false;
+       } elseif (!VALIDATE_URL($url)) {
+               // URL invalid
+               return false;
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, "0")) {
+               // URL already found in surfbar!
+               return false;
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
+               // No more allowed!
+               return false;
+       } elseif ("".bigintval($limit)."" != "".$limit."") {
+               // Invalid amount entered
+               return false;
+       }
+
+       // Register the new URL
+       return SURFBAR_REGISTER_URL($url, "0", "ACTIVE", "unlock", $limit);
+}
+// Admin unlocked an email so we can migrate the URL
+function SURFBAR_ADMIN_MIGRATE_URL ($url, $uid) {
+       // Do some pre-checks
+       if (!IS_ADMIN()) {
+               // Not an admin
+               return false;
+       } elseif (!VALIDATE_URL($url)) {
+               // URL invalid
+               return false;
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, $uid)) {
+               // URL already found in surfbar!
+               return false;
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS($uid)) {
+               // No more allowed!
+               return false;
+       }
+
+       // Register the new URL
+       return SURFBAR_REGISTER_URL($url, $uid, "MIGRATED", "migrate");
+}
+// Admin function for unlocking URLs
+function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
+       // Is this an admin or invalid array?
+       if (!IS_ADMIN()) {
+               // Not admin or invalid IDs array
+               return false;
+       } elseif (!is_array($IDs)) {
+               // No array
+               return false;
+       } elseif (count($IDs) == 0) {
+               // Empty array
+               return false;
+       }
+
+       // Set to true to make AND expression valid if first URL got unlocked
+       $done = true;
+
+       // Update the status for all ids
+       foreach ($IDs as $id => $dummy) {
+               // Test all ids through (ignores failed)
+               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "ACTIVE")));
+       } // END - if
+
+       // Return total status
+       return $done;
+}
+// Admin function for rejecting URLs
+function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) {
+       // Is this an admin or invalid array?
+       if (!IS_ADMIN()) {
+               // Not admin or invalid IDs array
+               return false;
+       } elseif (!is_array($IDs)) {
+               // No array
+               return false;
+       } elseif (count($IDs) == 0) {
+               // Empty array
+               return false;
+       }
+
+       // Set to true to make AND expression valid if first URL got unlocked
+       $done = true;
+
+       // Update the status for all ids
+       foreach ($IDs as $id => $dummy) {
+               // Test all ids through (ignores failed)
+               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "REJECTED")));
+       } // END - if
+
+       // Return total status
+       return $done;
+}
+//
+// -----------------------------------------------------------------------------
+//                               Member functions
+// -----------------------------------------------------------------------------
+//
+// Member has added an URL
+function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
+       global $_CONFIG;
+
+       // Do some pre-checks
+       if (!IS_MEMBER()) {
+               // Not a member
+               return false;
+       } elseif (!VALIDATE_URL($url)) {
+               // URL invalid
+               return false;
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, $GLOBALS['userid'])) {
+               // URL already found in surfbar!
+               return false;
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS($GLOBALS['userid'])) {
+               // No more allowed!
+               return false;
+       } elseif ("".bigintval($limit)."" != "".$limit."") {
+               // Invalid amount entered
+               return false;
+       }
+
+       // Register the new URL
+       return SURFBAR_REGISTER_URL($url, $GLOBALS['userid'], "PENDING", "reg", $limit);
+}
+// Create list of actions depending on status for the user
+function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
+       // Load all actions in an array for given status
+       $actionArray = SURFBAR_GET_ACTION_ARRAY($status);
+
+       // Init HTML code
+       $OUT = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">
+<tr>\n";
+
+       // Calculate width
+       $width = round(100 / count($actionArray));
+
+       // "Walk" through all actions and create forms
+       foreach ($actionArray as $actionId=>$action) {
+               // Add form for this action
+               $OUT .= sprintf("       <td align=\"center\" width=\"%d%%\">
+               <form action=\"".URL."/modules.php?module=login&amp;what=surfbar_list\" method=\"post\" style=\"padding-bottom:0px\">
+                       <input type=\"hidden\" name=\"id\" value=\"%s\" />
+                       <input type=\"hidden\" name=\"action\" value=\"%s\" />
+                       <input type=\"submit\" class=\"member_submit\" name=\"ok\" title=\"{--MEMBER_SURFBAR_ACTION_%s_TITLE--}\" value=\"{--MEMBER_SURFBAR_ACTION_%s_SUBMIT--}\" />
+               </form>
+       </td>\n",
+                       $width,
+                       bigintval($urlId),
+                       strtolower($action),
+                       strtoupper($action),
+                       strtoupper($action)
+               );
+       } // END - foreach
+
+       // Close table
+       $OUT .= "</tr>
+</table>\n";
+
+       // Return code
+       return $OUT;
+}
+// Do the member form request
+function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
+       global $SURFBAR_CACHE;
+
+       // By default no action is performed
+       $performed = false;
+
+       // Is this a member?
+       if (!IS_MEMBER()) {
+               // No member!
+               return false;
+       } elseif ((!isset($formData['id'])) || (!isset($formData['action']))) {
+               // Important form elements are missing!
+               return false;
+       } elseif (!isset($URLs[$formData['id']])) {
+               // ID not found in cache
+               return false;
+       } elseif (!SURFBAR_VALIDATE_MEMBER_ACTION_STATUS($formData['action'], $URLs[$formData['id']]['status'])) {
+               // Action not allowed for current URL status
+               return false;
+       }
+
+       // Create the function name for selected action
+       $functionName = sprintf("SURFBAR_MEMBER_%s_ACTION", strtoupper(SQL_ESCAPE($formData['action'])));
+
+       // Is the function there?
+       if (function_exists($functionName)) {
+               // Add new status
+               $URLs[$formData['id']]['new_status'] = $SURFBAR_CACHE['new_status'];
+
+               // Extract URL data for call-back
+               $urlData = array($URLs[$formData['id']]);
+
+               // Action found so execute it
+               $performed = call_user_func_array($functionName, $urlData);
+       } else {
+               // Log invalid request
+               DEBUG_LOG(__FUNCTION__.": action={$formData['action']},id={$formData['id']},function={$functionName}");
+       }
+
+       // Return status
+       return $performed;
+}
+// Validate if the requested action can be performed on current URL status
+function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) {
+       global $SURFBAR_CACHE;
+
+       // Search for the requested action/status combination in database
+       $result = SQL_QUERY_ESC("SELECT new_status FROM "._MYSQL_PREFIX."_surfbar_actions WHERE action='%s' AND status='%s' LIMIT 1",
+               array($action, $status), __FILE__, __LINE__);
+
+       // Is the entry there?
+       $isValid = (SQL_NUMROWS($result) == 1);
+
+       // Fetch the new status if found
+       if ($isValid) {
+               list($SURFBAR_CACHE['new_status']) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return status
+       return $isValid;
+}
+//
+// -----------------------------------------------------------------------------
+//                               Member actions
+// -----------------------------------------------------------------------------
+//
+// Retreat an URL
+function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) {
+       // Create the data array for next function call
+       $data = array(
+               $urlData['id'] => $urlData
+       );
+
+       // Simply change the status here
+       return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data);
+}
+// Book an URL now (from migration)
+function SURFBAR_MEMBER_BOOKNOW_ACTION ($urlData) {
+       // Create the data array for next function call
+       $data = array(
+               $urlData['id'] => $urlData
+       );
+
+       // Simply change the status here
+       return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data);
+}
+//
+// -----------------------------------------------------------------------------
+//                           Self-maintenance functions
+// -----------------------------------------------------------------------------
+//
+// Main function
+function SURFBAR_HANDLE_SELF_MAINTENANCE () {
+       // Handle URLs which limit has depleted so we can stop them
+       SURFBAR_HANDLE_DEPLETED_VIEWS();
+
+       // Handle low-points amounts
+       SURFBAR_HANDLE_LOW_POINTS();
+}
+// Handle URLs which limit has depleted
+function SURFBAR_HANDLE_DEPLETED_VIEWS () {
+       // Get all URLs
+       $urlArray = SURFBAR_GET_URL_DATA("0", "views_max", "id", "ASC", "id", " AND views_allowed>0 AND status='ACTIVE'");
+
+       // Do we have some entries?
+       if (count($urlArray) > 0) {
+               // Then handle all!
+               foreach ($urlArray as $id => $urlData) {
+                       // Backup data
+                       $data = $urlData;
+
+                       // Rewrite array for next call
+                       $urlData[$id] = $data;
+
+                       // Handle the status
+                       SURFBAR_CHANGE_STATUS($id, "ACTIVE", "DEPLETED", $urlData);
+               } // END - foreach
+       } // END - if
+}
+// Alert users which have URLs booked and are low on points amount
+function SURFBAR_HANDLE_LOW_POINTS () {
+       global $_CONFIG;
+
+       // Get all userids
+       $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS($_CONFIG['surfbar_warn_low_points']);
+
+       // "Walk" through all URLs
+       foreach ($UIDs['uid'] as $uid => $dummy) {
+               // Is the last notification far enougth away to notify again?
+               if ((time() - $UIDs['notified'][$uid]) >= $_CONFIG['surfbar_low_interval']) {
+                       // Prepare content
+                       $content = array(
+                               'uid'      => $uid,
+                               'low'      => TRANSLATE_COMMA($_CONFIG['surfbar_warn_low_points']),
+                               'points'   => TRANSLATE_COMMA($UIDs['points'][$uid]),
+                               'notified' => MAKE_DATETIME($UIDs['notified'][$uid]),
+                               'interval' => CREATE_FANCY_TIME($_CONFIG['surfbar_low_interval'])
+                       );
+
+                       // Notify this user
+                       SURFBAR_NOTIFY_USER("low_points", $content);
+
+                       // Update last notified
+                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1",
+                               array($uid), __FILE__, __LINE__);
+               } // END - if
+       } // END - foreach
+}
+//
+// -----------------------------------------------------------------------------
+//                               Generic functions
+// -----------------------------------------------------------------------------
+//
+// Looks up by an URL
+function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
+       // Now lookup that given URL by itself
+       $urlArray = SURFBAR_GET_URL_DATA($url, "url", "id", "ASC", "id", sprintf(" AND userid=%s", bigintval($uid)));
+
+       // Was it found?
+       return (count($urlArray) > 0);
+}
+// Load URL data by given search term and column
+function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
+       global $lastUrlData;
+
+       // By default nothing is found
+       $lastUrlData = array();
+
+       // Is the column an id number?
+       if (($column == "id") || ($column == "userid")) {
+               // Extra secure input
+               $searchTerm = bigintval($searchTerm);
+       } // END - if
+
+       // If the column is "id" there can be only one entry
+       $limit = "";
+       if ($column == "id") {
+               $limit = "LIMIT 1";
+       } // END - if
+
+       // Look up the record
+       $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, status, registered, last_locked, lock_reason, views_max, views_allowed
+FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE %s='%s'".$add."
+ORDER BY %s %s
+%s",
+               array($column, $searchTerm, $order, $sort, $limit), __FILE__, __LINE__);
+
+       // Is there at least one record?
+       if (SQL_NUMROWS($result) > 0) {
+               // Then load all!
+               while ($dataRow = SQL_FETCHARRAY($result)) {
+                       // Shall we group these results?
+                       if ($group == "id") {
+                               // Add the row by id as index
+                               $lastUrlData[$dataRow['id']] = $dataRow;
+                       } else {
+                               // Group entries
+                               $lastUrlData[$dataRow[$group]][$dataRow['id']] = $dataRow;
+                       }
+               } // END - while
+       } // END - if
+
+       // Free the result
+       SQL_FREERESULT($result);
+
+       // Return the result
+       return $lastUrlData;
+}
+// Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
+function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $limit=0) {
+       global $_CONFIG;
+
+       // Make sure by the user registered URLs are always pending
+       if ($addMode == "reg") $status = "PENDING";
+
+       // Prepare content
+       $content = array(
+               'url'         => $url,
+               'frametester' => FRAMETESTER($url),
+               'uid'         => $uid,
+               'status'      => $status,
+               'limit'       => $limit
+       );
+
+       // Insert the URL into database
+       $content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content);
+
+       // Is this ID valid?
+       if ($content['insert_id'] == 0) {
+               // INSERT did not insert any data!
+               return false;
+       } // END - if
+
+       // Translate status and limit
+       $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']);
+       $content['limit'] = SURFBAR_TRANSLATE_LIMIT($content['limit']);
+
+       // If in reg-mode we notify admin
+       if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) {
+               // Notify admin even when he as unlocked an email
+               SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
+       } // END - if
+
+       // Send mail to user
+       SURFBAR_NOTIFY_USER("url_{$addMode}", $content);
+
+       // Return the insert id
+       return $content['insert_id'];
+}
+// Inserts an url by given data array and return the insert id
+function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
+       // Get userid
+       $uid = bigintval($urlData['uid']);
+
+       // Is the id set?
+       if (empty($uid)) $uid = 0;
+
+       // Just run the insert query for now
+       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid,url,status,views_max,views_allowed) VALUES(%s,'%s','%s','%s','%s')",
+               array(
+                       $uid,
+                       $urlData['url'],
+                       $urlData['status'],
+                       $urlData['limit'],
+                       $urlData['limit']
+               ), __FILE__, __LINE__
+       );
+
+       // Return insert id
+       return SQL_INSERTID();
+}
+// Notify admin(s) with a selected message and content
+function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
+       // Prepare template name
+       $templateName = sprintf("admin_surfbar_%s", $messageType);
+
+       // Set default subject if following eval() wents wrong
+       $subject = ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT;
+
+       // Prepare subject
+       $eval = sprintf("\$subject = ADMIN_SURFBAR_NOTIFY_%s_SUBJECT;",
+               strtoupper($messageType)
+       );
+       @eval($eval);
+
+       // Send the notification out
+       return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']);
+}
+// Notify the user about the performed action
+function SURFBAR_NOTIFY_USER ($messageType, $content) {
+       // Skip notification if userid is zero
+       if ($content['uid'] == 0) {
+               return false;
+       } // END - if
+
+       // Prepare template name
+       $templateName = sprintf("member_surfbar_%s", $messageType);
+
+       // Set default subject if following eval() wents wrong
+       $subject = MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT;
+
+       // Prepare subject
+       $eval = sprintf("\$subject = MEMBER_SURFBAR_NOTIFY_%s_SUBJECT;",
+               strtoupper($messageType)
+       );
+       @eval($eval);
+
+       // Load template
+       $mailText = LOAD_EMAIL_TEMPLATE($templateName, $content, $content['uid']);
+
+       // Send the email
+       return SEND_EMAIL($content['uid'], $subject, $mailText);
+}
+// Translates the limit
+function SURFBAR_TRANSLATE_LIMIT ($limit) {
+       // Is this zero?
+       if ($limit == 0) {
+               // Unlimited!
+               $return = MEMBER_SURFBAR_UNLIMITED_VIEWS;
+       } else {
+               // Translate comma
+               $return = TRANSLATE_COMMA($limit);
+       }
+
+       // Return value
+       return $return;
+}
+// Translate the URL status
+function SURFBAR_TRANSLATE_STATUS ($status) {
+       // Create constant name
+       $constantName = sprintf("SURFBAR_URL_STATUS_%s", strtoupper($status));
+
+       // Set default translated status
+       $statusTranslated = "!".$constantName."!";
+
+       // Generate eval() command
+       if (defined($constantName)) {
+               $eval = "\$statusTranslated = ".$constantName.";";
+               eval($eval);
+       } // END - if
+
+       // Return result
+       return $statusTranslated;
+}
+// Determine reward
+function SURFBAR_DETERMINE_REWARD ($onlyMin=false) {
+       global $_CONFIG;
+
+       // Static values are default
+       $reward = $_CONFIG['surfbar_static_reward'];
+
+       // Do we have static or dynamic?
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic reward
+               if ($onlyMin) {
+                       $reward += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
+               } else {
+                       $reward += SURFBAR_CALCULATE_DYNAMIC_ADD();
+               }
+       } // END - if
+
+       // Return reward
+       return $reward;
+}
+// Determine costs
+function SURFBAR_DETERMINE_COSTS ($onlyMin=false) {
+       global $_CONFIG;
+
+       // Static costs is default
+       $costs  = $_CONFIG['surfbar_static_costs'];
+
+       // Do we have static or dynamic?
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic costs
+               if ($onlyMin) {
+                       $costs += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
+               } else {
+                       $costs += SURFBAR_CALCULATE_DYNAMIC_ADD();
+               }
+       } // END - if
+
+       // Return costs
+       return $costs;
+}
+// "Calculate" dynamic add
+function SURFBAR_CALCULATE_DYNAMIC_ADD () {
+       // Get min/max values
+       $min = SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
+       $max = SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE();
+
+       // "Calculate" dynamic part and return it
+       return mt_rand($min, $max);
+}
+// Determine right template name
+function SURFBAR_DETERMINE_TEMPLATE_NAME() {
+       // Default is the frameset
+       $templateName = "surfbar_frameset";
+
+       // Any frame set? ;-)
+       if (isset($_GET['frame'])) {
+               // Use the frame as a template name part... ;-)
+               $templateName = sprintf("surfbar_frame_%s",
+                       SQL_ESCAPE($_GET['frame'])
+               );
+       } // END - if
+
+       // Return result
+       return $templateName;
+}
+// Check if the "reload lock" of the current user is full, call this function
+// before you call SURFBAR_CHECK_RELOAD_LOCK().
+function SURFBAR_CHECK_RELOAD_FULL() {
+       global $SURFBAR_CACHE, $_CONFIG;
+
+       // Default is full!
+       $isFull = true;
+
+       // Cache static reload lock
+       $SURFBAR_CACHE['surf_lock'] = $_CONFIG['surfbar_static_lock'];
+       //DEBUG_LOG(__FUNCTION__.":Fixed surf lock is ".$_CONFIG['surfbar_static_lock']."");
+
+       // Do we have dynamic model?
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic lock
+               $SURFBAR_CACHE['surf_lock'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
+
+       // Ask the database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM "._MYSQL_PREFIX."_surfbar_locks
+WHERE userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") < UNIX_TIMESTAMP(last_surfed)
+LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__
+       );
+
+       // Fetch row
+       list($SURFBAR_CACHE['user_locks']) = SQL_FETCHROW($result);
+
+       // Is it null?
+       if (is_null($SURFBAR_CACHE['user_locks'])) {
+               // Then fix it to zero!
+               $SURFBAR_CACHE['user_locks'] = 0;
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Get total URLs
+       $total = SURFBAR_GET_TOTAL_URLS();
+
+       // Do we have some URLs in lock? Admins can always surf on own URLs!
+       //DEBUG_LOG(__FUNCTION__.":userLocks=".SURFBAR_GET_DATA('user_locks').",total={$total}");
+       $isFull = ((SURFBAR_GET_DATA('user_locks') == $total) && ($total > 0));
+
+       // Return result
+       return $isFull;
+}
+// Get total amount of URLs of given status for current user or of ACTIVE URLs by default
+function SURFBAR_GET_TOTAL_URLS ($status="ACTIVE", $excludeUserId=0) {
+       // Determine depleted user account
+       $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS();
+
+       // Is the exlude userid set?
+       if ($excludeUserId > 0) {
+               // Then add it
+               $UIDs['uid'][$excludeUserId] = $excludeUserId;
+       } // END - if
+
+       // Get amount from database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
+FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND status='%s'",
+               array($status), __FILE__, __LINE__
+       );
+
+       // Fetch row
+       list($cnt) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $cnt;
+}
+// Check wether the user is allowed to book more URLs
+function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
+       global $_CONFIG;
+
+       // Is this admin and userid is zero or does the user has some URLs left to book?
+       return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < $_CONFIG['surfbar_max_order']));
+}
+// Get total amount of URLs of given status for current user
+function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
+       global $_CONFIG;
+
+       // Is the user 0 and user is logged in?
+       if (($uid == 0) && (IS_MEMBER())) {
+               // Then use this userid
+               $uid = $GLOBALS['userid'];
+       } elseif ($uid == 0) {
+               // Error!
+               return ($_CONFIG['surfbar_max_order'] + 1);
+       }
+
+       // Default is all URLs
+       $ADD = "";
+
+       // Is the status set?
+       if (is_array($status)) {
+               // Only URLs with these status
+               $ADD = sprintf(" AND status IN('%s')", implode("','", $status));
+       } elseif (!empty($status)) {
+               // Only URLs with this status
+               $ADD = sprintf(" AND status='%s'", $status);
+       } elseif (is_array($exclude)) {
+               // Exclude URLs with these status
+               $ADD = sprintf(" AND status NOT IN('%s')", implode("','", $exclude));
+       } elseif (!empty($exclude)) {
+               // Exclude URLs with this status
+               $ADD = sprintf(" AND status != '%s'", $exclude);
+       }
+
+       // Get amount from database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
+FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE userid=%s".$ADD."
+LIMIT %s",
+               array($uid, $_CONFIG['surfbar_max_order']), __FILE__, __LINE__
+       );
+
+       // Fetch row
+       list($cnt) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $cnt;
+}
+// Generate a validation code for the given id number
+function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
+       global $_CONFIG, $SURFBAR_CACHE;
+
+       // @TODO Invalid salt should be refused
+       $SURFBAR_CACHE['salt'] = "INVALID";
+
+       // Get code length from config
+       $length = $_CONFIG['code_length'];
+
+       // Fix length to 10
+       if ($length == 0) $length = 10;
+
+       // Generate a code until the length matches
+       $valCode = "";
+       while (strlen($valCode) != $length) {
+               // Is the salt set?
+               if (empty($salt)) {
+                       // Generate random hashed string
+                       $SURFBAR_CACHE['salt'] = sha1(GEN_PASS(255));
+                       //DEBUG_LOG(__FUNCTION__.":newSalt=".SURFBAR_GET_SALT()."");
+               } else {
+                       // Use this as salt!
+                       $SURFBAR_CACHE['salt'] = $salt;
+                       //DEBUG_LOG(__FUNCTION__.":oldSalt=".SURFBAR_GET_SALT()."");
+               }
+
+               // ... and now the validation code
+               $valCode = GEN_RANDOM_CODE($length, sha1(SURFBAR_GET_SALT().":".$urlId), $GLOBALS['userid']);
+               //DEBUG_LOG(__FUNCTION__.":valCode={$valCode}");
+       } // END - while
+
+       // Hash it with md5() and salt it with the random string
+       $hashedCode = generateHash(md5($valCode), SURFBAR_GET_SALT());
+
+       // Finally encrypt it PGP-like and return it
+       $valHashedCode = generatePassString($hashedCode);
+       //DEBUG_LOG(__FUNCTION__.":finalValCode={$valHashedCode}");
+       return $valHashedCode;
+}
+// Check validation code
+function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
+       global $SURFBAR_CACHE;
+
+       // Secure id number
+       $urlId = bigintval($urlId);
+
+       // Now generate the code again
+       $code = SURFBAR_GENERATE_VALIDATION_CODE($urlId, $salt);
+
+       // Return result of checking hashes and salts
+       //DEBUG_LOG(__FUNCTION__.":---".$code."|".$check."---");
+       //DEBUG_LOG(__FUNCTION__.":+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++");
+       return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
+}
+// Lockdown the userid/id combination (reload lock)
+function SURFBAR_LOCKDOWN_ID ($urlId) {
+       //* //DEBUG: */ print "LOCK!");
+       ///* //DEBUG: */ return;
+       // Just add it to the database
+       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_locks (userid, url_id) VALUES(%s, %s)",
+               array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__);
+
+       // Remove the salt from database
+       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_surfbar_salts WHERE url_id=%s AND userid=%s LIMIT 1",
+               array(bigintval($urlId), $GLOBALS['userid']), __FILE__, __LINE__);
+}
+// Pay points to the user and remove it from the sender
+function SURFBAR_PAY_POINTS ($urlId) {
+       // Remove it from the URL owner
+       //DEBUG_LOG(__FUNCTION__.":uid=".SURFBAR_GET_USERID().",costs=".SURFBAR_GET_COSTS()."");
+       if (SURFBAR_GET_USERID() > 0) {
+               SUB_POINTS(SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
+       } // END - if
+
+       // Book it to the user
+       //DEBUG_LOG(__FUNCTION__.":uid=".$GLOBALS['userid'].",reward=".SURFBAR_GET_REWARD()."");
+       ADD_POINTS_REFSYSTEM($GLOBALS['userid'], SURFBAR_GET_DATA('reward'));
+}
+// Updates the statistics of current URL/userid
+function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
+       global $_CONFIG;
+
+       // Init add
+       $ADD = "";
+
+       // Get allowed views
+       $allowed = SURFBAR_GET_ALLOWED_VIEWS();
+
+       // Do we have a limit?
+       if ($allowed > 0) {
+               // Then count views_max down!
+               $ADD .= ",views_max=views_max-1";
+       } // END - if
+
+       // Update URL stats
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET views_total=views_total+1".$ADD." WHERE id=%s LIMIT 1",
+               array(SURFBAR_GET_ID()), __FILE__, __LINE__);
+
+       // Update the stats entry
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_stats SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1",
+               array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
+
+       // Was that update okay?
+       if (SQL_AFFECTEDROWS() < 1) {
+               // No, then insert entry
+               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_stats (userid,url_id,count) VALUES(%s,%s,1)",
+                       array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__);
+       } // END - if
+
+       // Update total/daily/weekly/monthly counter
+       $_CONFIG['surfbar_total_counter']++;
+       $_CONFIG['surfbar_daily_counter']++;
+       $_CONFIG['surfbar_weekly_counter']++;
+       $_CONFIG['surfbar_monthly_counter']++;
+
+       // Update config as well
+       UPDATE_CONFIG(array("surfbar_total_counter", "surfbar_daily_counter", "surfbar_weekly_counter", "surfbar_monthly_counter"), array(1,1,1,1), "+");
+}
+// Update the salt for validation and statistics
+function SURFBAR_UPDATE_SALT_STATS () {
+       // Update statistics record
+       SURFBAR_UPDATE_INSERT_STATS_RECORD();
+
+       // Simply store the salt from cache away in database...
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_salts SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1",
+               array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Debug message
+       //DEBUG_LOG(__FUNCTION__.":salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".$GLOBALS['userid']."");
+
+       // Was that okay?
+       if (SQL_AFFECTEDROWS() < 1) {
+               // Insert missing entry!
+               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_salts (url_id,userid,last_salt) VALUES(%s, %s, '%s')",
+                       array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FILE__, __LINE__);
+       } // END - if
+
+       // Debug message
+       //DEBUG_LOG(__FUNCTION__.":affectedRows=".SQL_AFFECTEDROWS()."");
+
+       // Return if the update was okay
+       return (SQL_AFFECTEDROWS() == 1);
+}
+// Check if the reload lock is active for given id
+function SURFBAR_CHECK_RELOAD_LOCK ($urlId) {
+       //DEBUG_LOG(__FUNCTION__.":id={$urlId}");
+       // Ask the database
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
+FROM "._MYSQL_PREFIX."_surfbar_locks
+WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") < UNIX_TIMESTAMP(last_surfed)
+ORDER BY last_surfed ASC
+LIMIT 1",
+               array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__
+       );
+
+       // Fetch counter
+       list($cnt) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return check
+       //DEBUG_LOG(__FUNCTION__.":cnt={$cnt},".SURFBAR_GET_DATA('surf_lock')."");
+       return ($cnt == 1);
+}
+// Determine which user hash no more points left
+function SURFBAR_DETERMINE_DEPLETED_USERIDS ($limit=0) {
+       // Init array
+       $UIDs = array();
+
+       // Do we have a current user id?
+       if ((IS_MEMBER()) && ($limit == 0)) {
+               // Then add this as well
+               $UIDs['uid'][$GLOBALS['userid']]      = $GLOBALS['userid'];
+               $UIDs['points'][$GLOBALS['userid']]   = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+               $UIDs['notified'][$GLOBALS['userid']] = 0;
+
+               // Get all userid except logged in one
+               $result = SQL_QUERY_ESC("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+FROM "._MYSQL_PREFIX."_surfbar_urls AS u
+INNER JOIN "._MYSQL_PREFIX."_user_data AS d
+ON u.userid=d.userid
+WHERE u.userid NOT IN (%s,0) AND u.status='ACTIVE'
+GROUP BY u.userid
+ORDER BY u.userid ASC",
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
+       } else {
+               // Get all userid
+               $result = SQL_QUERY("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+FROM "._MYSQL_PREFIX."_surfbar_urls AS u
+INNER JOIN "._MYSQL_PREFIX."_user_data AS d
+ON u.userid=d.userid
+WHERE u.status='ACTIVE'
+GROUP BY u.userid
+ORDER BY u.userid ASC", __FILE__, __LINE__);
+       }
+
+       // Load all userid
+       while (list($uid, $notified) = SQL_FETCHROW($result)) {
+               // Get total points
+               $points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
+               //DEBUG_LOG(__FUNCTION__.":uid={$uid},points={$points}");
+
+               // Shall we add this to ignore?
+               if ($points <= $limit) {
+                       // Ignore this one!
+                       //DEBUG_LOG(__FUNCTION__.":uid={$uid} has depleted points amount!");
+                       $UIDs['uid'][$uid] = $uid;
+                       $UIDs['points'][$uid] = $points;
+                       $UIDs['notified'][$uid] = $notified;
+               } // END - if
+       } // END - while
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Debug message
+       //DEBUG_LOG(__FUNCTION__.":UIDs::count=".count($UIDs)." (with own userid=".$GLOBALS['userid'].")");
+
+       // Return result
+       return $UIDs;
+}
+// Determine how many users are Online in surfbar
+function SURFBAR_DETERMINE_TOTAL_ONLINE () {
+       global $_CONFIG;
+
+       // Count all users in surfbar modue and return the value
+       $result = SQL_QUERY_ESC("SELECT id
+FROM "._MYSQL_PREFIX."_surfbar_stats
+WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s
+GROUP BY userid",
+               array($_CONFIG['online_timeout']), __FILE__, __LINE__);
+
+       // Fetch count
+       $cnt = SQL_NUMROWS($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $cnt;
+}
+// Determine waiting time for one URL 
+function SURFBAR_DETERMINE_WAIT_TIME () {
+       global $_CONFIG;
+
+       // Static time is default
+       $time = $_CONFIG['surfbar_static_time'];
+
+       // Which payment model do we have?
+       if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+               // "Calculate" dynamic time
+               $time += SURFBAR_CALCULATE_DYNAMIC_ADD();
+       } // END - if
+
+       // Return value
+       return $time;
+}
+// Changes the status of an URL from given to other
+function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) {
+       global $_CONFIG;
+
+       // Get URL data for status comparison if missing
+       if (count($data) == 0) {
+               $data = SURFBAR_GET_URL_DATA($urlId);
+       } // END - if
+
+       // Is the status like prevStatus is saying?
+       if ($data[$urlId]['status'] != $prevStatus) {
+               // No, then abort here
+               return false;
+       } // END - if
+
+
+       // Update the status now
+       // ---------------------- Commented out for debugging member actions! -----------------------
+       //SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET status='%s' WHERE id=%s LIMIT 1",
+       //      array($newStatus, bigintval($urlId)), __FILE__, __LINE__);
+       // ---------------------- Commented out for debugging member actions! -----------------------
+
+       // Was that fine?
+       if (SQL_AFFECTEDROWS() != 1) {
+               // No, something went wrong
+               return false;
+       } // END - if
+
+       // Prepare content for notification routines
+       $data[$urlId]['uid']         = $data[$urlId]['userid'];
+       $data[$urlId]['frametester'] = FRAMETESTER($data[$urlId]['url']);
+       $data[$urlId]['reward']      = TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']);
+       $data[$urlId]['costs']       = TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']);
+       $data[$urlId]['status']      = SURFBAR_TRANSLATE_STATUS($newStatus);
+       $data[$urlId]['registered']  = MAKE_DATETIME($data[$urlId]['registered'], "2");
+       $newStatus = strtolower($newStatus);
+
+       // Send admin notification
+       SURFBAR_NOTIFY_ADMIN("url_{$newStatus}", $data[$urlId]);
+
+       // Send user notification
+       SURFBAR_NOTIFY_USER("url_{$newStatus}", $data[$urlId]);
+
+       // All done!
+       return true;
+}
+// Calculate minimum value for dynamic payment model
+function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
+       global $_CONFIG;
+
+       // Addon is zero by default
+       $addon = 0;
+
+       // Percentage part
+       $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1));
+
+       // Get total users
+       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+
+       // Get online users
+       $onlineUsers = SURFBAR_DETERMINE_TOTAL_ONLINE();
+
+       // Calculate addon
+       $addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers);
+
+       // Get total URLs
+       $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0");
+
+       // Get user's total URLs
+       $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, "ACTIVE");
+
+       // Calculate addon
+       if ($totalUrls > 0) {
+               $addon += abs(log($userUrls / $totalUrls + 1) * $percent * $totalUrls);
+       } else {
+               $addon += abs(log($userUrls / 1 + 1) * $percent * $totalUrls);
+       }
+
+       // Return addon
+       return $addon;
+}
+// Calculate maximum value for dynamic payment model
+function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
+       global $_CONFIG;
+
+       // Addon is zero by default
+       $addon = 0;
+
+       // Maximum value
+       $max = log(2);
+
+       // Percentage part
+       $percent = abs(log($_CONFIG['surfbar_dynamic_percent'] / 100 + 1));
+
+       // Get total users
+       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+
+       // Calculate addon
+       $addon += abs($max * $percent * $totalUsers);
+
+       // Get total URLs
+       $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0");
+
+       // Calculate addon
+       $addon += abs($max * $percent * $totalUrls);
+
+       // Return addon
+       return $addon;
+}
+// Calculate dynamic lock
+function SURFBAR_CALCULATE_DYNAMIC_LOCK () {
+       global $_CONFIG;
+
+       // Default lock is 30 seconds
+       $addon = 30;
+
+       // Get online users
+       $onlineUsers = SURFBAR_DETERMINE_TOTAL_ONLINE();
+
+       // Calculate lock
+       $addon = abs(log($onlineUsers / $addon + 1));
+
+       // Return value
+       return $addon;
+}
+// "Getter" for lock ids array
+function SURFBAR_GET_LOCK_IDS () {
+       // Prepare some arrays
+       $IDs = array();
+       $USE = array();
+       $ignored = array();
+
+       // Get all id from locks within the timestamp
+       $result = SQL_QUERY_ESC("SELECT id, url_id, UNIX_TIMESTAMP(last_surfed) AS last
+FROM
+       "._MYSQL_PREFIX."_surfbar_locks
+WHERE
+       userid=%s
+ORDER BY
+       id ASC", array($GLOBALS['userid']),
+               __FILE__, __LINE__);
+
+       // Load all entries
+       while (list($lid, $url, $last) = SQL_FETCHROW($result)) {
+               // Debug message
+               //DEBUG_LOG(__FUNCTION__.":next - lid={$lid},url={$url},rest=".(time() - $last)."/".SURFBAR_GET_DATA('surf_lock')."");
+
+               // Skip entries that are too old
+               if (($last > (time() - SURFBAR_GET_DATA('surf_lock'))) && (!in_array($url, $ignored))) {
+                       // Debug message
+                       //DEBUG_LOG(__FUNCTION__.":okay - lid={$lid},url={$url},last={$last}");
+
+                       // Add only if missing or bigger
+                       if ((!isset($IDs[$url])) || ($IDs[$url] > $last)) {
+                               // Debug message
+                               //DEBUG_LOG(__FUNCTION__.":ADD - lid={$lid},url={$url},last={$last}");
+
+                               // Add this ID
+                               $IDs[$url] = $last;
+                               $USE[$url] = $lid;
+                       } // END - if
+               } else {
+                       // Debug message
+                       //DEBUG_LOG(__FUNCTION__.":ignore - lid={$lid},url={$url},last={$last}");
+
+                       // Ignore these old entries!
+                       $ignored[] = $url;
+                       unset($IDs[$url]);
+                       unset($USE[$url]);
+               }
+       } // END - while
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return array
+       return $USE;
+}
+// "Getter" for maximum random number
+function SURFBAR_GET_MAX_RANDOM ($UIDs, $ADD) {
+       global $_CONFIG;
+       // Count max availabe entries
+       $result = SQL_QUERY("SELECT sbu.id AS cnt
+FROM "._MYSQL_PREFIX."_surfbar_urls AS sbu
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs
+ON sbu.id=sbs.url_id
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l
+ON sbu.id=l.url_id
+WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.status='ACTIVE'".$ADD."
+GROUP BY sbu.id", __FILE__, __LINE__);
+
+       // Log last query
+       //DEBUG_LOG(__FUNCTION__.":lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
+
+       // Fetch max rand
+       $maxRand = SQL_NUMROWS($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return value
+       return $maxRand;
+}
+// Load all URLs of the current user and return it as an array
+function SURFBAR_GET_USER_URLS () {
+       // Init array
+       $URLs = array();
+
+       // Begin the query
+       $result = SQL_QUERY_ESC("SELECT u.id, u.userid, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason
+FROM "._MYSQL_PREFIX."_surfbar_urls AS u
+WHERE u.userid=%s AND u.status != 'DELETED'
+ORDER BY u.id ASC",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there entries?
+       if (SQL_NUMROWS($result) > 0) {
+               // Load all rows
+               while ($row = SQL_FETCHARRAY($result)) {
+                       // Add the row
+                       $URLs[$row['id']] = $row;
+               } // END - while
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return the array
+       return $URLs;
+}
+// "Getter" for member action array for given status
+function SURFBAR_GET_ACTION_ARRAY ($status) {
+       // Init array
+       $returnArray = array();
+
+       // Get all assigned actions
+       $result = SQL_QUERY_ESC("SELECT action FROM "._MYSQL_PREFIX."_surfbar_actions WHERE status='%s' ORDER BY id ASC",
+               array($status), __FILE__, __LINE__);
+
+       // Some entries there?
+       if (SQL_NUMROWS($result) > 0) {
+               // Load all actions
+               while (list($action) = SQL_FETCHROW($result)) {
+                       $returnArray[] = $action;
+               } // END - if
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $returnArray;
+}
+// Reload to configured stop page
+function SURFBAR_RELOAD_TO_STOP_PAGE($page="stop") {
+       global $_CONFIG;
+
+       // Internal or external?
+       if (($_CONFIG['surfbar_pause_mode'] == "INTERNAL") || (empty($_CONFIG['surfbar_pause_url']))) {
+               // Reload to internal page
+               LOAD_URL("surfbar.php?frame=".$page);
+       } else {
+               // Reload to external page
+               LOAD_URL($_CONFIG['surfbar_pause_url']);
+       }
+}
+
+// Determine next id for surfbar or get data for given id, always call this before you call other
+// getters below this function!!!
+function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
+       global $SURFBAR_CACHE, $_CONFIG;
+
+       // Default is no id and no random number
+       $nextId = 0;
+       $randNum = 0;
+
+       // Is the ID set?
+       if ($urlId == 0) {
+               // Get array with lock ids
+               $USE = SURFBAR_GET_LOCK_IDS();
+
+               // Shall we add some URL ids to ignore?
+               $ADD = "";
+               if (count($USE) > 0) {
+                       // Ignore some!
+                       $ADD = " AND sbu.id NOT IN (";
+                       foreach ($USE as $url_id => $lid) {
+                               // Add URL id
+                               $ADD .= $url_id.",";
+                       } // END - foreach
+
+                       // Add closing bracket
+                       $ADD = substr($ADD, 0, -1) . ")";
+               } // END - if
+
+               // Determine depleted user account
+               $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS();
+
+               // Get maximum randomness factor
+               $maxRand = SURFBAR_GET_MAX_RANDOM($UIDs['uid'], $ADD);
+
+               // If more than one URL can be called generate the random number!
+               if ($maxRand > 1) {
+                       // Generate random number
+                       $randNum = mt_rand(0, ($maxRand - 1));
+               } // END - if
+
+               // And query the database
+               //DEBUG_LOG(__FUNCTION__.":randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_DATA('surf_lock')."");
+               $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed
+FROM "._MYSQL_PREFIX."_surfbar_urls AS sbu
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs
+ON sbu.id=sbs.url_id
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l
+ON sbu.id=l.url_id
+WHERE sbu.userid NOT IN (".implode(",", $UIDs['uid']).") AND sbu.status='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$ADD."
+GROUP BY sbu.id
+ORDER BY l.last_surfed ASC, sbu.id ASC
+LIMIT %s,1",
+                       array($randNum), __FILE__, __LINE__
+               );
+       } else {
+               // Get data from specified id number
+               $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed
+FROM "._MYSQL_PREFIX."_surfbar_urls AS sbu
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs
+ON sbu.id=sbs.url_id
+LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l
+ON sbu.id=l.url_id
+WHERE sbu.userid != %s AND sbu.status='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))
+LIMIT 1",
+                       array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__
+               );
+       }
+
+       // Is there an id number?
+       //DEBUG_LOG(__FUNCTION__.":lastQuery=".$_CONFIG['db_last_query']."|numRows=".SQL_NUMROWS($result)."|Affected=".SQL_AFFECTEDROWS()."");
+       if (SQL_NUMROWS($result) == 1) {
+               // Load/cache data
+               //DEBUG_LOG(__FUNCTION__.":count(".count($SURFBAR_CACHE).") - BEFORE");
+               $SURFBAR_CACHE = merge_array($SURFBAR_CACHE, SQL_FETCHARRAY($result));
+               //DEBUG_LOG(__FUNCTION__.":count(".count($SURFBAR_CACHE).") - AFTER");
+
+               // Determine waiting time
+               $SURFBAR_CACHE['time'] = SURFBAR_DETERMINE_WAIT_TIME();
+
+               // Is the last salt there?
+               if (is_null($SURFBAR_CACHE['last_salt'])) {
+                       // Then repair it wit the static!
+                       //DEBUG_LOG(__FUNCTION__.":last_salt - FIXED!");
+                       $SURFBAR_CACHE['last_salt'] = "";
+               } // END - if
+
+               // Fix missing last_surfed
+               if ((!isset($SURFBAR_CACHE['last_surfed'])) || (is_null($SURFBAR_CACHE['last_surfed']))) {
+                       // Fix it here
+                       //DEBUG_LOG(__FUNCTION__.":last_surfed - FIXED!");
+                       $SURFBAR_CACHE['last_surfed'] = 0;
+               } // END - if
+
+               // Get base/fixed reward and costs
+               $SURFBAR_CACHE['reward'] = SURFBAR_DETERMINE_REWARD();
+               $SURFBAR_CACHE['costs']  = SURFBAR_DETERMINE_COSTS();
+               //DEBUG_LOG(__FUNCTION__.":BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+
+               // Only in dynamic model add the dynamic bonus!
+               if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+                       // Calculate dynamic reward/costs and add it
+                       $SURFBAR_CACHE['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
+                       $SURFBAR_CACHE['costs']  += SURFBAR_CALCULATE_DYNAMIC_ADD();
+                       //DEBUG_LOG(__FUNCTION__.":DYNAMIC+ - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."");
+               } // END - if
+
+               // Now get the id
+               $nextId = SURFBAR_GET_ID();
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       //DEBUG_LOG(__FUNCTION__.":nextId={$nextId}");
+       return $nextId;
+}
+// -----------------------------------------------------------------------------
+// PLEASE DO NOT ADD ANY OTHER FUNCTIONS BELOW THIS LINE ELSE THEY "WRAP" THE
+// $SURFBAR_CACHE ARRAY!
+// -----------------------------------------------------------------------------
+// Private getter for data elements
+function SURFBAR_GET_DATA ($element) {
+       global $SURFBAR_CACHE;
+       //DEBUG_LOG(__FUNCTION__.":element={$element}");
+
+       // Default is null
+       $data = null;
+
+       // Is the entry there?
+       if (isset($SURFBAR_CACHE[$element])) {
+               // Then take it
+               $data = $SURFBAR_CACHE[$element];
+       } else { // END - if
+               print("<pre>");
+               print_r($SURFBAR_CACHE);
+               debug_print_backtrace();
+               die("</pre>");
+       }
+
+       // Return result
+       //DEBUG_LOG(__FUNCTION__.":element[$element]={$data}");
+       return $data;
+}
+// Getter for reward from cache
+function SURFBAR_GET_REWARD () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('reward');
+}
+// Getter for costs from cache
+function SURFBAR_GET_COSTS () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('costs');
+}
+// Getter for URL from cache
+function SURFBAR_GET_URL () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('url');
+}
+// Getter for salt from cache
+function SURFBAR_GET_SALT () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('salt');
+}
+// Getter for id from cache
+function SURFBAR_GET_ID () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('id');
+}
+// Getter for userid from cache
+function SURFBAR_GET_USERID () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('userid');
+}
+// Getter for user reload locks
+function SURFBAR_GET_USER_RELOAD_LOCK () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('user_locks');
+}
+// Getter for reload time
+function SURFBAR_GET_RELOAD_TIME () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('time');
+}
+// Getter for allowed views
+function SURFBAR_GET_ALLOWED_VIEWS () {
+       // Get data element and return its contents
+       return SURFBAR_GET_DATA('views_allowed');
+}
+//
+?>
diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php
new file mode 100644 (file)
index 0000000..426309f
--- /dev/null
@@ -0,0 +1,588 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/03/2004 *
+ * ================                             Last change: 11/19/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : task_functions.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Special task functions                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle task-Funktionen                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+// The advanced overview shows detailed informations to your exchange script:
+//  - Unconfirmed / locked accounts
+//  - Mails waiting to be approved
+//  - Open tasks
+//  - Your own tasks
+//  - ...
+//
+function OUTPUT_ADVANCED_OVERVIEW (&$result_main)
+{
+       global $_CONFIG;
+
+       // Init variables/arrays
+       $EXTRAS = ""; $OUT = ""; $SQLs = array(); $WHATs = array(); $DESCRs = array(); $TITLEs = array();
+
+       // Chheck for new extensions and updates
+       $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_main);
+
+       if (!$JOBS_DONE) {
+               // New extensions or updates found
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' AND status='NEW' AND task_type='EXTENSION_UPDATE'",
+                array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+
+               $value = SQL_NUMROWS($result);
+               SQL_FREERESULT($result);
+
+               if ($value > 0) {
+                       define('__TASK_UPDATE_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task&amp;type=updates\">".$value."</A>");
+               } else {
+                       define('__TASK_UPDATE_VALUE', "0");
+               }
+       } else {
+               define('__TASK_UPDATE_VALUE', "0");
+       }
+
+       //
+       // First check for all account status seperately
+       //
+       // Confirmed accounts
+       $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__CONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;mode=confirmed\">".$value."</A>");
+       } else {
+               define('__CONFIRMED_VALUE', "0");
+       }
+
+       // Unconfirmed accounts
+       $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='UNCONFIRMED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__UNCONFIRMED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=chk_regs\">".$value."</A>");
+       } else {
+               define('__UNCONFIRMED_VALUE', "0");
+       }
+
+       // And locked accounts
+       $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='LOCKED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__LOCKED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;mode=locked\">".$value."</A>");
+       } else {
+               define('__LOCKED_VALUE', "0");
+       }
+
+       //
+       // Unassigned tasks
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='0' AND status != 'DELETED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__TASK_NEW_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task&amp;type=unassigned\">".$value."</A>");
+       } else {
+               define('__TASK_NEW_VALUE', "0");
+       }
+
+       //
+       // Closed tasks
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'CLOSED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__TASK_CLOSED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task&amp;type=closed\">".$value."</A>");
+       } else {
+               define('__TASK_CLOSED_VALUE', "0");
+       }
+
+       //
+       // Deleted tasks
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'DELETED'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__TASK_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task&amp;type=deleted\">".$value."</A>");
+       } else {
+               define('__TASK_DELETED_VALUE', "0");
+       }
+
+       //
+       // Solved tasks
+       //
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE status = 'SOLVED' AND assigned_admin='%s'",
+        array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__TASK_SOLVED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task&amp;type=solved\">".$value."</A>");
+       } else {
+               define('__TASK_SOLVED_VALUE', "0");
+       }
+
+       //
+       // Your tasks
+       //
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' AND status = 'NEW' AND task_type != 'EXTENSION_UPDATE'",
+        array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__TASK_YOUR_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_task\">".$value."</A>");
+       } else {
+               define('__TASK_YOUR_VALUE', "0");
+       }
+
+       //
+       // Mails waiting to be approved
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='ADMIN'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__MAIL_ADMIN_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=unlock_emails\">".$value."</A>");
+       } else {
+               define('__MAIL_ADMIN_VALUE', "0");
+       }
+
+       //
+       // Unfinished mail orders
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='TEMP'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__MAIL_TEMP_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=email_details\">".$value."</A>");
+       } else {
+               define('__MAIL_TEMP_VALUE', "0");
+       }
+
+       //
+       // Sent mail orders
+       //
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='SEND'", __FILE__, __LINE__);
+       $value = SQL_NUMROWS($result);
+       SQL_FREERESULT($result);
+
+       if ($value > 0) {
+               define('__MAIL_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=email_archiv\">".$value."</A>");
+       } else {
+               define('__MAIL_SEND_VALUE', "0");
+       }
+
+       //
+       // Autopurged mails
+       //
+       if (EXT_IS_ACTIVE("autopurge")) {
+               $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE data_type='DELETED'", __FILE__, __LINE__);
+               $value = SQL_NUMROWS($result);
+               SQL_FREERESULT($result);
+
+               if ($value > 0) {
+                       define('__MAIL_DELETED_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=email_details\">".$value."</A>");
+               } else {
+                       define('__MAIL_DELETED_VALUE', "0");
+               }
+
+               //
+               // Autopurged bonus mails
+               //
+               if (GET_EXT_VERSION("bonus") >= "0.1.8") {
+                       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='DELETED'", __FILE__, __LINE__);
+                       $value = SQL_NUMROWS($result);
+                       SQL_FREERESULT($result);
+
+                       if ($value > 0) {
+                               define('__MAIL_BONUS_AP_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=email_details\">".$value."</A>");
+                       } else {
+                               define('__MAIL_BONUS_AP_VALUE', "0");
+                       }
+               } elseif (EXT_IS_ACTIVE("bonus")) {
+                       define('__MAIL_BONUS_AP_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+               } else {
+                       define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_BONUS_404."</FONT>");
+               }
+       } else {
+               define('__MAIL_BONUS_AP_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
+               define('__MAIL_DELETED_VALUE', "<FONT class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</FONT>");
+       }
+
+       //
+       // Sent bonus mails
+       //
+       if (GET_EXT_VERSION("bonus") >= "0.1.8") {
+               $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND'", __FILE__, __LINE__);
+               $value = SQL_NUMROWS($result);
+               SQL_FREERESULT($result);
+
+               if ($value > 0) {
+                       define('__MAIL_BONUS_SEND_VALUE', "<A href=\"".URL."/modules.php?module=admin&amp;what=email_details\">".$value."</A>");
+               } else {
+                       define('__MAIL_BONUS_SEND_VALUE', "0");
+               }
+       } elseif (EXT_IS_ACTIVE("bonus")) {
+               define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+       } else {
+               define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_404);
+       }
+
+       if (EXT_IS_ACTIVE("autopurge")) {
+               // Start finding them...
+               $since = $_CONFIG['ap_inactive_since'];
+               $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']."";
+
+               // Check for more extensions
+               if (EXT_IS_ACTIVE("beg"))                  $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid']."";
+               if (EXT_IS_ACTIVE("bonus"))                $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid']."";
+               if (EXT_IS_ACTIVE("doubler"))              $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid']."";
+               if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+
+               // Check for all accounts
+               $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online
+FROM "._MYSQL_PREFIX."_user_data AS d
+WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < ".$since." AND d.ap_notified < ".$since."
+".$EXCLUDE_LIST."
+ORDER BY d.userid";
+               $WHATs[]  = "list_autopurge";
+               $DESCRs[] = TASK_ADMIN_INACTIVE_AUTOPURGE;
+               $TITLEs[] = TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE;
+       }
+
+       if (GET_EXT_VERSION("sql_patches") >= "0.3.4") {
+               // Check for accounts without referral
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid='0' ORDER BY userid";
+               $DESCRs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF;
+               $TITLEs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE;
+               $WHATs[]  = "list_norefs";
+       }
+
+       if (EXT_IS_ACTIVE("payout")) {
+               // List new payout requests
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts WHERE status='NEW' ORDER BY userid";
+               $WHATs[]  = "list_payouts";
+               $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING;
+               $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE;
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_payouts ORDER BY userid";
+               $WHATs[]  = "list_payouts";
+               $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("wernis")) {
+               // List new wernis requests
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_wernis ORDER BY userid";
+               $WHATs[]  = "list_wernis";
+               $DESCRs[] = TASK_ADMIN_LIST_WERNIS_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_WERNIS_ALL_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("primera")) {
+               // List new primera requests
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_primera ORDER BY userid";
+               $WHATs[]  = "list_primera";
+               $DESCRs[] = TASK_ADMIN_LIST_PRIMERA_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_PRIMERA_ALL_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("holiday")) {
+               // List holiday requests
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_holidays ORDER BY userid";
+               $WHATs[]  = "list_holiday";
+               $DESCRs[] = TASK_ADMIN_LIST_HOLIDAYS;
+               $TITLEs[] = TASK_ADMIN_LIST_HOLIDAYS_TITLE;
+       }
+
+       if (GET_EXT_VERSION("bonus") >= "0.2.3") {
+               // Active rallye
+               if (GET_EXT_VERSION("bonus") >= "0.6.9") {
+                       // Add more bonus points here
+                       $USE = "(0";
+                       if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
+                       if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
+                       if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
+                       if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
+                       if ($_CONFIG['bonus_ref_yn']   == "Y") $USE .= " + bonus_ref";
+                       $USE .= ")";
+               } else {
+                       // Old version ???
+                       $USE = "turbo_bonus";
+               }
+
+               // Autopurge installed?
+               $LAST = "";
+               if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+                       // Use last online timestamp to keep inactive members away from here
+                       $LAST   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+               }
+
+               $SQLs[]   = "SELECT ".$USE." AS active_bonus FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."
+ORDER BY active_bonus DESC, userid";
+               $WHATs[]  = "list_bonus";
+               $DESCRs[] = TASK_ADMIN_LIST_BONUS;
+               $TITLEs[] = TASK_ADMIN_LIST_BONUS_TITLE;
+       }
+
+       if (GET_EXT_VERSION("beg") >= "0.1.2") {
+               // Begging rallye
+
+               // Autopurge installed?
+               $LAST = "";
+               if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+                       // Use last online timestamp to keep inactive members away from here
+                       $LAST   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+               }
+
+               $SQLs[]   = "SELECT userid FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' AND beg_points>0".$LAST."
+ORDER BY beg_points DESC, userid";
+               $WHATs[]  = "list_beg";
+               $DESCRs[] = TASK_ADMIN_LIST_BEG;
+               $TITLEs[] = TASK_ADMIN_LIST_BEG_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("doubler")) {
+               // List waiting payouts
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' ORDER BY id";
+               $WHATs[]  = "list_doubler&amp;mode=waiting&amp;select=all";
+               $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_WAITING;
+               $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE;
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_doubler ORDER BY id";
+               $WHATs[]  = "list_doubler";
+               $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_ALL_TITLE;
+       }
+
+       //
+       // All referral banner
+       //
+       $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner ORDER BY id";
+       $WHATs[] = "refbanner";
+       $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ALL;
+       $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ALL_TITLE;
+
+       //
+       // All activated referral banner
+       //
+       $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y' ORDER BY id";
+       $WHATs[] = "refbanner";
+       $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE;
+       $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE;
+
+       //
+       // All extensions
+       //
+       $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions ORDER BY id";
+       $WHATs[] = "extensions";
+       $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL;
+       $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE;
+
+       //
+       // All activated extensions
+       //
+       $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_active='Y' ORDER BY id";
+       $WHATs[] = "extensions&amp;active=Y";
+       $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE;
+       $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE;
+
+       if (EXT_IS_ACTIVE("engine")) {
+               // List all export accounts
+               $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts ORDER BY id";
+               $WHATs[] = "list_engine";
+               $DESCRs[] = TASK_ADMIN_LIST_ENGINE;
+
+               // List all pending accounts
+               $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_accounts WHERE status='UNCONFIRMED' ORDER BY id";
+               $WHATs[] = "unlock_engine";
+               $DESCRs[] = TASK_ADMIN_UNLOCK_ENGINE;
+
+               // List all safes
+               $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_safe ORDER BY id";
+               $WHATs[] = "list_engine&amp;mode=safe";
+               $DESCRs[] = TASK_ADMIN_LIST_ENGINE_SAFES;
+
+               // List all export URLs
+               $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_engine_urls ORDER BY id";
+               $WHATs[] = "engine_urls";
+               $DESCRs[] = TASK_ADMIN_LIST_ENGINE_URLS;
+       }
+
+       if (EXT_IS_ACTIVE("sponsor")) {
+               // List all sponsors
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id";
+               $WHATs[]  = "list_sponsor";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_TITLE;
+
+               // List confirmed sponsor accounts
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='CONFIRMED' ORDER BY id";
+               $WHATs[]  = "list_sponsor";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE;
+
+               // List unconfirmed sponsor accounts
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='UNCONFIRMED' ORDER BY id";
+               $WHATs[]  = "list_sponsor";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE;
+
+               // List locked sponsor accounts
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='LOCKED' ORDER BY id";
+               $WHATs[]  = "list_sponsor";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE;
+
+               // List waiting sponsor accounts to be approved
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='PENDING' ORDER BY id";
+               $WHATs[]  = "unlock_sponsor";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_PENDING;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE;
+
+               // Waiting payments
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_orders WHERE pay_status='PENDING' ORDER BY id";
+               $WHATs[]  = "list_sponsor_pays";
+               $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS;
+               $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("country")) {
+               // List country codes
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_countries ORDER BY id";
+               $WHATs[]  = "list_country";
+               $DESCRs[] = TASK_ADMIN_LIST_COUNTRY;
+               $TITLEs[] = TASK_ADMIN_LIST_COUNTRY_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("theme")) {
+               // List all themes
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_themes ORDER BY id";
+               $WHATs[]  = "theme_edit";
+               $DESCRs[] = TASK_ADMIN_LIST_THEME_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_THEME_ALL_TITLE;
+
+               // List active themes
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_active='Y' ORDER BY id";
+               $WHATs[]  = "theme_edit";
+               $DESCRs[] = TASK_ADMIN_LIST_THEME_ACTIVE;
+               $TITLEs[] = TASK_ADMIN_LIST_THEME_ACTIVE_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("admins")) {
+               // List all administrator logins
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_admins ORDER BY id";
+               $WHATs[]  = "admins_edit";
+               $DESCRs[] = TASK_ADMIN_LIST_ADMINS_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_ADMINS_ALL_TITLE;
+       }
+
+       if (EXT_IS_ACTIVE("surfbar")) {
+               // List all URLs in surfbar
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls ORDER BY id";
+               $WHATs[]  = "list_surfbar_urls";
+               $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL;
+               $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE;
+
+               // List all pending URLs in surfbar
+               $SQLs[]   = "SELECT id FROM "._MYSQL_PREFIX."_surfbar_urls WHERE status='PENDING' ORDER BY id";
+               $WHATs[]  = "unlock_surfbar_urls";
+               $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING;
+               $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE;
+       }
+
+       // Generate extra overview rows
+       $EXTRAS .= TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs);
+
+       // If empty just keep a forced-space left for CSS issues
+       if (empty($EXTRAS)) $EXTRAS = "&nbsp;";
+
+       // Add compiled string to constant for final template
+       define('__OVERVIEW_EXTRA_TABLE', $EXTRAS);
+
+       // Simply load the template... :-)
+       LOAD_TEMPLATE("admin_overview_task");
+}
+
+//
+function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
+       // Init
+       $OUT = ""; $SW = 2; $MAX = sizeof($SQLs) - 1;
+       foreach ($SQLs as $key => $sql) {
+               // Run SQL command, get line numbers and free memory
+               $result = SQL_QUERY($sql, __FILE__, __LINE__);
+
+               // Get rows
+               $value = SQL_NUMROWS($result);
+
+               // Free result
+               SQL_FREERESULT($result);
+
+               $content = array(
+                       'row_descr' => $DESCRs[$key],
+                       'row_sw'    => $SW,
+                       'bottom'    => "",
+               );
+
+               if ($key < $MAX) $content['bottom'] = "bottom2";
+               if (($value > 0) && (!empty($WHATs[$key]))) {
+                       if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
+                       $content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&amp;what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
+               } else {
+                       $content['row_link'] = 0;
+               }
+
+               // Switch color
+               $SW = 3 - $SW;
+
+               // And insert the final string into extras template
+               $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
+       } // END - if
+
+       // Return output
+       return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);
+}
+//
+?>
diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php
new file mode 100644 (file)
index 0000000..f8b65f3
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/13/2004 *
+ * ===============                              Last change: 10/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : transfer_functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for transfer extension         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktion fuer transfer-Erweiterung     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function TRANSFER_AUTPPURGE($max, $age) {
+       // First get total in-going lines
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_user_transfers_in ORDER BY id", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > $max) {
+               // Update overdue transfers
+               $remove = SQL_NUMROWS($result) - $max;
+
+               // This will make it really old, so the final removal query will find it
+               $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_transfers_in SET time_trans='0' ORDER BY id LIMIT ".$remove, __FILE__, __LINE__);
+       }
+
+       // Second get total out-going lines
+       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY id", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > $max) {
+               // Update overdue transfers
+               $remove = SQL_NUMROWS($result) - $max;
+
+               // This will make it really old, so the final removal query will find it
+               $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_transfers_out SET time_trans='0' ORDER BY id LIMIT ".$remove, __FILE__, __LINE__);
+       }
+
+       // Remove old in-going transfers
+       $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_transfers_in WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__);
+       $REMOVE = SQL_AFFECTEDROWS();
+
+       // Remove old out-going transfers
+       $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_transfers_out WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__);
+       $REMOVE += SQL_AFFECTEDROWS();
+
+       // Only send email to admin(s) when we have removed entries
+       if ($REMOVE > 0) {
+               SEND_ADMIN_NOTIFICATION(TRANSFER_ADMIN_AUTOPURGE, "admin_transfer_ap", $REMOVE, 0);
+       }
+}
+//
+?>
diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php
new file mode 100644 (file)
index 0000000..115bec7
--- /dev/null
@@ -0,0 +1,225 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/16/2004 *
+ * ===============                              Last change: 10/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : user_functions.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Special functions for user extension             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Spezielle Funktionen fuer die user-Erweiterung   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+function alpha($sortby, $colspan, $return=false)
+{
+       global $_CONFIG;
+       if (empty($_GET['offset'])) $_GET['offset'] = 0;
+       $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
+       if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
+
+       /* Creates the list of letters and makes them a link. */
+       $alphabet = array(_ALL2,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",_OTHERS);
+       $num = count($alphabet) - 1;
+       $OUT = "";
+       while (list($counter, $ltr) = each($alphabet))
+       {
+               if ($_GET['letter'] == $ltr)
+               {
+                       // Current letter is letter from URL
+                       $OUT .= "<STRONG>".$ltr."</STRONG>";
+               }
+                else
+               {
+                       // Output link to letter
+                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what'];
+                       if (!empty($_GET['mode'])) $OUT .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
+                       $OUT .= "&amp;letter=".$ltr."&amp;sortby=".$sortby.$ADD."\">".$ltr."</A>";
+               }
+               if ((($counter / $_CONFIG['user_alpha']) == round($counter / $_CONFIG['user_alpha'])) && ($counter > 0))
+               {
+                       $OUT .= "&nbsp;]<br />[&nbsp;";
+               }
+                elseif ( $counter != $num )
+               {
+                       $OUT .= "&nbsp;|&nbsp;";
+               }
+       }
+       define('__ALPHA_LIST', $OUT);
+
+       // Load template
+       $OUT = LOAD_TEMPLATE("admin_list_user_alpha", true);
+       if ($return)
+       {
+               // Return generated code
+               return $OUT;
+       }
+        else
+       {
+               // Output generated code
+               OUTPUT_HTML($OUT);
+       }
+}
+//
+function SortLinks($letter, $sortby, $colspan, $return=false)
+{
+       $OUT = "";
+       if (empty($_GET['offset'])) $_GET['offset'] = 0;
+       $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
+       if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
+
+       // Makes order by links..
+       if ($letter == "front") $letter = _ALL2;
+
+       // Prepare array with all possible sorters
+       $list = array(
+               'userid'                => _UID,
+               'family'                => FAMILY_NAME,
+               'email'         => ADDY,
+               'REMOTE_ADDR'   => REMOTE_IP
+       );
+
+       // Add nickname if extension is installed
+       if (EXT_IS_ACTIVE("nickname")) {
+               $list['nickname'] = NICKNAME;
+       }
+
+       foreach ($list as $sort => $title) {
+               if ($sortby == $sort) {
+                       $OUT .= "<STRONG>".$title."</STRONG>&nbsp;|&nbsp;";
+               } else {
+                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;letter=".$letter."&amp;sortby=".$sort.$ADD."\">".$title."</a>&nbsp;|&nbsp;";
+               }
+       }
+       define('__SORT_LIST', substr($OUT, 0, -13));
+
+       // Load template
+       $OUT = LOAD_TEMPLATE("admin_list_user_sort", true);
+       if ($return)
+       {
+               // Return code
+               return $OUT;
+       }
+        else
+       {
+               // Output code
+               OUTPUT_HTML($OUT);
+       }
+}
+//
+function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false)
+{
+       if (!$show_form)
+       {
+               // Empty row
+               define('__FORM_HEADER', "<TR><TD colspan=\"".$colspan."\" class=\"seperator\">&nbsp;</TD></TR>");
+       }
+        else
+       {
+               // Load form for changing number of lines
+               define('__FORM_HEADER', LOAD_TEMPLATE("admin_list_user_sort_form", true));
+       }
+       if (!$show_form)
+       {
+               // Add line with bottom border
+               define('__FORM_FOOTER', "<TR><TD colspan=\"".__COLSPAN2."\" class=\"seperator bottom2\">&nbsp;</TD></TR>");
+       }
+        else
+       {
+               // Add line without bottom border
+               define('__FORM_FOOTER', "<TR><TD colspan=\"".__COLSPAN2."\" class=\"seperator bottom2\">&nbsp;</TD></TR>");
+       }
+
+       $OUT = "";
+       for ($page = 1; $page <= $PAGES; $page++)
+       {
+               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1")))
+               {
+                       $OUT .= "<STRONG>-";
+               }
+                else
+               {
+                       if (empty($_GET['letter'])) $_GET['letter'] = _ALL2;
+                       if (empty($_GET['sortby'])) $_GET['sortby'] = "userid";
+                       $OUT .= "<A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what'];
+                       if (!empty($_GET['mode'])) $OUT .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
+                       $OUT .= "&amp;letter=".$_GET['letter']."&amp;sortby=".$_GET['sortby']."&amp;page=".$page."&amp;offset=".$offset."\">";
+               }
+               $OUT .= $page;
+               if (($page == $_GET['page']) || ((empty($_GET['page'])) && ($page == "1")))
+               {
+                       $OUT .= "-</STRONG>";
+               }
+                else
+               {
+                       $OUT .= "</A>";
+               }
+               if ($page < $PAGES) $OUT .= "&nbsp;|&nbsp;";
+       }
+       define('__PAGENAV_LIST', $OUT);
+
+       // Load template
+       $OUT = LOAD_TEMPLATE("admin_list_user_pagenav", true);
+       if ($return)
+       {
+               // Return code
+               return $OUT;
+       }
+        else
+       {
+               // Output code
+               OUTPUT_HTML($OUT);
+       }
+}
+// Create email link to user's account
+function USER_CREATE_EMAIL_LINK($email, $mod="admin")
+{
+       $locked = " AND status='CONFIRMED'";
+       if (IS_ADMIN()) $locked = "";
+       $result = SQL_QUERY_ESC("SELECT userid
+FROM "._MYSQL_PREFIX."_user_data
+WHERE email='%s'".$locked." LIMIT 1",
+        array($email), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Load userid
+               list($uid) = SQL_FETCHROW($result);
+
+               // Rewrite email address to contact link
+               $email = URL."/modules.php?module=".$mod."&amp;what=user_contct&amp;u_id=".bigintval($uid);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Return rewritten (?) email address
+       return $email;
+}
+//
+?>
diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php
new file mode 100644 (file)
index 0000000..4e05960
--- /dev/null
@@ -0,0 +1,410 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-points.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : All your collected points...                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Ihrer gesammelten Punkte                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Sets a status message and code
+function WERNIS_STATUS_MESSAGE ($msg, $status) {
+       global $WERNIS;
+       $WERNIS['message'] = $msg;
+       $WERNIS['status'] = $status;
+}
+
+// Get the status message
+function GET_WERNIS_ERROR_MESSAGE () {
+       global $WERNIS;
+       if (isset($WERNIS['message'])) {
+               // Use raw message
+               return $WERNIS['message'];
+       } elseif (isset($WERNIS['status'])) {
+               // Fall-back to status
+               return sprintf(WERNIS_ERROR_STATUS, $WERNIS['status']);
+       } else {
+               // Something bad happend
+               return WERNIS_UNKNOWN_ERROR;
+       }
+}
+
+// Get the status code
+function GET_WERNIS_ERROR_CODE () {
+       global $WERNIS;
+       if (isset($WERNIS['status'])) {
+               // Use raw message
+               return $WERNIS['status'];
+       } else {
+               // Something bad happend
+               return WERNIS_UNKNOWN_ERROR;
+       }
+}
+
+// Sends out a request to the API and returns it's result
+function WERNIS_SEND_REQUEST ($scriptName, $requestData =  array()) {
+       global $_CONFIG;
+
+       // Is the requestData an array?
+       if (!is_array($requestData)) {
+               // Then abort here!
+               return array(
+                       'status'  => "failed_general",
+                       'message' => WERNIS_API_REQUEST_DATA_INVALID
+               );
+       } // END - if
+
+       // Is the API id and MD5 hash there?
+       if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) {
+               // Abort here...
+               return array(
+                       'status'  => "failed_general",
+                       'message' => WERNIS_API_REQUEST_DATA_MISSING
+               );
+       } // END - if
+
+       // Add more request data
+       $requestData['api_id']  = bigintval($_CONFIG['wernis_api_id']);
+       $requestData['api_key'] = $_CONFIG['wernis_api_md5'];
+
+       // Construct the request string
+       $requestString = $_CONFIG['wernis_api_url'] . $scriptName;
+
+       // Get the raw response from the lower function
+       $response = POST_URL($requestString, $requestData);
+
+       // Check the response header if all is fine
+       if (strpos($response[0], "200") === false) {
+               // Something bad happend... :(
+               return array(
+                       'status'  => "request_error",
+                       'message' => sprintf(WERNIS_API_REQUEST_ERROR, $response[0])
+               );
+       } // END - if
+
+       // All (maybe) fine so remove the response header from server
+       $response = $response[(count($response) - 1)];
+
+       // Prepare the returning result for higher functions
+       if (substr($response, 0, 1) == "&") {
+               // Remove the leading & (which can be used in Flash)
+               $response = substr($response, 1);
+       } // END - if
+
+       // Bring back the response
+       $data = explode("=", $response);
+
+       // Default return array (should not stay empty)
+       $return = array();
+
+       // We use only the first two entries (which shall be fine)
+       if ($data[0] === "error") {
+               // The request has failed... :(
+               switch ($data[1]) {
+                       case "404": // Invalid API ID
+                       case "AUTH": // Authorization has failed
+                               $return = array(
+                                       'status'  => "auth_failed",
+                                       'message' => WERNIS_API_REQUEST_FAILED_AUTH
+                               );
+                               break;
+
+                       case "LOCKED": // User account is locked!
+                       case "PASS": // Bad passphrase entered
+                       case "USER": // Missing account or invalid password
+                               $return = array(
+                                       'status'  => "user_failed",
+                                       'message' => WERNIS_API_REQUEST_FAILED_USER
+                               );
+                               break;
+
+                       case "OWN": // Transfer to own account
+                               $return = array(
+                                       'status'  => "own_failed",
+                                       'message' => WERNIS_API_REQUEST_FAILED_OWN
+                               );
+                               break;
+
+                       case "AMOUNT": // Amount is depleted
+                               $return = array(
+                                       'status'  => "amount_failed",
+                                       'message' => WERNIS_API_REQUEST_FAILED_AMOUNT
+                               );
+                               break;
+
+                       case "AMOUNT-SEND": // API amount is depleted
+                               $return = array(
+                                       'status'  => "api_amount_failed",
+                                       'message' => WERNIS_API_REQUEST_FAILED_API_AMOUNT
+                               );
+                               break;
+
+                       default: // Unknown error (maybe new?)
+                               $return = array(
+                                       'status'  => "request_failed",
+                                       'message' => sprintf(WERNIS_API_REQUEST_FAILED, $data[1])
+                               );
+                               break;
+               }
+       } else {
+               // All fine here
+               $return = array(
+                       'status'   => "OK",
+                       'response' => $response
+               );
+       }
+
+       // Return the result
+       return $return;
+}
+
+// Tests the function by calling balance.php on the API
+function WERNIS_TEST_API () {
+       // Get config first
+       global $_CONFIG;
+       $result = false;
+
+       // Return the result from the lower functions
+       $return = WERNIS_SEND_REQUEST("balance.php");
+
+       if ($return['status'] == "OK") {
+               // All fine!
+               $result = true;
+       } else {
+               // Status failture text
+               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+       }
+
+       // Return result
+       return $result;
+}
+
+// Widthdraw this amount
+function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
+       global $_CONFIG;
+
+       // Is the sponsor extension installed?
+       if (!EXT_IS_ACTIVE("sponsor")) {
+               // No, abort here
+               return false;
+       } elseif (!IS_SPONSOR()) {
+               // No sponsor, not allowed to withdraw!
+               return false;
+       }
+
+       // Default is failed attempt
+       $result = false;
+
+       // Prepare the purpose
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_WITHDRAW, $GLOBALS['userid']))."\";";
+       eval($eval);
+
+       // Prepare the request data
+       $requestData = array(
+               'sub_request'   => "receive",
+               't_uid'                 => bigintval($wdsId),
+               't_md5'                 => $userMd5,
+               'r_uid'                 => $_CONFIG['wernis_refid'],
+               'amount'                => bigintval($amount),
+               'purpose'               => urlencode(base64_encode($purpose))
+       );
+
+       // Return the result from the lower functions
+       $return = WERNIS_SEND_REQUEST("book.php", $requestData);
+
+       if ($return['status'] == "OK") {
+               // All fine!
+               $result = true;
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'IN');
+       } else {
+               // Status failture text
+               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
+       }
+
+       // Return result
+       return $result;
+}
+
+
+// Payout this amount
+function WERNIS_EXECUTE_PAYOUT ($wdsId, $userMd5, $amount) {
+       global $_CONFIG;
+
+       // Default is failed attempt
+       $result = false;
+
+       // Prepare the purpose
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_PAYOUT, $GLOBALS['userid']))."\";";
+       eval($eval);
+
+       // Prepare the request data
+       $requestData = array(
+               'sub_request'   => "send",
+               't_uid'                 => bigintval($wdsId),
+               't_md5'                 => $userMd5,
+               'r_uid'                 => $_CONFIG['wernis_refid'],
+               'amount'                => bigintval($amount),
+               'purpose'               => urlencode(base64_encode($purpose))
+       );
+
+       // Return the result from the lower functions
+       $return = WERNIS_SEND_REQUEST("book.php", $requestData);
+
+       if ($return['status'] == "OK") {
+               // All fine!
+               $result = true;
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'OUT');
+       } else {
+               // Status failture text
+               WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
+       }
+
+       // Return result
+       return $result;
+}
+
+// Translate the status IN/OUT
+function WERNIS_TRANSFER_STATUS ($status) {
+       // Default status
+       $return = sprintf(WERNIS_STATUS_UNKNWOWN, $status);
+       switch ($status) {
+               case "IN": // Withdraw
+                       $return = WERNIS_STATUS_WITHDRAW;
+                       break;
+
+               case "OUT": // Payout
+                       $return = WERNIS_STATUS_PAYOUT;
+                       break;
+
+               case "FAILED": // Payout
+                       $return = WERNIS_STATUS_FAILED;
+                       break;
+       }
+
+       // Return the status
+       return $return;
+}
+
+// Log the transfer
+function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") {
+       // Register this wernis movement
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_wernis (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES(%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
+               array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FILE__, __LINE__);
+}
+
+// Take fees and factor
+function WERNIS_TAKE_FEE ($points, $mode) {
+       global $_CONFIG;
+
+       // Payout or withdraw are allowed modes!
+       //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
+       if (!in_array($mode, array('payout', 'withdraw'))) {
+               // Log error and abort
+               DEBUG_LOG(__FUNCTION__.":uid={$GLOBALS['userid']},mode={$mode},points={$points}");
+               return false;
+       } // END - if
+
+       // Is there a percentage or fixed fee?
+       if ($_CONFIG['wernis_'.$mode.'_fee_percent'] > 0) {
+               // Percentage fee
+               $points -= $points * $_CONFIG['wernis_'.$mode.'_fee_percent'] / 100;
+       } elseif ($_CONFIG['wernis_'.$mode.'_fee_fix'] > 0) {
+               // Fixed fee
+               $points -= $_CONFIG['wernis_'.$mode.'_fee_fix'];
+       }
+
+       // Divide/multiply the factor
+       if ($mode == "payout") {
+               // Divide for payout
+               $points = $points / $_CONFIG['wernis_payout_factor'];
+       } else {
+               // Multiply for withdraw
+               $points = $points * $_CONFIG['wernis_withdraw_factor'];
+       }
+
+       // Return value
+       //* DEBUG: */ echo "mode={$mode},points={$points}<br />\n";
+       return $points;
+}
+
+// Add withdraw fees and factor
+function WERNIS_ADD_WITHDRAW_FEE ($points) {
+       global $_CONFIG;
+
+       // Is there a percentage or fixed fee?
+       if ($_CONFIG['wernis_withdraw_fee_percent'] > 0) {
+               // Percentage fee
+               $points += $points * $_CONFIG['wernis_withdraw_fee_percent'] / 100;
+       } elseif ($_CONFIG['wernis_withdraw_fee_fix'] > 0) {
+               // Fixed fee
+               $points += $_CONFIG['wernis_withdraw_fee_fix'];
+       }
+
+       // Return value
+       return $points;
+}
+
+// Add all fees to the array
+function WERNIS_ADD_FEES_TO_ARRAY (&$array) {
+       global $_CONFIG;
+
+       // Is the array an array? ;-)
+       if (!is_array($array)) {
+               // Log error and return
+               DEBUG_LOG(__FUNCTION__.": Type ".gettype($array)." != array.");
+               return;
+       } // END - if
+
+       // Add both factors
+       $array['payout_factor']        = TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']);
+       $array['withdraw_factor']      = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']);
+
+       // Add all fees
+       $array['payout_fee_percent']   = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']);
+       $array['withdraw_fee_percent'] = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']);
+       $array['payout_fee_fix']       = TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_fix']);
+       $array['withdraw_fee_fix']     = TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_fix']);
+}
+
+//
+?>
diff --git a/inc/load_cache.php b/inc/load_cache.php
new file mode 100644 (file)
index 0000000..fad1bdd
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/28/2004 *
+ * ===============                              Last change: 11/28/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Load more cache includes
+$INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/loader/", "load_cache-");
+
+// Include all
+foreach ($INC_POOL as $fqfn) {
+       // Include the file
+       require_once($fqfn);
+} // END - foreach
+
+// Remove array
+unset($INC_POOL);
+
+//
+?>
diff --git a/inc/load_extensions.php b/inc/load_extensions.php
new file mode 100644 (file)
index 0000000..8d69d37
--- /dev/null
@@ -0,0 +1,322 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/26/2004 *
+ * ===============                              Last change: 07/01/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_extensions.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Load all extensions                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Erweiterungen laden                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+//
+global $EXT_CSS_FILES;
+$EXT_CSS_FILES = array();
+$ADD = "";
+
+// Skip loading extensions
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
+
+// Load default sql_patches extension if present
+if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
+       // Load it...
+       $EXT_LOAD_MODE = "";
+       require_once(PATH."inc/extensions/ext-sql_patches.php");
+       $cacheArray['active_extensions'] = array('sql_patches' => 'Y'); // KEEP THIS ALWAYS ACTIVE!
+} else {
+       // Initialize array for "always keep active extensions"
+       $cacheArray['active_extensions'] = array();
+}
+
+//
+// Load extensions
+//
+if (EXT_IS_ACTIVE("cache")) {
+       // Load cache extension alone
+       include_once(PATH."inc/libs/cache_functions.php");
+       $cacheMode = "";
+       include_once(PATH."inc/extensions/ext-cache.php");
+       switch($cacheInstance->cache_file("extensions", true)) {
+               case true : $cacheMode = "load"; break;
+               case false: $cacheMode = "init"; break;
+       }
+
+       // Do not recreate cache file when it's switched off!
+       if (($cacheMode == "init") && ($_CONFIG['cache_exts'] == "N")) $cacheMode = "skip";
+} else {
+       // Cache extension not active
+       $cacheMode = "no";
+}
+
+if ($cacheMode == "load") {
+       // Init include array
+       $EXT_POOL = array();
+
+       // Re-initialize handler
+       $cacheInstance->cache_file("extensions", true);
+
+       // Load extension data from cache file
+       $EXT_DUMMY = $cacheInstance->cache_load();
+
+       // Begin with the cache preparation of extensions
+       $EXT_NAMES = array();
+       foreach ($EXT_DUMMY['ext_name'] as $k => $name) {
+               // Load functions file
+               if ($EXT_DUMMY['ext_funcs'][$k] == "Y") {
+                       require_once(PATH."inc/libs/".$name."_functions.php");
+               } // END - if
+
+               // Load Language file
+               if ($EXT_DUMMY['ext_lang'][$k] == "Y") {
+                       $INC = sprintf("%sinc/language/%s_%s.php", PATH, $name, GET_LANGUAGE());
+                       if (FILE_READABLE($INC)) {
+                               // Add it
+                               $EXT_POOL[] = $INC;
+                       }
+               } // END - if
+
+               // Load CSS file
+               if ($EXT_DUMMY['ext_css'][$k] == "Y") $EXT_CSS_FILES[] = "".$name.".css";
+
+               // Load extension file itself
+               if (($EXT_DUMMY['ext_active'][$k] == "Y") || ($EXT_DUMMY['ext_keep'][$k] == "Y") || (IS_ADMIN())) {
+                       $EXT_POOL[] = sprintf("%sinc/extensions/ext-%s.php", PATH, $name);
+               } // END - if
+
+               // Version number
+               $EXT_DUMMY['ext_version'][$name] = $EXT_DUMMY['ext_version'][$k];
+               unset($EXT_DUMMY['ext_version'][$k]);
+               // Extension is active
+               $EXT_DUMMY['ext_active'][$name] = $EXT_DUMMY['ext_active'][$k];
+               unset($EXT_DUMMY['ext_active'][$k]);
+               // Ext menu
+               $EXT_DUMMY['ext_menu'][$name] = $EXT_DUMMY['ext_menu'][$k];
+               unset($EXT_DUMMY['ext_menu'][$k]);
+               // Extension id
+               $EXT_DUMMY['ext_id'][$name] = $EXT_DUMMY['ext_id'][$k];
+               $id = $EXT_DUMMY['ext_id'][$name];
+               unset($EXT_DUMMY['ext_id'][$k]);
+
+               // Add ext name
+               $EXT_NAMES[$id] = $name;
+
+               // Mark it as active extension
+               $cacheArray['active_extensions']['$name'] = $EXT_DUMMY['ext_keep'][$k];
+               unset($EXT_DUMMY['ext_keep'][$k]);
+
+               // Remove unneccessary data from memory
+               unset($EXT_DUMMY['ext_lang'][$k]);
+               unset($EXT_DUMMY['ext_css'][$k]);
+               unset($EXT_DUMMY['ext_funcs'][$k]);
+       } // END - foreach
+
+       // Write dummy array back
+       $EXT_DUMMY['ext_name'] = $EXT_NAMES;
+       unset($EXT_NAMES);
+
+       // Close cache file
+       $cacheInstance->cache_close();
+
+       // Loading cache is done so let's free some memory!
+       unset($EXT_DUMMY['ext_lang']);
+       unset($EXT_DUMMY['ext_keep']);
+       unset($EXT_DUMMY['ext_css']);
+       unset($EXT_DUMMY['ext_funcs']);
+       $cacheArray['extensions'] = $EXT_DUMMY;
+       unset($EXT_DUMMY);
+
+       // No database load needed
+       $res_ext_crt = false;
+
+       // Load more cache files (like admins)
+       require_once(PATH."inc/load_cache.php");
+
+       // Load all extension files
+       foreach ($EXT_POOL as $inc) {
+               require_once($inc);
+       } // END - foreach
+
+       // Remove array
+       unset($EXT_POOL);
+} else {
+       // If current user is not admin load only activated extensions
+       // The admin shall use every available extension for testing purposes
+       if ((!IS_ADMIN()) && ($cacheMode != "init")) $ADD = " WHERE ext_active='Y'";
+
+       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
+               // Query with CSS file from DB
+               $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_has_css, ext_active, ext_version
+FROM "._MYSQL_PREFIX."_extensions".$ADD."
+ORDER BY ext_name", __FILE__, __LINE__);
+       } else {
+               // Old obsulete query string
+               $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_name, ext_active, ext_version
+FROM "._MYSQL_PREFIX."_extensions".$ADD."
+ORDER BY ext_name", __FILE__, __LINE__);
+       }
+}
+
+// Array for removed but not uninstalled extensions
+$DEL = array();
+
+// At least one found?
+if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode == "no")) && ($CSS != "1") && ($CSS != "-1")) {
+       // Load theme management
+       require_once(PATH."inc/theme-manager.php");
+
+       // If we need to init the cache init it now
+       if ($cacheMode == "init") $cacheInstance->cache_init("EXTENSIONS");
+
+       // Extensions are registered so we load them
+       while (list($EXT_ID, $name, $lang, $css, $active, $version) = SQL_FETCHROW($res_ext_crt)) {
+               // Get menu entry
+               $menu = "N";
+               if (MODULE_HAS_MENU($name, true)) {
+                       $menu = "Y";
+               } // END - if
+
+               // Load extensions
+               $file1 = sprintf("%sinc/extensions/ext-%s.php", PATH, $name);
+               $file2 = $file1; $EXT_CSS = "N"; $EXT_ALWAYS_ACTIVE = "N";
+
+               // Special functions file
+               $file3 = sprintf("%sinc/libs/%s_functions.php", PATH, $name);
+
+               // Does the extension file exists?
+               if (FILE_READABLE($file1)) {
+                       // If there's no language file specified we don't need to load one... ;-)
+                       if (!empty($lang)) {
+                               // Create language file
+                               $file2 = sprintf("%sinc/language/%s_%s.php", PATH, $lang, GET_LANGUAGE());
+                       }
+
+                       if (FILE_READABLE($file3)) {
+                               // Special functions file
+                               $funcs = "Y";
+                               require_once($file3);
+                       } else {
+                               // Don't load functions file
+                               $funcs = "N";
+                       }
+
+                       // Do we need a language file?
+                       if (($file1 != $file2) && (FILE_READABLE($file2))) {
+                               // Load language file
+                               $lang = "Y";
+                               include($file2);
+                       } else {
+                               // Don't load language file
+                               $lang = "N";
+                       }
+
+                       // Load extension
+                       if ($name != "sql_patches") {
+                               // Load extension's file
+                               include_once($file1);
+                       } else {
+                               // KEEP sql_patches ALWAYS ACTIVE!
+                               $EXT_ALWAYS_ACTIVE = "Y";
+                       }
+
+                       if ($css == "Y") {
+                               $CSS_FILE = sprintf("%stheme/%s/css/%s.css", PATH, GET_CURR_THEME(), $name);
+                               if (FILE_READABLE($CSS_FILE)) {
+                                       // CSS file for extension was found (use only relative path for now!)
+                                       $EXT_CSS_FILES[] = $name.".css";
+                               } else {
+                                       // Don't load CSS file
+                                       $css = "N";
+                               }
+                       } // END - if
+
+                       // Add cache row
+                       if ($cacheMode == "init") {
+                               $cacheInstance->add_row(array(
+                                       'ext_id'      => $EXT_ID,
+                                       'ext_name'    => $name,
+                                       'ext_lang'    => $lang,
+                                       'ext_css'     => $css,
+                                       'ext_menu'    => $menu,
+                                       'ext_funcs'   => $funcs,
+                                       'ext_active'  => $active,
+                                       'ext_version' => $version,
+                                       'ext_keep'    => $EXT_ALWAYS_ACTIVE,
+                               ));
+                       } elseif ($cacheMode == "no") {
+                               // Remember this value for later usage
+                               $cacheArray['active_extensions'][$name] = $EXT_ALWAYS_ACTIVE;
+                       }
+               } elseif (!FILE_READABLE($file1)) {
+                       // Deleted extension file so we mark it for removal from DB
+                       $DEL[] = $name;
+               }
+       } // END - while
+
+       if ($cacheMode == "init") {
+               // Close cache file
+               $cacheInstance->cache_close();
+
+               // Load more cache files (like admins)
+               require_once(PATH."inc/load_cache.php");
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($res_ext_crt);
+}
+
+// Load include files if found
+if (!empty($INC_POOL[0])) {
+       foreach ($INC_POOL as $inc) {
+               require_once($inc);
+       } // END - foreach
+
+       // Remove array
+       unset($INC_POOL);
+} // END - if
+
+// Uninstall extensions that are no longer in our system
+if (!empty($DEL[0])) {
+       // Remove extensions from two tables: extension registry and tasks table
+       foreach ($DEL as $name) {
+               // First remove entry from extensions table
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                       array($name), __FILE__, __LINE__);
+
+               // Remove (maybe?) found tasks (main task and possible updates
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')",
+                       array($name), __FILE__, __LINE__);
+       } // END - foreach
+
+       // I think it's not neccessary to run the optimization function here
+       // because we didn't delete so much data from database. Can you aggree?
+} // END - if
+
+//
+?>
diff --git a/inc/loader/.htaccess b/inc/loader/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php
new file mode 100644 (file)
index 0000000..9210709
--- /dev/null
@@ -0,0 +1,166 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-config.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Let's start with the admins table...
+if (($cacheInstance->cache_file("admins", true) == true) && ($cacheInstance->ext_version_matches("admins"))) {
+       // Load cache
+       global $cacheArray;
+       $cacheArray['admins'] = $cacheInstance->cache_load();
+
+       // Check if valid
+       if ((is_array($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['aid']))) {
+               // Check count
+               if (count($cacheArray['admins']['login']) == count($cacheArray['admins']['aid'])) {
+                       //* DEBUG: */ echo "<PRE>";
+                       //* DEBUG: */ print_r($cacheArray['admins']);
+
+                       // The cache file seems to be fine
+                       foreach ($cacheArray['admins']['login'] as $k => $login) {
+                               // Rewrite default_acl
+                               $cacheArray['admins']['aid'][$login]      = $cacheArray['admins']['aid'][$k];
+                               $cacheArray['admins']['password'][$login] = $cacheArray['admins']['password'][$k];
+                               $cacheArray['admins']['email'][$login]    = $cacheArray['admins']['email'][$k];
+
+                               // Some extra data depending on version
+                               if (GET_EXT_VERSION("admins") >= "0.3") {
+                                       $cacheArray['admins']['def_acl'][$login]  = $cacheArray['admins']['def_acl'][$k];
+                                       if (GET_EXT_VERSION("admins") >= "0.6.7") {
+                                               $cacheArray['admins']['la_mode'][$login]  = $cacheArray['admins']['la_mode'][$k];
+                                               if (GET_EXT_VERSION("admins") >= "0.7.0") {
+                                                       $cacheArray['admins']['login_failtures'][$login] = $cacheArray['admins']['login_failtures'][$k];
+                                                       $cacheArray['admins']['last_failture'][$login]   = $cacheArray['admins']['last_failture'][$k];
+                                               } // END - if
+                                       } // END - if
+                               } // END - if
+
+                               //* DEBUG: */ print_r($cacheArray['admins']);
+
+                               // Clear array
+                               foreach (array('aid', 'def_acl', 'la_mode', 'password', 'email', 'login_failtures', 'last_failture') as $rem) {
+                                       if (isset($cacheArray['admins'][$rem][$k])) unset($cacheArray['admins'][$rem][$k]);
+                               } // END - foreach
+                       } // END - if
+
+                       //* DEBUG: */ print_r($cacheArray['admins']);
+
+                       // Rewrite Login
+                       foreach ($cacheArray['admins']['login'] as $k => $login) {
+                               $cacheArray['admins']['login'][$cacheArray['admins']['aid'][$login]] = $login;
+                               if (!in_array($k, $cacheArray['admins']['aid'])) {
+                                       unset($cacheArray['admins']['login'][$k]);
+                               } // END - if
+                       } // END - foreach
+
+                       //* DEBUG: */ echo "****\n";
+                       //* DEBUG: */ print_r($cacheArray['admins']);
+                       //* DEBUG: */ echo "</PRE>";
+                       //* DEBUG: */ die();
+               } else {
+                       // Nope, cache file is corrupted!
+                       $cacheInstance->cache_destroy();
+               }
+       } else {
+               // Nope, cache file is corrupted!
+               $cacheInstance->cache_destroy();
+               unset($cacheArray['admins']);
+       }
+} elseif (($_CONFIG['cache_admins'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file
+       $cacheInstance->cache_init("ADMINS");
+       $cacheInstance->store_extension_version("admins");
+
+       // Load every data from DB to cache file
+       $ADD = ", id, id";
+       if (GET_EXT_VERSION("admins") >= "0.3")   $ADD  = ", default_acl AS def_acl";
+       if (GET_EXT_VERSION("admins") >= "0.6.7") $ADD .= ", la_mode";
+       if (GET_EXT_VERSION("admins") >= "0.7.0") $ADD .= ", login_failtures, UNIX_TIMESTAMP(last_failture) AS last_failture";
+
+       // Query the database about this
+       $result_admins = SQL_QUERY("SELECT id AS aid, login, password, email".$ADD."
+FROM "._MYSQL_PREFIX."_admins
+ORDER BY login", __FILE__, __LINE__);
+       while($dummy = SQL_FETCHARRAY($result_admins)) {
+               // Save row
+               $cacheInstance->add_row($dummy);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result_admins);
+
+       // Close cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+// Next cached table are the admins_acls...
+if (GET_EXT_VERSION("admins") >= "0.3") {
+       // Check for cache file
+       if ($cacheInstance->cache_file("admins_acls", true) == true) {
+               // Load referral system from cache
+               global $cacheArray;
+               $cacheArray['admin_acls'] = $cacheInstance->cache_load();
+       } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+               // Create cache file here
+               $cacheInstance->cache_init("ADMINS_ACLS");
+
+               // Load all modules and their data
+               $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
+               while ($data = SQL_FETCHARRAY($result)) {
+                       // Add row to cache file
+                       $cacheInstance->add_row($data);
+               } // END - while
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Reload the cache
+               require(__FILE__);
+       }
+
+       // Close file
+       $cacheInstance->cache_close();
+} // END - if
+
+//
+?>
diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php
new file mode 100644 (file)
index 0000000..8139855
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-config.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Next cached table is the configuration (config)...
+if ($cacheInstance->cache_file("config", true) == true) {
+       // Load config from cache
+       global $cacheArray;
+       $cacheArrayConfig = $cacheInstance->cache_load();
+} elseif (($_CONFIG['cache_config'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file here
+       $cacheInstance->cache_init("CONFIG");
+
+       // Load all modules and their data
+       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config ORDER BY config", __FILE__, __LINE__);
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Add row to cache file
+               $cacheInstance->add_row($data);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Close the cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+//
+?>
diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php
new file mode 100644 (file)
index 0000000..ed67974
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-config.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Next cached table is the module registry (mod_reg)...
+if ($cacheInstance->cache_file("mod_reg", true) == true) {
+       // Load cache
+       global $cacheArray;
+       $cacheArray['modules'] = $cacheInstance->cache_load();
+
+       // Rewrite module cache
+       $modArray = $cacheArray['modules'];
+       foreach ($modArray['module'] as $key => $mod) {
+               $cacheArray['modules']['id'][$mod] = $modArray['id'][$key];
+               unset($cacheArray['modules']['id'][$key]);
+               $cacheArray['modules']['title'][$mod] = $modArray['title'][$key];
+               unset($cacheArray['modules']['title'][$key]);
+               $cacheArray['modules']['locked'][$mod] = $modArray['locked'][$key];
+               unset($cacheArray['modules']['locked'][$key]);
+               $cacheArray['modules']['hidden'][$mod] = $modArray['hidden'][$key];
+               unset($cacheArray['modules']['hidden'][$key]);
+               $cacheArray['modules']['admin_only'][$mod] = $modArray['admin_only'][$key];
+               unset($cacheArray['modules']['admin_only'][$key]);
+               $cacheArray['modules']['mem_only'][$mod] = $modArray['mem_only'][$key];
+               unset($cacheArray['modules']['mem_only'][$key]);
+               if (isset($cacheArray['modules']['has_menu'][$key])) {
+                       $cacheArray['modules']['has_menu'][$mod] = $modArray['has_menu'][$key];
+                       unset($cacheArray['modules']['has_menu'][$key]);
+               } // END - if
+       } // END - foreach
+       unset($modArray);
+} elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file here
+       $cacheInstance->cache_init("MODULES");
+
+       // Load all modules and their data
+       if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
+               // Load has_menu
+               $result = SQL_QUERY("SELECT id, module, title, locked, hidden, admin_only, title, mem_only, has_menu
+FROM "._MYSQL_PREFIX."_mod_reg ORDER BY id", __FILE__, __LINE__);
+       } else {
+               // Don't load has_menu
+               $result = SQL_QUERY("SELECT id, module, title, locked, hidden, admin_only, title, mem_only
+FROM "._MYSQL_PREFIX."_mod_reg ORDER BY id", __FILE__, __LINE__);
+       }
+
+       // Cache all data
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Add row to cache file
+               $cacheInstance->add_row($data);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Close the cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+//
+?>
diff --git a/inc/loader/load_cache-refdepths.php b/inc/loader/load_cache-refdepths.php
new file mode 100644 (file)
index 0000000..7d8c1aa
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-config.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Next cached table is the referral system (refdepths)...
+if ($cacheInstance->cache_file("refdepths", true) == true) {
+       // Load referral system from cache
+       global $cacheArray;
+       $cacheArray['ref_depths'] = $cacheInstance->cache_load();
+} elseif (($_CONFIG['cache_refdepth'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file here
+       $cacheInstance->cache_init("REFDEPTHS");
+
+       // Load all modules and their data
+       $result = SQL_QUERY("SELECT id, level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Add row to cache file
+               $cacheInstance->add_row($data);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Close the cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+//
+?>
diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php
new file mode 100644 (file)
index 0000000..1a6ad2d
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-config.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Next cached table is the referral system (refsystem)...
+if ($cacheInstance->cache_file("refsystem", true) == true) {
+       // Load referral system from cache
+       global $cacheArray;
+       $cacheArray['ref_system'] = $cacheInstance->cache_load();
+} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file here
+       $cacheInstance->cache_init("REFSYSTEM");
+
+       // Load all modules and their data
+       $result = SQL_QUERY("SELECT id, userid, level, counter FROM "._MYSQL_PREFIX."_refsystem ORDER BY userid, level", __FILE__, __LINE__);
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Add row to cache file
+               $cacheInstance->add_row($data);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Close the cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+//
+?>
diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php
new file mode 100644 (file)
index 0000000..f67cc10
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/15/2008 *
+ * ===============                              Last change: 09/15/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : load_cache-them.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Cache-Dateien nachladen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Next cached table is the referral system (themes)...
+if (($cacheInstance->cache_file("themes", true) == true) && ($cacheInstance->ext_version_matches("theme"))) {
+       // Load referral system from cache
+       global $cacheArray;
+       $cache = $cacheInstance->cache_load();
+
+       // Restructure the array
+       $cacheArray['themes'] = array();
+       foreach ($cache as $key => $data) {
+               // Skip "theme_path" because we don't need to rebuild it
+               if ($key == "theme_path") {
+                       // Add entries with id
+                       foreach ($data as $id => $entry) {
+                               $cacheArray['themes']['theme_path'][$cache['id'][$id]] = $entry;
+                       } // END - foreach
+               } else {
+                       // Add all themes with theme name as array index
+                       foreach ($data as $id => $entry) {
+                               $cacheArray['themes'][$key][$cache['theme_path'][$id]] = $entry;
+                       } // END - foreach
+               }
+       } // END - if
+
+       // Remove dummy array
+       unset($cache);
+} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       // Create cache file here
+       $cacheInstance->cache_init("THEMES");
+       $cacheInstance->store_extension_version("theme");
+
+       // Load all themes and their data
+       if (GET_EXT_VERSION("theme") >= "0.0.7") {
+               $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__);
+       } else {
+               $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__);
+       }
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Add row to cache file
+               $cacheInstance->add_row($data);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Close the cache
+       $cacheInstance->cache_close();
+
+       // Reload the cache
+       require(__FILE__);
+}
+
+// Close file
+$cacheInstance->cache_close();
+
+//
+?>
diff --git a/inc/mails/.htaccess b/inc/mails/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/mails/_mails.php b/inc/mails/_mails.php
new file mode 100644 (file)
index 0000000..2032d04
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/29/2005 *
+ * ===============                              Last change: 11/29/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : _mails.php                                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out reminder mails                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Versendet Erinnerungsmails                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "");
+       return;
+}
+
+// Do not execute when script is in CSS mode
+if ($CSS == 1) return;
+
+//
+?>
diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php
new file mode 100644 (file)
index 0000000..06ed2b8
--- /dev/null
@@ -0,0 +1,167 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/22/2005 *
+ * ===============                              Last change: 11/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : beg_mails.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out reminder mails                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Versendet Erinnerungsmails                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Do not execute when script is in CSS mode
+if ($CSS == 1) return;
+
+// Create timemark from saved month
+$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
+$SQL = ""; $MODE = "";
+
+// Shall I sent activation or deactivation mail?
+$SQL = "SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE (beg_ral_notify ";
+switch ($_CONFIG['beg_rallye'])
+{
+case 'Y': // Begging rallye is activated
+       if ($_CONFIG['beg_ral_en_notify'] == "Y")
+       {
+               // Okay, let's check for member accounts
+               $SQL .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)";
+               $MODE = "en";
+       }
+        else
+       {
+               // Do not notify!
+               $SQL = "";
+       }
+       break;
+
+case 'N': // Begging rallye is deactivated
+       if ($_CONFIG['beg_ral_di_notify'] == "Y")
+       {
+               // Okay, let's check for member accounts
+               $SQL .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify";
+               $MODE = "di";
+       }
+        else
+       {
+               // Do not notify!
+               $SQL = "";
+       }
+       break;
+}
+
+if (!empty($SQL))
+{
+       // The SQL command needs to be finisched here (only confirmed accounts!)
+       $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
+
+       // Prepare data for the template
+       define('__BEG_MIN_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points']));
+       define('__BEG_MAX_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points_max']));
+       define('__BEG_MAX_WINNERS', round($_CONFIG['beg_ranks']));
+       if ($_CONFIG['beg_ip_timeout'] == 0)
+       {
+               // No IP locking setuped!
+               define('__BEG_IP_LOCKER', BEG_NO_LIMITATION);
+       }
+        else
+       {
+               // Create timemark
+               define('__BEG_IP_LOCKER', CREATE_FANCY_TIME($_CONFIG['beg_ip_timeout']));
+       }
+
+       // Check for accounts to be notified
+       $result_main = SQL_QUERY($SQL, __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) > 0)
+       {
+               // Normal notification mails or bonus mails?
+               $MAIL_MODE = (($_CONFIG['beg_notify_bonus'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
+
+               // Generate subject line
+               $eval = "\$SUBJECT = BEG_RALLYE_".strtoupper($MODE)."_NOTIFY;";
+               eval($eval);
+
+               // Load message body for bonus mails
+               $MSG = LOAD_EMAIL_TEMPLATE("beg_en_notify_body", "", "{PER}uid{PER}");
+               $RECEIVER = ""; $UIDs = array();
+
+               // Okay lets notify all users!
+               while(list($uid, $email) = SQL_FETCHROW($result_main))
+               {
+                       // Update account
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET beg_ral_notify='%s', beg_ral_%s_notify='%s' WHERE userid=%s LIMIT 1",
+ array(time(), $MODE, time(), $uid), __FILE__, __LINE__);
+
+                       // Load email template and send it to the user!
+                       if ($MAIL_MODE)
+                       {
+                               // Add userid to queue
+                               $UIDs[] = $uid;
+                       }
+                        else
+                       {
+                               // Send normal notification mail to the members
+                               $MSG = LOAD_EMAIL_TEMPLATE("beg_".$MODE."_notify", array(), $uid);
+                               SEND_EMAIL($email, $SUBJECT, $MSG);
+                       }
+               }
+
+               // Shall I send out bonus mails?
+               if ($MAIL_MODE)
+               {
+                       // Okay, make array to string
+                       $RECEIVER = implode(";", $UIDs);
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus
+(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, is_notify)
+VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(), '%s','%s','%s','%s','Y')",
+ array(
+       $SUBJECT,
+       $MSG,
+       $RECEIVER,
+       $_CONFIG['beg_notify_bonus'],
+       $_CONFIG['beg_notify_wait'],
+       URL."/modules.php?module=index&what=login",
+       0,
+       SELECTION_COUNT(explode(";", $RECEIVER)),
+       SQL_NUMROWS($result_main),
+), __FILE__, __LINE__);
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_main);
+}
+
+//
+?>
diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php
new file mode 100644 (file)
index 0000000..e4b9716
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/23/2004 *
+ * ===============                              Last change: 11/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : birthday_mails.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out birthday mails                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Versendet Geburtstagsmails                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("birthday")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "birthday");
+       return;
+}
+
+// Do not execute when script is in CSS mode
+if ($CSS == 1) return;
+
+// Get current day (01 to 31), month (01 to 12) and year (4-digits year)
+$DAY   = date("d", time());
+$MONTH = date("m", time());
+$YEAR  = date('Y', time());
+
+// Shall I include only active members?
+$ADD = "%s"; $VALUE = "";
+if (($_CONFIG['birthday_active']) && (EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) {
+       $ADD = " AND last_online >= (UNIX_TIMESTAP() - %s)";
+       $VALUE = $_CONFIG['ap_inactive_since'];
+}
+
+// Only confirmed members shall receive birthday mails...
+$result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
+FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".($_CONFIG['one_day'] * 364).")".$ADD."
+ORDER BY userid",
+ array($DAY, $MONTH, $VALUE), __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result_birthday) > 0) {
+       // Start sending out birthday mails
+       while (list($uid, $email, $byear) = SQL_FETCHROW($result_birthday)) {
+               // Calculate own timestamp for birthday and today
+               $BD  = $byear + 12 * $MONTH + 365 * $DAY;
+               $NOW = $YEAR  + 12 * $MONTH + 365 * $DAY;
+
+               // Simply subtract both values and you got the age... :)
+               $AGE = $NOW - $BD;
+
+               if ($_CONFIG['birthday_points'] > 0) {
+                       // Prepare array for loading template
+                       $content = array(
+                               'age'    => $AGE,
+                               'points' => $_CONFIG['birthday_points'],
+                               'check'  => "",
+                       );
+
+                       for ($idx = 0; $idx < 4; $idx++) {
+                               $content['check'] .= GEN_RANDOM_CODE("8", rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
+                       }
+
+                       // Insert row into database
+                       $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_birthday (userid, points, chk_value) VALUES ('%s','%s','%s' )",
+                        array(bigintval($uid), $_CONFIG['birthday_points'], $content['check']), __FILE__, __LINE__);
+
+                       // Load email template with confirmation link
+                       $msg = LOAD_EMAIL_TEMPLATE("member_birthday_confirm", $content, bigintval($uid));
+               } else {
+                       // Load default email template and fill in the age
+                       $msg = LOAD_EMAIL_TEMPLATE("member_birthday", $AGE, $uid);
+               }
+
+               // Send email
+               SEND_EMAIL($email, HAPPY_BIRTHDAY, $msg);
+
+               // Remember him that he has received a birthday mail
+               $result_bd = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET birthday_sent=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
+                array(bigintval($uid)), __FILE__, __LINE__);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+
+//
+?>
diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php
new file mode 100644 (file)
index 0000000..8634d0a
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/22/2005 *
+ * ===============                              Last change: 11/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : bonus_mails.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out reminder mails                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Versendet Erinnerungsmails                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+       return;
+}
+
+// Do not execute when script is in CSS mode
+if ($CSS == 1) return;
+
+// Create timemark from saved month
+$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
+$SQL = ""; $MODE = "";
+
+// Shall I sent activation or deactivation mail?
+$SQL = "SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE (bonus_ral_notify ";
+switch ($_CONFIG['bonus_active'])
+{
+case 'Y': // Active rallye is activated
+       if ($_CONFIG['bonus_en_notify'] == "Y")
+       {
+               // Okay, let's check for member accounts
+               $SQL .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)";
+               $MODE = "en";
+       }
+        else
+       {
+               // Do not notify!
+               $SQL = "";
+       }
+       break;
+
+case 'N': // Active rallye is deactivated
+       if ($_CONFIG['bonus_di_notify'] == "Y")
+       {
+               // Okay, let's check for member accounts
+               $SQL .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify";
+               $MODE = "di";
+       }
+        else
+       {
+               // Do not notify!
+               $SQL = "";
+       }
+       break;
+}
+
+if (!empty($SQL))
+{
+       // The SQL command needs to be finisched here (only confirmed accounts!)
+       $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
+
+       // Normal notification mails or bonus mails?
+       $MAIL_MODE = (($_CONFIG['bonus_notify_points'] > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
+
+       // Generate subject line
+       $eval = "\$SUBJECT = BONUS_RALLYE_".strtoupper($MODE)."_NOTIFY;";
+       eval($eval);
+
+       // Load message body for bonus mails
+       $MSG = LOAD_EMAIL_TEMPLATE("bonus_en_notify_body", "", "{PER}uid{PER}");
+       $RECEIVER = ""; $UIDs = array();
+
+       // Check for accounts to be notified
+       $result_main = SQL_QUERY($SQL, __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) > 0)
+       {
+               // Okay lets notify all users!
+               while(list($uid, $email) = SQL_FETCHROW($result_main))
+               {
+                       // Update account
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' WHERE userid=%s LIMIT 1",
+ array(time(), $MODE, time(), $uid), __FILE__, __LINE__);
+
+                       // Load email template and send it to the user!
+                       if ($MAIL_MODE)
+                       {
+                               // Add userid to queue
+                               $UIDs[] = $uid;
+                       }
+                        else
+                       {
+                               // Send normal notification mail to the members
+                               $MSG = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $uid);
+                               SEND_EMAIL($email, $SUBJECT, $MSG);
+                       }
+               }
+
+               // Shall I send out bonus mails?
+               if ($MAIL_MODE)
+               {
+                       // Okay, make array to string
+                       $RECEIVER = implode(";", $UIDs);
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus
+(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, is_notify)
+VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(), '%s','%s','%s','%s','Y')",
+ array(
+       $SUBJECT,
+       $MSG,
+       $RECEIVER,
+       $_CONFIG['bonus_notify_points'],
+       $_CONFIG['bonus_notify_wait'],
+       URL."/modules.php?module=index&what=login",
+       0,
+       SELECTION_COUNT(explode(";", $RECEIVER)),
+       SQL_NUMROWS($result_main),
+), __FILE__, __LINE__);
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_main);
+}
+//
+?>
diff --git a/inc/modules/.htaccess b/inc/modules/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/modules/admin.php b/inc/modules/admin.php
new file mode 100644 (file)
index 0000000..515c745
--- /dev/null
@@ -0,0 +1,401 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2003 *
+ * ===============                              Last change: 07/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : admin.php                                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Administration module                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Administrationsmodul                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Login is default
+if ((empty($GLOBALS['action'])) && ($check == "admin_only")) {
+       // Redirect to right URL
+       LOAD_URL("modules.php?module=admin&amp;action=login");
+}
+
+// Load include file
+require_once(PATH."inc/modules/admin/admin-inc.php");
+
+// Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
+FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
+
+if (!isBooleanConstantAndTrue('admin_registered')) {
+       // Admin is not registered so we have to inform the user
+       if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
+       if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
+               // Hash the password with the old function because we are here in install mode
+               $hashedPass = md5($_POST['pass']);
+
+               // Kill maybe existing session variables
+               set_session('admin_login'       , "");
+               set_session('admin_md5'         , "");
+               set_session('admin_last'        , "");
+               set_session('admin_to'          , "");
+
+               // Do registration
+               $ret = REGISTER_ADMIN($_POST['login'], $hashedPass);
+               switch ($ret)
+               {
+               case "done":
+                       admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+                       if (!_FATAL) {
+                               // Registering is done
+                               LOAD_URL(URL."/modules.php?module=admin&amp;action=login&register=done");
+                       } else {
+                               $ret = ADMIN_CANNOT_COMPLETE;
+                       }
+                       break;
+
+               case "failed":
+                       $ret = ADMIN_REGISTER_FAILED;
+                       break;
+
+               case "already":
+               default:
+                       if ($ret == "already") {
+                               // Admin does already exists!
+                               $ret = ADMIN_LOGIN_ALREADY_REG;
+                       } else {
+                               // Any other kind
+                               $ret = "done";
+                       }
+
+                       if (!isBooleanConstantAndTrue('admin_registered')) {
+                               // Write to config that registration is done
+                               admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+
+                               // Load URL for login
+                               $URL = URL."/modules.php?module=admin&amp;action=login";
+                               LOAD_URL($URL);
+                       }
+                       break;
+               }
+       }
+
+       // Whas that action okay?
+       if ($ret != "done") {
+               // Fixes another "Notice"
+               if (!empty($_POST['login'])) {
+                       define('__LOGIN_VALUE', $_POST['login']);
+               } else {
+                       define('__LOGIN_VALUE', "");
+               }
+
+               // Yet-another "Notice" fix
+               if ((!empty($_POST['ok'])) && ($_POST['ok'] == "***")) {
+                       // No login entered?
+                       if (empty($_POST['login'])) $MSG1 = ADMIN_NO_LOGIN;
+
+                       // An error comes back from registration?
+                       if (!empty($ret)) $MSG1 = $ret;
+
+                       // No password entered?
+                       if (empty($_POST['pass'])) $MSG2 = ADMIN_NO_PASS;
+
+                       // Or password too short?
+                       if (strlen($_POST['pass']) < 4) $MSG2 = ADMIN_SHORT_PASS;
+
+                       // Output error messages
+                       define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1));
+                       define('__MSG_PASS',  LOAD_TEMPLATE("admin_login_msg", true, $MSG2));
+
+                       // Reset variables
+                       $MSG1 = ""; $MSG2 = "";
+               } else {
+                       // Reset values to nothing
+                       define('__MSG_LOGIN', "");
+                       define('__MSG_PASS' , "");
+               }
+
+               // Load register template
+               LOAD_TEMPLATE("admin_reg_form");
+       }
+} elseif (isset($_GET['reset_pass'])) {
+       // Is the form submitted?
+       if ((isset($_POST['send_link'])) && (!empty($_POST['email']))) {
+               // Try to send the link out
+               $OUT = ADMIN_SEND_PASSWORD_RESET_LINK($_POST['email']);
+
+               // Output result
+               LOAD_TEMPLATE("admin_settings_saved", false, $OUT);
+       } elseif (!empty($_GET['hash'])) {
+               // Output form for hash validation
+               LOAD_TEMPLATE("admin_validate_reset_hash_form", false, $_GET['hash']);
+       } elseif ((isset($_POST['validate_hash'])) && (!empty($_POST['login'])) && (!empty($_POST['hash']))) {
+               // Validate the login data and hash
+               $valid = ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN($_POST['hash'], $_POST['login']);
+
+               // Valid?
+               if ($valid) {
+                       // Prepare content first
+                       $content = array(
+                               'hash'  => SQL_ESCAPE($_POST['hash']),
+                               'login' => SQL_ESCAPE($_POST['login'])
+                       );
+
+                       // Validation okay so display form for final password change
+                       LOAD_TEMPLATE("admin_reset_password_form", false, $content);
+               } else {
+                       // Cannot validate the login data and hash
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED);
+               }
+       } elseif ((isset($_POST['reset_pass'])) && (!empty($_POST['hash'])) && (!empty($_POST['login'])) && (!empty($_POST['pass1'])) && ($_POST['pass1'] == $_POST['pass2'])) {
+               // Okay, we shall the admin password here. So first revalidate the hash
+               if (ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN($_POST['hash'], $_POST['login'])) {
+                       // Set the password now
+                       $OUT = ADMIN_RESET_PASSWORD($_POST['login'], $_POST['pass1']);
+
+                       // Output result
+                       LOAD_TEMPLATE("admin_reset_pass_done", false, $OUT);
+               } else {
+                       // Validation failed
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2);
+               }
+       } else {
+               // Output reset password form
+               LOAD_TEMPLATE("admin_send_reset_link");
+       }
+} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((get_session('admin_last') + bigintval(get_session('admin_to')) * 3600 * 24) < time())) {
+       // At leat one administrator account was created
+       if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
+               // Timeout for last login, we have to logout first!
+               $URL = URL."/modules.php?module=admin&amp;action=login&amp;logout=1";
+               LOAD_URL($URL);
+       }
+       if (!empty($_GET['register'])) {
+               // Registration of first admin is done
+               if ($_GET['register'] == "done") OUTPUT_HTML("<STRONG class=\"admin\">".ADMIN_REGISTER_DONE."</STRONG>");
+       } // END - if
+
+       // Check if the admin has submitted data or not
+       $ret = "";
+       if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
+       if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
+               // All required data was entered so we check his account
+               $ret = CHECK_ADMIN_LOGIN($_POST['login'], $_POST['pass']);
+
+               // Which status do we have?
+               switch ($ret)
+               {
+               case "done": // Admin and password are okay, so we log in now
+                       // Construct URL and redirect
+                       $URL = URL."/modules.php?module=admin&amp;";
+
+                       // Rewrite overview module
+                       if ($GLOBALS['what'] == "overview") {
+                               $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                       }
+
+                       // Add data to URL
+                       if (!empty($GLOBALS['what'])) $URL .= "what=".$GLOBALS['what'];
+                        elseif (!empty($GLOBALS['action'])) $URL .= "action=".$GLOBALS['action'];
+                        elseif (!empty($_GET['area'])) $URL .= "area=".$_GET['area'];
+
+                       // Load URL
+                       LOAD_URL($URL);
+                       break;
+
+               case "404": // Administrator login not found
+                       $_POST['ok'] = $ret;
+                       $ret = ADMIN_NOT_FOUND;
+                       break;
+
+               case "pass": // Wrong password
+                       $_POST['ok'] = $ret;
+                       $ret = WRONG_PASS." [<A href=\"".URL."/modules.php?module=admin&amp;reset_pass=1\">".ADMIN_RESET_PASS."</A>]\n";
+                       break;
+               }
+       }
+       if ($ret != "done") {
+               if (!empty($_POST['login'])) {
+                       define('__LOGIN_VALUE', $_POST['login']);
+               } else {
+                       define('__LOGIN_VALUE', "");
+               }
+
+               if (isset($_POST['ok'])) {
+                       // Set messages to zero
+
+                       $MSG1 = ""; $MSG2 = "";
+                       // No login entered?
+                       if (empty($_POST['login'])) $MSG1 = ADMIN_NO_LOGIN;
+
+                       // An error comes back from login?
+                       if ((!empty($ret)) && ($_POST['ok'] == "404")) $MSG1 = $ret;
+
+                       // No password entered?
+                       if (empty($_POST['pass'])) $MSG2 = ADMIN_NO_PASS;
+
+                       // Or password too short?
+                       if (strlen($_POST['pass']) < 4) $MSG2 = ADMIN_SHORT_PASS;
+
+                       // An error comes back from login?
+                       if ((!empty($ret)) && ($_POST['ok'] == "pass")) $MSG2 = $ret;
+
+                       // Load message template
+                       define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1));
+                       define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $MSG2));
+
+                       // Reset variables
+                       $MSG1 = ""; $MSG2 = "";
+               } else {
+                       // Set constants to empty for hiding them
+                       define('__MSG_LOGIN', "");
+                       define('__MSG_PASS' , "");
+               }
+
+               // Load login form
+               if (!empty($GLOBALS['what'])) {
+                       // Restore old what value
+                       $content = array('target' => "what", 'value' => $GLOBALS['what']);
+               } elseif (!empty($GLOBALS['action'])) {
+                       if ($GLOBALS['action'] != "logout") {
+                               // Restore old action value
+                               $content = array('target' => "action", 'value' => $GLOBALS['action']);
+                       } else {
+                               // Set default values
+                               $content = array('target' => "action", 'value' => "login");
+                       }
+               } elseif (!empty($_GET['area'])) {
+                       // Restore old area value
+                       $content = array('target' => "area", 'value' => $_GET['area']);
+               } else {
+                       // Set default values
+                       $content = array('target' => "action", 'value' => "login");
+               }
+
+               // Load login form template
+               LOAD_TEMPLATE("admin_login_form", false, $content);
+       }
+} elseif (isset($_GET['logout'])) {
+       // Only try to remove cookies
+       if (set_session("admin_login", "") && set_session("admin_md5", "") && set_session("admin_last", "") && set_session("admin_to", "")) {
+               // Also remove array elements
+               set_session('admin_login', "");
+               set_session('admin_md5'  , "");
+               set_session('admin_last' , "");
+               set_session('admin_to'   , "");
+
+               // Destroy session
+               @session_destroy();
+
+               // Load logout template
+               if (isset($_GET['register'])) {
+                       // Secure input
+                       $register = SQL_ESCAPE($_GET['register']);
+
+                       // Special logout redirect for installation of given extension
+                       LOAD_TEMPLATE(sprintf("admin_logout_%s_install", $register));
+               } elseif (isset($_GET['remove'])) {
+                       // Secure input
+                       $remove = SQL_ESCAPE($_GET['remove']);
+
+                       // Special logout redirect for removal of given extension
+                       LOAD_TEMPLATE(sprintf("admin_logout_%s_remove", $remove));
+               } else {
+                       // Logged out normally
+                       LOAD_TEMPLATE("admin_logout");
+               }
+       } else {
+               // Something went wrong here...
+               OUTPUT_HTML("<STRONG class=\"admin_fatal\">".ADMIN_LOGOUT_FAILED."</STRONG>");
+
+               // Add fatal message
+               ADD_FATAL(CANNOT_UNREG_SESS);
+       }
+} else {
+       // Maybe an Admin want's to login?
+       $ret = CHECK_ADMIN_COOKIES(get_session('admin_login'), get_session('admin_md5'));
+       switch ($ret)
+       {
+       case "done":
+               // Cookie-Data accepted
+               if ((set_session("admin_md5", get_session('admin_md5'))) && (set_session("admin_login", get_session('admin_login'))) && (set_session("admin_last", time())) && (set_session("admin_to", bigintval(get_session('admin_to'))))) {
+                       // Ok, Cookie-Update done
+                       if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+                               // Check if action GET variable was set
+                               $act = SQL_ESCAPE($GLOBALS['action']);
+                               if (!empty($GLOBALS['what'])) {
+                                       // Get action value by what-value
+                                       $act = GET_ACTION("admin", $GLOBALS['what']);
+                               }
+
+                               // Check for access control line of current menu entry
+                               define('__ACL_ALLOW', ADMINS_CHECK_ACL($act, $GLOBALS['what']));
+                       } else {
+                               // Extension not installed so it's always allowed to access everywhere!
+                               define('__ACL_ALLOW', true);
+                       }
+
+                       // When type of admin menu is not set fallback to old menu system
+                       if (empty($_CONFIG['admin_menu'])) $_CONFIG['admin_menu'] = "OLD";
+
+                       // Check for version and switch between old menu system and new "intelligent menu system"
+                       if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (FILE_READABLE(PATH."inc/modules/admin/lasys-inc.php"))) {
+                               // Default area is the entrance, of course
+                               $area = "entrance";
+
+                               // Check for similar URL variable
+                               if (!empty($_GET['area'])) $area = SQL_ESCAPE($_GET['area']);
+
+                               // Load "logical-area menu-system" file
+                               require_once(PATH."inc/modules/admin/lasys-inc.php");
+
+                               // Create new-style menu system will "logical areas"
+                               ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']);
+                       } else {
+                               // This little call constructs the whole default old and lacky menu system
+                               // on left side
+                               ADMIN_DO_ACTION($GLOBALS['what']);
+                       }
+               } else {
+                       // Login failed (cookies enabled?)
+                       OUTPUT_HTML("<STRONG class=\"admin_fatal\">".ADMIN_LOGIN_FAILED."</STRONG>");
+                       ADD_FATAL(CANNOT_RE_REGISTER_SESS);
+               }
+               break;
+
+       case "404": // Administrator login not found
+               $_POST['ok'] = $ret;
+               ADD_FATAL(ADMIN_NOT_FOUND);
+               break;
+
+       case "pass": // Wrong password
+               $_POST['ok'] = $ret;
+               ADD_FATAL(WRONG_PASS);
+               break;
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/.htaccess b/inc/modules/admin/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/modules/admin/action- b/inc/modules/admin/action-
new file mode 100644 (file)
index 0000000..81a2fca
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/06/2004 *
+ * ===============                              Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) { 
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php
new file mode 100644 (file)
index 0000000..41ddf38
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/06/2004 *
+ * ===============                              Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-admins.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup admin accounts                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin-Accounts verwalten                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php
new file mode 100644 (file)
index 0000000..6bd915d
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/31/2007 *
+ * ===============                              Last change: 05/31/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-bank.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php
new file mode 100644 (file)
index 0000000..b78e478
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/30/2005 *
+ * ===============                              Last change: 04/30/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-country.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Country code management                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Laendercode-Management                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php
new file mode 100644 (file)
index 0000000..2906a36
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2005 *
+ * ===============                              Last change: 02/12/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-doubler.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Points doubler                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punkte-Verdoppler                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf(."%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php
new file mode 100644 (file)
index 0000000..3c2d835
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-email.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Main menu "EMails"                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptmenue "E-Mails"                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php
new file mode 100644 (file)
index 0000000..23a5894
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ===============                              Last change: 07/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-holiday.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Manage holiday requests                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Urlaubsschaltungen verwalten                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php
new file mode 100644 (file)
index 0000000..9e7aed0
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-login.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Login area and welcome page                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einloggen und Willkommensseite                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) { 
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-logout.php b/inc/modules/admin/action-logout.php
new file mode 100644 (file)
index 0000000..2658ae6
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/13/2006 *
+ * ===============                              Last change: 01/13/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-logout.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Logout menu point                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausloggen-Menuepunkt                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_POST['no'])) {
+       // Do not logout now
+       LOAD_URL("modules.php?module=admin");
+} elseif ((!empty($_POST['yes'])) && ($GLOBALS['action'] == "logout")) {
+       // Redirect to logout link
+       LOAD_URL("modules.php?module=admin&amp;logout=1");
+} else {
+       // Load logout form template
+       LOAD_TEMPLATE("admin_logout_form");
+}
+//
+?>
diff --git a/inc/modules/admin/action-menu.php b/inc/modules/admin/action-menu.php
new file mode 100644 (file)
index 0000000..4eb92e2
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-menu.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Editing all three menu systems                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle drei Menue-Systeme bearbeiten               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-misc.php b/inc/modules/admin/action-misc.php
new file mode 100644 (file)
index 0000000..e05467e
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-misc.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Misc things: new patches / versions and so on    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verschiedenes: Nach Patches/Updates suchen usw.  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-mods.php b/inc/modules/admin/action-mods.php
new file mode 100644 (file)
index 0000000..6ce43d0
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2004 *
+ * ===============                              Last change: 08/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-mods.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Module management                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Modul-Management                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-newsletter.php b/inc/modules/admin/action-newsletter.php
new file mode 100644 (file)
index 0000000..edfbc80
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/06/2004 *
+ * ===============                              Last change: 03/06/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-newsletter.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Newsletter management                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Newsletter-Management                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-payouts.php b/inc/modules/admin/action-payouts.php
new file mode 100644 (file)
index 0000000..3f1c2aa
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/08/2004 *
+ * ===============                              Last change: 05/08/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-payouts.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Payout management                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Management                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php
new file mode 100644 (file)
index 0000000..d310efd
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ===============                              Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-primera.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Main admin menu for Primera                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptadminmenue fuer Primera                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-rallye.php b/inc/modules/admin/action-rallye.php
new file mode 100644 (file)
index 0000000..c09a5b9
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/29/2004 *
+ * ===============                              Last change: 06/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-rallye.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Rallye management                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Rallye Management                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-repair.php b/inc/modules/admin/action-repair.php
new file mode 100644 (file)
index 0000000..cee773a
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/24/2004 *
+ * ===============                              Last change: 04/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-repair.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Repair actions                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Reperaturaktionen                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php
new file mode 100644 (file)
index 0000000..df95734
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-setup.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php
new file mode 100644 (file)
index 0000000..459607d
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/02/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-sponsor.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : SignUp-actons                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : SignUp-Aktionen                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+//
+?>
diff --git a/inc/modules/admin/action-stats.php b/inc/modules/admin/action-stats.php
new file mode 100644 (file)
index 0000000..76c3ddf
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/16/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-stats.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php
new file mode 100644 (file)
index 0000000..c9eff8b
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ===============                              Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-surfbar.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Main menu for surfbar extension                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptmneue fuer surfbar-Erweiterun               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php
new file mode 100644 (file)
index 0000000..5c61f44
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/03/2004 *
+ * ===============                              Last change: 08/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-task.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Advanced task management                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweitertes Aufgaben-Management                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-theme.php b/inc/modules/admin/action-theme.php
new file mode 100644 (file)
index 0000000..f923105
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/03/2004 *
+ * ===============                              Last change: 12/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-theme.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme Management                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Theme-Management                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-transfer.php b/inc/modules/admin/action-transfer.php
new file mode 100644 (file)
index 0000000..2462908
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/06/2004 *
+ * ===============                              Last change: 10/06/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-transfer.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Point transfers between users                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punktetransfers zwischen Mitgliedern             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-user.php b/inc/modules/admin/action-user.php
new file mode 100644 (file)
index 0000000..1cc7270
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 01/16/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-user.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/action-wernis.php b/inc/modules/admin/action-wernis.php
new file mode 100644 (file)
index 0000000..18e55d0
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/08/2004 *
+ * ===============                              Last change: 05/08/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-wernis.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Wernis management                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Management                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the admin action module
+       include($INC);
+} else {
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php
new file mode 100644 (file)
index 0000000..8e583b6
--- /dev/null
@@ -0,0 +1,1287 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2003 *
+ * ===============                              Last change: 11/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : admin-inc.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Administrative related functions                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Fuer die Administration benoetigte Funktionen    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER)
+{
+       $ret = "failed";
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+        array($user), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Ok, let's create the admin login
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins (login, password, email) VALUES('%s', '%s', '%s')",
+                array($user, $md5, $email), __FILE__, __LINE__);
+               $ret = "done";
+       } else {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Login does already exist
+               $ret = "already";
+       }
+       return $ret;
+}
+// Only be executed on login procedure!
+function CHECK_ADMIN_LOGIN ($admin_login, $password)
+{
+       global $cacheArray, $_CONFIG, $cacheInstance;
+
+       // Init variables
+       $ret = "404";
+       $data = array();
+
+       // Is the cache valid?
+       if (!empty($cacheArray['admins']['password'][$admin_login])) {
+               // Get password from cache
+               $data['password'] = $cacheArray['admins']['password'][$admin_login];
+               $ret = "pass";
+               $_CONFIG['cache_hits']++;
+
+               // Include more admins data?
+               if (GET_EXT_VERSION("admins") >= "0.7.0") {
+                       // Load them here
+                       $data['login_failtures'] = $cacheArray['admins']['login_failtures'][$admin_login];
+                       $data['last_failture']   = $cacheArray['admins']['last_failture'][$admin_login];
+               } // END - if
+       } elseif (EXT_IS_ACTIVE("cache")) {
+               $ADD = "";
+               if (GET_EXT_VERSION("admins") >= "0.7.0") {
+                       // Load them here
+                       $ADD = ", login_failtures, UNIX_TIMESTAMP(last_failture) AS last_failture";
+               } // END - if
+
+               // Get password from DB
+               $result = SQL_QUERY_ESC("SELECT password".$ADD." FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+                array($admin_login), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Login password found
+                       $ret = "pass";
+
+                       // Fetch data
+                       $data = SQL_FETCHARRAY($result);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+
+       //* DEBUG: */ echo "*".$data['password']."/".md5($password)."/".$ret."<br />";
+       if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
+               // Generate new hash
+               $data['password'] = generateHash($password);
+
+               // Is the sql_patches not installed, than we cannot have a valid hashed password here!
+               if (($ret == "pass") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) $ret = "done";
+       } elseif ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == "")) {
+               // Old hashing way
+               return $ret;
+       } elseif (!isset($data['password'])) {
+               // Password not found, so no valid login!
+               return $ret;
+       }
+
+       // Generate salt of password
+       define('__SALT', substr($data['password'], 0, -40));
+       $salt = __SALT;
+
+       // Check if password is same
+       //* DEBUG: */ echo "*".$ret.",".$data['password'].",".$password.",".$salt."*<br >\n";
+       if (($ret == "pass") && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
+               // Re-hash the plain passord with new random salt
+               $data['password'] = generateHash($password);
+
+               // Do we have 0.7.0 of admins or later?
+               // Remmeber login failtures if available
+               if (GET_EXT_VERSION("admins") >= "0.7.0") {
+                       // Store it in session
+                       set_session('mxchange_admin_failtures', $data['login_failtures']);
+                       set_session('mxchange_admin_last_fail', $data['last_failture']);
+
+                       // Update password and reset login failtures
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s',login_failtures=0,last_failture='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
+                               array($data['password'], $admin_login), __FILE__, __LINE__);
+               } else {
+                       // Update password
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s' WHERE login='%s' LIMIT 1",
+                               array($data['password'], $admin_login), __FILE__, __LINE__);
+               }
+
+               // Rebuild cache
+               REBUILD_CACHE("admins", "admin");
+
+               // Login has failed by default... ;-)
+               $ret = "failed";
+
+               // Password matches so login here
+               if (LOGIN_ADMIN($admin_login, $data['password'])) {
+                       // All done now
+                       $ret = "done";
+               } // END - if
+       } elseif ((empty($salt)) && ($ret == "pass")) {
+               // Something bad went wrong
+               $ret = "failed";
+       } elseif ($ret == "done") {
+               // Try to login here if we have the old hashing way (sql_patches not installed?)
+               if (!LOGIN_ADMIN($admin_login, $data['password'])) {
+                       // Something went wrong
+                       $ret = "failed";
+               } // END - if
+       }
+
+       // Count login failture if admins extension version is 0.7.0+
+       if (($ret == "pass") && (GET_EXT_VERSION("admins") >= "0.7.0")) {
+               // Update counter
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET login_failtures=login_failtures+1,last_failture=NOW() WHERE login='%s' LIMIT 1",
+                       array($admin_login), __FILE__, __LINE__);
+
+               // Rebuild cache
+               REBUILD_CACHE("admins", "admin");
+       } // END - if
+
+       // Return the result
+       //* DEBUG: */ die("RETURN=".$ret);
+       return $ret;
+}
+
+// Try to login the admin by setting some session/cookie variables
+function LOGIN_ADMIN ($adminLogin, $passHash) {
+       global $cacheInstance;
+
+       // Reset failture counter on matching admins version
+       if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) {
+               // Reset counter on out-dated sql_patches version
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET login_failtures=0,last_failture='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
+                       array($adminLogin), __FILE__, __LINE__);
+
+               // Rebuild cache
+               REBUILD_CACHE("admins", "admin");
+       } // END - if
+
+       // Now set all session variables and return the result
+       return (
+               (
+                       set_session("admin_md5", generatePassString($passHash))
+               ) && (
+                       set_session("admin_login", $adminLogin)
+               ) && (
+                       set_session("admin_last", time())
+               ) && (
+                       set_session("admin_to", bigintval($_POST['timeout']))
+               )
+       );
+}
+
+// Only be executed on cookie checking
+function CHECK_ADMIN_COOKIES ($admin_login, $password) {
+       global $cacheArray, $_CONFIG;
+       $ret = "404"; $pass = "";
+
+       // Get hash
+       $pass = GET_ADMIN_HASH($admin_login);
+       if ($pass != "-1") $ret = "pass";
+
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
+
+       // Check if password matches
+       if (($ret == "pass") && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
+               // Passwords matches!
+               $ret = "done";
+       }
+
+       // Return result
+       return $ret;
+}
+//
+function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) {
+       // Initialize some variables
+       $done = false;
+       $seek++;
+       $found = false;
+
+       // Is the file there and read-/write-able?
+       if ((FILE_READABLE($file)) && (is_writeable($file))) {
+               $search = "CFG: ".$comment;
+               $tmp = $file.".tmp";
+
+               // Open the source file
+               $fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
+
+               // Is the resource valid?
+               if (is_resource($fp)) {
+                       // Open temporary file
+                       $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<STRONG>WRITE:</STRONG> ".$tmp."<br />");
+
+                       // Is the resource again valid?
+                       if (is_resource($fp_tmp)) {
+                               while (!feof($fp)) {
+                                       // Read from source file
+                                       $line = fgets ($fp, 1024);
+
+                                       if (strpos($line, $search) > -1) { $next = 0; $found = true; }
+
+                                       if ($next > -1) {
+                                               if ($next == $seek) {
+                                                       $next = -1;
+                                                       $line = $prefix . $DATA . $suffix."\n";
+                                               } else {
+                                                       $next++;
+                                               }
+                                       }
+
+                                       // Write to temp file
+                                       fputs($fp_tmp, $line);
+                               }
+
+                               // Close temp file
+                               fclose($fp_tmp);
+
+                               // Finished writing tmp file
+                               $done = true;
+                       }
+
+                       // Close source file
+                       fclose($fp);
+
+                       if (($done) && ($found)) {
+                               // Copy back tmp file and delete tmp :-)
+                               @copy($tmp, $file);
+                               @unlink($tmp);
+                               define('_FATAL', false);
+                       } elseif (!$found) {
+                               OUTPUT_HTML("<STRONG>CHANGE:</STRONG> 404!");
+                               define('_FATAL', true);
+                       } else {
+                               OUTPUT_HTML("<STRONG>TMP:</STRONG> UNDONE!");
+                               define('_FATAL', true);
+                       }
+               }
+       } else {
+               // File not found, not readable or writeable
+               OUTPUT_HTML("<STRONG>404:</STRONG> ".$file."<br />");
+       }
+}
+
+//
+function ADMIN_DO_ACTION($wht) {
+       global $menuDesription, $menuTitle, $_CONFIG, $cacheArray, $DATA, $DEPTH;
+
+       //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
+       if (EXT_IS_ACTIVE("cache")) {
+               // Include cache instance
+               global $cacheInstance;
+       }
+
+       // Remove any spaces from variable
+       if (empty($wht)) {
+               // Default admin action is the overview page
+               $wht = "overview";
+       } else {
+               // Compile out some chars
+               $wht = COMPILE_CODE($wht, false, false, false);
+       }
+
+       // Get action value
+       $act = GET_ACTION($GLOBALS['module'], $wht);
+
+       // Define admin login name and ID number
+       define('__ADMIN_LOGIN', get_session('admin_login'));
+       define('__ADMIN_ID'   , GET_ADMIN_ID(get_session('admin_login')));
+
+       // Preload templates
+       if (EXT_IS_ACTIVE("admins")) {
+               define('__ADMIN_WELCOME', LOAD_TEMPLATE("admin_welcome_admins", true));
+       } else {
+               define('__ADMIN_WELCOME', LOAD_TEMPLATE("admin_welcome", true));
+       }
+       define('__ADMIN_FOOTER' , LOAD_TEMPLATE("admin_footer" , true));
+       define('__ADMIN_MENU'   , ADD_ADMIN_MENU($act, $wht, true));
+
+       // Tableset header
+       LOAD_TEMPLATE("admin_main_header");
+
+       // Check if action/what pair is valid
+       $result_action = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu
+WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR what IS NULL) AND '%s'='overview'))
+LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_action) == 1) {
+
+               // Is valid but does the inlcude file exists?
+               $INC = sprintf("%sinc/modules/admin/action-%s.php", PATH, $act);
+               if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) {
+                       // Ok, we finally load the admin action module
+                       include($INC);
+               } elseif (__ACL_ALLOW == false) {
+                       // Access denied
+                       LOAD_TEMPLATE("admin_menu_failed", false, ADMINS_ACCESS_DENIED);
+                       ADD_FATAL(ADMINS_ACCESS_DENIED);
+               } else {
+                       // Include file not found! :-(
+                       LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_404_ACTION);
+                       ADD_FATAL(ADMIN_404_ACTION_1.$act.ADMIN_404_ACTION_2);
+               }
+       } else {
+               // Invalid action/what pair found!
+               LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_INVALID_ACTION);
+               ADD_FATAL(ADMIN_INVALID_ACTION_1.$act."/".$wht.ADMIN_INVALID_ACTION_2);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_action);
+
+       // Tableset footer
+       LOAD_TEMPLATE("admin_main_footer");
+}
+//
+function ADD_ADMIN_MENU($act, $wht, $return=false) {
+       global $menuDesription, $menuTitle, $cacheInstance, $_CONFIG;
+
+       // Init variables
+       $SUB = false;
+       $OUT = "";
+
+       // Menu descriptions
+       $menuDesription = array();
+       $menuTitle = array();
+
+       // Is there a cache instance?
+       if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+               // Create cache name
+               $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
+
+               // Is that cache there?
+               if ($cacheInstance->cache_file($cacheName, true)) {
+                       // Then load it
+                       $data = $cacheInstance->cache_load();
+
+                       // Extract all parts
+                       $OUT = base64_decode($data['output'][0]);
+                       $menuTitle = unserialize(base64_decode($data['title'][0]));
+                       $menuDescription = unserialize(base64_decode($data['descr'][0]));
+
+                       // Return or output content?
+                       if ($return) {
+                               return $OUT;
+                       } else {
+                               OUTPUT_HTML($OUT);
+                       }
+               } // END - if
+       } // END - if
+
+       // Build main menu
+       $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort, id DESC", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) > 0)
+       {
+               $OUT = "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_main\">
+<TR><TD colspan=\"2\" height=\"7\" class=\"seperator\">&nbsp;</TD></TR>\n";
+               while (list($menu, $title, $descr) = SQL_FETCHROW($result_main))
+               {
+                       if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2"))
+                       {
+                               $ACL = ADMINS_CHECK_ACL($menu, "");
+                       }
+                        else
+                       {
+                               // ACL is "allow"... hmmm
+                               $ACL = true;
+                       }
+                       if ($ACL)
+                       {
+                               if (!$SUB)
+                               {
+                                       // Insert compiled menu title and description
+                                       $menuTitle[$menu]      = $title;
+                                       $menuDesription[$menu] = $descr;
+                               }
+                               $OUT .= "<TR>
+       <TD class=\"admin_menu\" colspan=\"2\">
+               <NOBR>&nbsp;<STRONG>&middot;</STRONG>&nbsp;";
+                               if (($menu == $act) && (empty($wht)))
+                               {
+                                       $OUT .= "<STRONG>";
+                               }
+                                else
+                               {
+                                       $OUT .= "[<A href=\"".URL."/modules.php?module=admin&amp;action=".$menu."\">";
+                               }
+                               $OUT .= $title;
+                               if (($menu == $act) && (empty($wht)))
+                               {
+                                       $OUT .= "</STRONG>";
+                               }
+                                else
+                               {
+                                       $OUT .= "</A>]";
+                               }
+                               $OUT .= "</NOBR></TD>
+</TR>\n";
+                               $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort, id DESC",
+                                array($menu), __FILE__, __LINE__);
+                               if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu))
+                               {
+                                       $menuDesription = array();
+                                       $menuTitle = array(); $SUB = true;
+                                       $OUT .= "<TR>
+       <TD width=\"10\" class=\"seperator\">&nbsp;</TD>
+       <TD class=\"admin_menu\">
+               <TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_sub\">\n";
+                                       while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
+                                               // Filename
+                                               $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $wht_sub);
+                                               if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+                                                       $ACL = ADMINS_CHECK_ACL("", $wht_sub);
+                                               } else {
+                                                       // ACL is "allow"... hmmm
+                                                       $ACL = true;
+                                               }
+                                               $readable = FILE_READABLE($INC);
+                                               if ($ACL) {
+                                                       // Insert compiled title and description
+                                                       $menuTitle[$wht_sub]      = $title_what;
+                                                       $menuDesription[$wht_sub] = $desc_what;
+                                                       $OUT .= "<TR>
+       <TD class=\"admin_menu\" colspan=\"2\">
+               <NOBR>&nbsp;<STRONG>--&gt;</STRONG>&nbsp;";
+                                                       if ($readable)
+                                                       {
+                                                               if ($wht == $wht_sub)
+                                                               {
+                                                                       $OUT .= "<STRONG>";
+                                                               }
+                                                                else
+                                                               {
+                                                                       $OUT .= "[<A href=\"".URL."/modules.php?module=admin&amp;what=".$wht_sub."\">";
+                                                               }
+                                                       }
+                                                        else
+                                                       {
+                                                               $OUT .= "<I class=\"admin_note\">";
+                                                       }
+                                                       $OUT .= $title_what;
+                                                       if ($readable)
+                                                       {
+                                                               if ($wht == $wht_sub)
+                                                               {
+                                                                       $OUT .= "</STRONG>";
+                                                               }
+                                                                else
+                                                               {
+                                                                       $OUT .= "</A>]";
+                                                               }
+                                                       }
+                                                        else
+                                                       {
+                                                               $OUT .= "</I>";
+                                                       }
+                                                       $OUT .= "</NOBR></TD>
+</TR>\n";
+                                               }
+                                       }
+
+                                       // Free memory
+                                       SQL_FREERESULT($result_what);
+                                       $OUT .= "    </TABLE>
+       </TD>
+</TR>\n";
+                               }
+                               $OUT .= "<TR><TD height=\"7\" colspan=\"2\"></TD></TR>\n";
+                       }
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_main);
+               $OUT .= "</TABLE>\n";
+       }
+
+       // Compile and run the code here. This inserts all constants into the
+       // HTML output. Costs me some time to figure this out... *sigh* Quix0r
+       $eval = "\$OUT = \"".COMPILE_CODE(addslashes($OUT))."\";";
+       eval($eval);
+
+       // Is there a cache instance again?
+       if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
+               // Init cache
+               $cacheInstance->cache_init($cacheName);
+
+               // Prepare cache data
+               $data = array(
+                       'output' => base64_encode($OUT),
+                       'title'  => $menuTitle,
+                       'descr'  => $menuDesription
+               );
+
+               // Write the data away
+               $cacheInstance->add_row($data);
+
+               // Close cache
+               $cacheInstance->cache_close();
+       } // END - if
+
+       // Return or output content?
+       if ($return) {
+               return $OUT;
+       } else {
+               OUTPUT_HTML($OUT);
+       }
+}
+//
+function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false, $field="userid")
+{
+       // Output selection form with all confirmed user accounts listed
+       $result = SQL_QUERY("SELECT userid, surname, family FROM "._MYSQL_PREFIX."_user_data ORDER BY userid", __FILE__, __LINE__);
+       $OUT = "";
+
+       // USe this only for adding points (e.g. adding refs really makes no sence ;-) )
+       if ($add_all) $OUT = "      <OPTION value=\"all\">".ALL_MEMBERS."</OPTION>\n";
+        elseif ($none) $OUT = "      <OPTION value=\"0\">".SELECT_NONE."</OPTION>\n";
+       while (list($id, $sname, $fname) = SQL_FETCHROW($result))
+       {
+               $OUT .= "      <OPTION value=\"".bigintval($id)."\"";
+               if ($def == $id) $OUT .= " selected=\"selected\"";
+               $OUT .= ">".$sname." ".$fname." (".bigintval($id).")</OPTION>\n";
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       if (!$return) {
+               // Remeber options in constant
+               define('_MEMBER_SELECTION', $OUT);
+
+               // Display selection box
+               define('__LANG_VALUE', GET_LANGUAGE());
+
+               // Load template
+               LOAD_TEMPLATE("admin_member_selection_box", false, $GLOBALS['what']);
+       } else {
+               // Return content in selection frame
+               return "<select class=\"admin_select\" name=\"".$field."\" size=\"1\">\n".$OUT."</select>\n";
+       }
+}
+//
+function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") {
+       $wht = "what != ''";
+       if ($MODE == "action") $wht = "(what='' OR what IS NULL) AND action !='login'";
+       $result = SQL_QUERY_ESC("SELECT %s, title FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$wht." ORDER BY sort",
+        array($MODE), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0) {
+               // Load menu as selection
+               $OUT = "<SELECT name=\"".$MODE."_menu";
+               if ((!empty($defid)) || ($defid == "0")) $OUT .= "[".$defid."]";
+               $OUT .= "\" size=\"1\" class=\"admin_select\">
+       <OPTION value=\"\">".SELECT_NONE."</OPTION>\n";
+               while (list($menu, $title) = SQL_FETCHROW($result)) {
+                       $OUT .= "  <OPTION value=\"".$menu."\"";
+                       if ((!empty($default)) && ($default == $menu)) $OUT .= " selected=\"selected\"";
+                       $OUT .= ">".$title."</OPTION>\n";
+               } // END - while
+
+               // Free memory
+               SQL_FREERESULT($result);
+               $OUT .= "</SELECT>\n";
+       } else {
+               // No menus???
+               $OUT = ADMIN_PROBLEM_NO_MENU;
+       }
+
+       // Return output
+       return $OUT;
+}
+// Save settings to the database
+function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="config=0", $translateComma=array(), $alwaysAdd=false) {
+       global $_CONFIG, $cacheArray, $cacheInstance;
+
+       // Prepare all arrays, variables
+       $DATA = array();
+       $skip = false;
+
+       // Now, walk through all entries and prepare them for saving
+       foreach ($POST as $id => $val) {
+               // Process only formular field but not submit buttons ;)
+               if ($id != "ok") {
+                       // Do not save the ok value
+                       CONVERT_SELECTIONS_TO_TIMESTAMP($POST, $DATA, $id, $skip);
+
+                       // Shall we process this ID? It muss not be empty, of course
+                       if ((!$skip) && (!empty($id))) {
+                               // Save this entry
+                               $val = COMPILE_CODE($val);
+
+                               // Translate the value? (comma to dot!)
+                               if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
+                                       // Then do it here... :)
+                                       $val = str_replace(",", ".", $val);
+                               } // END - if
+
+                               // Shall we add numbers or strings?
+                               $test = (float)$val;
+                               if ("".$val."" == "".$test."") {
+                                       // Add numbers
+                                       $DATA[] = $id."=".$val."";
+                               } else {
+                                       // Add strings
+                                       $DATA[] = $id."='".trim($val)."'";
+                               }
+
+                               // Update current configuration
+                               $_CONFIG[$id] = $val;
+                       } // END - if
+               } // END - if
+       } // END - foreach
+
+       // Check if entry does exist
+       $result = false;
+       if (!$alwaysAdd) {
+               if (!empty($whereStatement)) {
+                       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__);
+               } else {
+                       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." LIMIT 1", __FILE__, __LINE__);
+               }
+       } // END - if
+
+       if (SQL_NUMROWS($result) == 1) {
+               // "Implode" all data to single string
+               $DATA_UPDATE = implode(", ", $DATA);
+
+               // Generate SQL string
+               $SQL = "UPDATE "._MYSQL_PREFIX.$tableName." SET ".$DATA_UPDATE." WHERE ".$whereStatement." LIMIT 1";
+       } else {
+               // Add Line (does only work with auto_increment!
+               $KEYs = array(); $VALUEs = array();
+               foreach ($DATA as $entry) {
+                       // Split up
+                       $line = explode("=", $entry);
+                       $KEYs[] = $line[0]; $VALUEs[] = $line[1];
+               } // END - foreach
+
+               // Add both in one line
+               $KEYs = implode(", ", $KEYs);
+               $VALUEs = implode(", ", $VALUEs);
+
+               // Generate SQL string
+               $SQL = "INSERT INTO "._MYSQL_PREFIX.$tableName." (".$KEYs.") VALUES(".$VALUEs.")";
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Simply run generated SQL string
+       $result = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+       // Rebuild cache
+       REBUILD_CACHE("config", "config");
+
+       // Settings saved
+       LOAD_TEMPLATE("admin_settings_saved", false, "<STRONG class=\"admin_done\">".SETTINGS_SAVED."</STRONG>");
+}
+//
+function ADMIN_MAKE_MENU_SELECTION($menu, $type, $name, $default="") {
+       // Open the requested menu directory
+       $handle = opendir(sprintf("%sinc/modules/%s/", PATH, $menu)) or mxchange_die("Cannot load menu ".$menu."!");
+
+       // Init the selection box
+       $OUT = "<SELECT name=\"".$name."\" class=\"admin_select\" size=\"1\">\n <OPTION value=\"\">".IS_TOP_MENU."</OPTION>\n";
+
+       // Walk through all files
+       while ($file = readdir($handle)) {
+               // Is this a PHP script?
+               if (($file != ".") && ($file != "..") && ($file != "lost+found") && (strpos($file, "".$type."-") > -1) && (strpos($file, ".php") > 0)) {
+                       // Then test if the file is readable
+                       $test = sprintf("%sinc/modules/%s/%s", PATH, $menu, $file);
+                       if ((is_file($test)) && (is_readable($test))) {
+                               // Extract the value for what=xxx
+                               $part = substr($file, (strlen($type) + 1));
+                               $part = substr($part, 0, -4);
+
+                               // Is that part different from the overview?
+                               if ($part != "overview") {
+                                       $OUT .= "       <OPTION value=\"".$part."\"";
+                                       if ($part == $default) $OUT .= "selected";
+                                       $OUT .= ">".$part."</OPTION>\n";
+                               } // END - if
+                       } // END - if
+               } // END - if
+       } // END - while
+
+       // Close dir and selection box
+       closedir($handle);
+       $OUT .= "</SELECT>\n";
+       return $OUT;
+}
+//
+function ADMIN_USER_PROFILE_LINK($uid, $title="", $wht="list_user") {
+       if (($title == "") && ($title != "0")) {
+               // Set userid as title
+               $title = $uid;
+       } // END - if
+
+       if (($title == "0") && ($wht == "list_refs")) {
+               // Return title again
+               return $title;
+       } // END - if
+
+       //* DEBUG: */ echo "A:".$title."<br />";
+       // Return link
+       return "<A href=\"".URL."/modules.php?module=admin&amp;what=".$wht."&amp;u_id=".$uid."\" title=\"".ADMIN_USER_PROFILE_TITLE."\">".$title."</A>";
+}
+//
+function ADMIN_CHECK_MENU_MODE() {
+       global $_CONFIG, $cacheArray;
+
+       // Set the global mode as the mode for all admins
+       $MODE = $_CONFIG['admin_menu']; $ADMIN = $MODE;
+
+       // Check individual settings of current admin
+       if (isset($cacheArray['admins']['la_mode'][get_session('admin_login')])) {
+               // Load from cache
+               $ADMIN = $cacheArray['admins']['la_mode'][get_session('admin_login')];
+               $_CONFIG['cache_hits']++;
+       } elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
+               // Load from database when version of "admins" is enough
+               $result = SQL_QUERY_ESC("SELECT la_mode FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+                array(get_session('admin_login')), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load data
+                       list($ADMIN) = SQL_FETCHROW($result);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+
+       // Check what the admin wants and set it when it's not the global mode
+       if ($ADMIN != "global") $MODE = $ADMIN;
+
+       // Return admin-menu's mode
+       return $MODE;
+}
+// Change activation status
+function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
+       global $_CONFIG;
+       $cnt = 0; $newStatus = "Y";
+       if ((is_array($IDs)) && (count($IDs) > 0)) {
+               // "Walk" all through and count them
+               foreach ($IDs as $id => $selected) {
+                       // Secure the ID number
+                       $id = bigintval($id);
+
+                       // Should always be 1 ;-)
+                       if ($selected == 1) {
+                               // Determine new status
+                               $result = SQL_QUERY_ESC("SELECT %s FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
+                                       array($row, $table, $idRow, $id), __FILE__, __LINE__);
+
+                               // Row found?
+                               if (SQL_NUMROWS($result) == 1) {
+                                       // Load the status
+                                       list($currStatus) = SQL_FETCHROW($result);
+                                       if ($currStatus == "Y") $newStatus='N'; else $newStatus = "Y";
+
+                                       // Change this status
+                                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s SET %s='%s' WHERE %s=%s LIMIT 1",
+                                               array($table, $row, $newStatus, $idRow, $id), __FILE__, __LINE__);
+
+                                       // Count up affected rows
+                                       $cnt += SQL_AFFECTEDROWS();
+                               }
+
+                               // Free the result
+                               SQL_FREERESULT($result);
+                       }
+               }
+
+               // Output status
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_STATUS_CHANGED_1.$cnt.ADMIN_STATUS_CHANGED_2.count($IDs).ADMIN_STATUS_CHANGED_3);
+       } else {
+               // Nothing selected!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NOTHING_SELECTED_CHANGE);
+       }
+}
+// Send mails for del/edit/lock build modes
+function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") {
+       // Default subject is the subject part
+       $subject = $subjectPart;
+
+       // Is the subject part not set?
+       if (empty($subjectPart)) {
+               // Then use it from the mode
+               $subject = strtoupper($mode);
+       } // END - if
+
+       // Is the raw userid set?
+       if ($_POST['uid_raw'][$id] > 0) {
+               // Generate subject
+               $eval = "\$subjectLine = MEMBER_".$subject."_".strtoupper($table)."_SUBJECT;";
+               eval($eval);
+
+               // Load email template
+               if (!empty($subjectPart)) {
+                       $mail = LOAD_EMAIL_TEMPLATE("member_".$mode."_".strtolower($subjectPart)."_".$table, $content);
+               } else {
+                       $mail = LOAD_EMAIL_TEMPLATE("member_".$mode."_".$table, $content);
+               }
+
+               // Send email out
+               SEND_EMAIL($_POST['uid_raw'][$id], $subjectLine, $mail);
+       } // END - if
+
+       // Generate subject
+       $eval = "\$subjectLine = ADMIN_".$subject."_".strtoupper($table)."_SUBJECT;";
+       eval($eval);
+
+       // Send admin notification out
+       if (!empty($subjectPart)) {
+               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".strtolower($subjectPart)."_".$table, $content, $_POST['uid_raw'][$id]);
+       } else {
+               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".$table, $content, $_POST['uid_raw'][$id]);
+       }
+}
+// Build a special template list
+function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn) {
+       global $_CONFIG;
+       $OUT = ""; $SW = 2;
+
+       // "Walk" through all entries
+       foreach ($IDs as $id => $selected) {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // Get result from a given column array and table name
+               $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FILE__, __LINE__);
+
+               // Is there one entry?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load all data
+                       $content = SQL_FETCHARRAY($result);
+
+                       // Filter all data
+                       foreach ($content as $key => $value) {
+                               // Search index
+                               $idx = array_search($key, $columns, true);
+
+                               // Do we have a userid?
+                               if ($key == "userid") {
+                                       // Add it again as raw id
+                                       $content['uid'] = bigintval($value);
+                               } // END - if
+
+                               // Handle the call in external function
+                               $content[$key] = HANDLE_EXTRA_VALUES($filterFunctions[$idx], $value, $extraValues[$idx]);
+                       } // END - foreach
+
+                       // Add color switching
+                       $content['sw'] = $SW;
+
+                       // Then list it
+                       $OUT .= LOAD_TEMPLATE("admin_".$listType."_".$table."_row", true, $content);
+
+                       // Switch color
+                       $SW = 3 - $SW;
+               } // END - if
+
+               // Free the result
+               SQL_FREERESULT($result);
+       } // END - foreach
+
+       // Load master template
+       LOAD_TEMPLATE("admin_".$listType."_".$table."", false, $OUT);
+}
+// Change status of "build" list
+function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray) {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && (count($statusArray) > 0)) {
+               // "Walk" through all entries
+               foreach ($IDs as $id => $sel) {
+                       // Construct SQL query
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET";
+
+                       // Load data of entry
+                       $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
+                               array($table, $idColumn, $id), __FILE__, __LINE__);
+
+                       // Fetch the data
+                       $content = SQL_FETCHARRAY($result);
+
+                       // Free the result
+                       SQL_FREERESULT($result);
+
+                       // Add all status entries (e.g. status column last_updated or so)
+                       $newStatus = "UNKNOWN";
+                       $oldStatus = "UNKNOWN";
+                       $statusColumn = "unknown";
+                       foreach ($statusArray as $column => $statusInfo) {
+                               // Does the entry exist?
+                               if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) {
+                                       // Add these entries for update
+                                       $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]]));
+
+                                       // Remember status
+                                       if ($statusColumn == "unknown") {
+                                               // Always (!!!) change status column first!
+                                               $oldStatus = $content[$column];
+                                               $newStatus = $statusInfo[$oldStatus];
+                                               $statusColumn = $column;
+                                       } // END - if
+                               } elseif (isset($content[$column])) {
+                                       // Unfinished!
+                                       mxchange_die("{--".__FUNCTION__."--}:UNFINISHED: id={$id}/{$column}[".gettype($statusInfo)."] = {$content[$column]}");
+                               }
+                       } // END - foreach
+
+                       // Add other columns as well
+                       foreach ($_POST as $key => $entries) {
+                               // Skip id, raw userid and 'do_lock'
+                               if (!in_array($key, array($idColumn, 'uid_raw', 'do_lock'))) {
+                                       // Are there brackets () at the end?
+                                       if (substr($entries[$id], -2, 2) == "()") {
+                                               // Direct SQL command found
+                                               $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                       } else {
+                                               // Add regular entry
+                                               $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                       }
+                               } // END - if
+                       } // END - if
+
+                       // Finish SQL statement
+                       $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." AND ".$statusColumn."='".$oldStatus."' LIMIT 1";
+
+                       // Run the SQL
+                       SQL_QUERY($SQL, __FILE__, __LINE__);
+
+                       // Do we have an URL?
+                       if (isset($content['url'])) {
+                               // Then add a framekiller test as well
+                               $content['frametester'] = FRAMETESTER($content['url']);
+                       } // END - if
+
+                       // Send "build mails" out
+                       ADMIN_SEND_BUILD_MAILS($mode, $table, $content, $id, $statusInfo[$content[$column]]);
+               } // END - foreach
+       } // END - if
+}
+// Delete rows by given ID numbers
+function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $deleteNow=false, $idColumn="id", $userIdColumn="userid") {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+               // Shall we delete here or list for deletion?
+               if ($deleteNow) {
+                       // The base SQL command:
+                       $SQL = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_%s WHERE %s IN (%s)";
+
+                       // Delete them all
+                       $idList = "";
+                       foreach ($IDs as $id => $sel) {
+                               // Is there a userid?
+                               if (isset($_POST['uid_raw'][$id])) {
+                                       // Load all data from that id
+                                       $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
+                                               array($table, $idColumn, $id), __FILE__, __LINE__);
+
+                                       // Fetch the data
+                                       $content = SQL_FETCHARRAY($result);
+
+                                       // Free the result
+                                       SQL_FREERESULT($result);
+
+                                       // Send "build mails" out
+                                       ADMIN_SEND_BUILD_MAILS("del", $table, $content, $id);
+                               } // END - if
+
+                               // Add id number
+                               $idList .= $id.",";
+                       } // END - foreach
+
+                       // Run the query
+                       SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FILE__, __LINE__);
+
+                       // Was this fine?
+                       if (SQL_AFFECTEDROWS() == count($IDs)) {
+                               // All deleted
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_ENTRIES_REMOVED);
+                       } else {
+                               // Some are still there :(
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_DELETED, SQL_AFFECTEDROWS(), count($IDs)));
+                       }
+               } else {
+                       // List for deletion confirmation
+                       ADMIN_BUILD_LIST("del", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               }
+       } // END - if
+}
+// Edit rows by given ID numbers
+function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $editNow=false, $idColumn="id", $userIdColumn="userid") {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+               // Shall we change here or list for editing?
+               if ($editNow) {
+                       // Change them all
+                       $affected = 0;
+                       foreach ($IDs as $id => $sel) {
+                               // Prepare content array (new values)
+                               $content = array();
+
+                               // Prepare SQL for this row
+                               $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET";
+                               foreach ($_POST as $key => $entries) {
+                                       // Skip raw userid which is always invalid
+                                       if ($key == "uid_raw") {
+                                               // Continue with next field
+                                               continue;
+                                       } // END - if
+
+                                       // Is entries an array?
+                                       if (($key != $idColumn) && (is_array($entries)) && (isset($entries[$id]))) {
+                                               // Add this entry to content
+                                               $content[$key] = $entries[$id];
+
+                                               // Send data through the filter function if found
+                                               if ((isset($filterFunctions[$key])) && (isset($extraValues[$key]))) {
+                                                       // Filter function set!
+                                                       $entries[$id] = HANDLE_EXTRA_VALUES($filterFunctions[$key], $entries[$id], $extraValues[$key]);
+                                               } // END - if
+
+                                               // Then add this value
+                                               $SQL .= sprintf(" %s='%s',",
+                                                       SQL_ESCAPE($key),
+                                                       SQL_ESCAPE($entries[$id])
+                                               );
+                                       } elseif (($key != $idColumn) && (!is_array($entries))) {
+                                               // Add normal entries as well!
+                                               $content[$key] =  $entries;
+                                       }
+
+                                       // Do we have an URL?
+                                       if ($key == "url") {
+                                               // Then add a framekiller test as well
+                                               $content['frametester'] = FRAMETESTER($content[$key]);
+                                       } // END - if
+                               } // END - foreach
+
+                               // Finish SQL command
+                               $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
+
+                               // Run this query
+                               SQL_QUERY($SQL, __FILE__, __LINE__);
+
+                               // Add affected rows
+                               $affected += SQL_AFFECTEDROWS();
+
+                               // Load all data from that id
+                               $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
+                                       array($table, $idColumn, $id), __FILE__, __LINE__);
+
+                               // Fetch the data
+                               global $DATA;
+                               $DATA = SQL_FETCHARRAY($result);
+
+                               // Free the result
+                               SQL_FREERESULT($result);
+
+                               // Send "build mails" out
+                               ADMIN_SEND_BUILD_MAILS("edit", $table, $content, $id);
+                       } // END - foreach
+
+                       // Was this fine?
+                       if ($affected == count($IDs)) {
+                               // All deleted
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_ENTRIES_EDITED);
+                       } else {
+                               // Some are still there :(
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_EDITED, $affected, count($IDs)));
+                       }
+               } else {
+                       // List for editing
+                       ADMIN_BUILD_LIST("edit", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               }
+       } // END - if
+}
+// Un-/lock rows by given ID numbers
+function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) {
+               // Shall we un-/lock here or list for locking?
+               if ($lockNow) {
+                       // Un-/lock entries
+                       ADMIN_BUILD_STATUS_HANDLER("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               } else {
+                       // List for editing
+                       ADMIN_BUILD_LIST("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               }
+       } // END - if
+}
+// Undelete rows by given ID numbers
+function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) {
+               // Shall we un-/lock here or list for locking?
+               if ($lockNow) {
+                       // Undelete entries
+                       ADMIN_BUILD_STATUS_HANDLER("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray);
+               } else {
+                       // List for editing
+                       ADMIN_BUILD_LIST("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               }
+       } // END - if
+}
+// Checks proxy settins by fetching check-updates3.php from www.mxchange.org
+function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
+       global $_CONFIG;
+
+       // Set temporary the new settings
+       $_CONFIG = array_merge($_CONFIG, $settingsArray);
+
+       // Now get the test URL
+       $content = GET_URL("check-updates3.php");
+
+       // Is the first line with "200 OK"?
+       $valid = eregi("200 OK", $content[0]);
+
+       // Return result
+       return $valid;
+}
+// Sends out a link to the given email adress so the admin can reset his/her password
+function ADMIN_SEND_PASSWORD_RESET_LINK ($email) {
+       global $_CONFIG;
+       // Init output
+       $OUT = "";
+
+       // Compile out security characters (must be for looking up!)
+       $email = COMPILE_CODE($email);
+
+       // Look up administator login
+       $result = SQL_QUERY_ESC("SELECT id, login, password FROM "._MYSQL_PREFIX."_admins WHERE email='%s' LIMIT 1",
+               array($email), __FILE__, __LINE__);
+
+       // Is there an account?
+       if (SQL_NUMROWS($result) == 0) {
+               // No account found!
+               return ADMIN_NO_LOGIN_WITH_EMAIL;
+       } // END - if
+
+       // Load all data
+       $content = SQL_FETCHARRAY($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Generate hash for reset link
+       $content['hash'] = generateHash(URL.":".$content['id'].":".$content['login'].":".$content['password'], substr($content['password'], 10));
+
+       // Remove some data
+       unset($content['id']);
+       unset($content['password']);
+
+       // Prepare email
+       $mailText = LOAD_EMAIL_TEMPLATE("admin_reset_password", $content);
+
+       // Send it out
+       SEND_EMAIL($email, ADMIN_RESET_PASS_LINK_SUBJ, $mailText);
+
+       // Prepare output
+       return ADMIN_RESET_LINK_SENT;
+}
+// Validate hash and login for password reset
+function ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN ($hash, $login) {
+       // By default nothing validates... ;)
+       $valid = false;
+
+       // Compile the login for lookup
+       $login = COMPILE_CODE($login);
+
+       // Then try to find that user
+       $result = SQL_QUERY_ESC("SELECT id, password, email FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+               array($login), __FILE__, __LINE__);
+
+       // Is an account here?
+       if (SQL_NUMROWS($result) == 1) {
+               // Load all data
+               $content = SQL_FETCHARRAY($result);
+
+               // Generate hash again
+               $hashFromData = generateHash(URL.":".$content['id'].":".$login.":".$content['password'], substr($content['password'], 10));
+
+               // Does both match?
+               $valid = ($hash == $hashFromData);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $valid;
+}
+// Reset the password for the login. Do NOT call this function without calling above function first!
+function ADMIN_RESET_PASSWORD ($login, $password) {
+       // Init hash
+       $passHash = "";
+
+       // Now check if we have sql_patches installed
+       if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
+               // Use new way of hashing
+               $passHash = generateHash($password);
+       } else {
+               // Old MD5 method
+               $passHash = md5($password);
+       }
+
+       // Update database
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s' WHERE login='%s' LIMIT 1",
+               array($passHash, $login), __FILE__, __LINE__);
+
+       // Return output
+       return ADMIN_PASSWORD_RESET_DONE;
+}
+// Solves a task by given id number
+function ADMIN_SOLVE_TASK ($id) {
+       // Update the task data
+       ADMIN_UPDATE_TASK_DATA($id, "status", "SOLVED");
+}
+// Marks a given task as deleted
+function ADMIN_DELETE_TASK ($id) {
+       // Update the task data
+       ADMIN_UPDATE_TASK_DATA($id, "status", "DELETED");
+}
+// Function to update task data
+function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
+       // Update the task
+       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET %s='%s' WHERE id=%s LIMIT 1",
+               array($row, $data, bigintval($id)), __FILE__, __LINE__);
+}
+//
+?>
diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php
new file mode 100644 (file)
index 0000000..23501fe
--- /dev/null
@@ -0,0 +1,455 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/13/2004 *
+ * ===============                              Last change: 08/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : overview-inc.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Output standard task management                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Standart-Aufgaben-Management ausgeben            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
+       global $cacheArray, $_CONFIG;
+
+       // First check for solved and not assigned tasks and assign them to current admin
+       $result_task = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'",
+        array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+
+       // We currently don't want to install an extension so let's find out if we need...
+       $EXT_LOAD_MODE = "register";
+       $JOBS_DONE = true;
+
+       // Open the extension directory
+       $handle = opendir(PATH."inc/extensions/") or mxchange_die("Cannot read extension directory!");
+       while ($file = readdir($handle)) {
+               // Is this file an extension?
+               if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
+                       //* DEBUG: */ echo $file."<br />\n";
+                       // Possible newly installed extension found so we extract extension's name
+                       $ext = strtolower(substr($file, 4, -4)); // Keep always extension names on lower case!!!
+
+                       // Init variables
+                       $ext_ver = "";
+                       $result = false;
+
+                       // Check if extension is installed or not
+                       if ((is_array($cacheArray['extensions']['ext_version'])) && (isset($cacheArray['extensions']['ext_version'][$ext]))) {
+                               // Load version from cache
+                               if (!empty($cacheArray['extensions']['ext_version'][$ext])) {
+                                       // Extension is installed so we can get it's version number
+                                       $ext_ver = $cacheArray['extensions']['ext_version'][$ext];
+                               } else {
+                                       // Extension is not installed so no version number was found
+                                       $ext_ver = "";
+                               }
+                       } elseif (!EXT_IS_ACTIVE("cache")) {
+                               // Load data from database
+                               $result = SQL_QUERY_ESC("SELECT id, ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                                array($ext), __FILE__, __LINE__);
+                       }
+
+                       // Is the extension not yet installed?
+                       if ((SQL_NUMROWS($result) == 0) && (empty($ext_ver))) {
+                               // Generate subject line
+                               $ext_subj = sprintf("[%s:]", $ext);
+
+                               // Create a task for newly installed extension
+                               CREATE_NEW_EXTENSION_TASK(GET_ADMIN_ID(get_session('admin_login')), $ext_subj, $ext);
+
+                               // We maybe want to install an extension so let's test-drive it...
+                               include(PATH."inc/extensions/".$file);
+                       } else {
+                               // Maybe we want to update?
+                               if ((empty($cacheArray['extensions']['ext_version'][$ext])) && (SQL_NUMROWS($result) == 1)) {
+                                       list($dummy, $ext_ver) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+                               } // END - if
+
+                               // Update extension
+                               if (!empty($ext_ver)) EXTENSION_UPDATE($file, $ext, $ext_ver);
+
+                               if (!empty($cacheArray['active_extensions'][$ext])) {
+                                       // Maybe we want to keept the current extension active?
+                                       if (($cacheArray['active_extensions'][$ext] == "Y") && (!EXT_IS_ACTIVE($ext))) {
+                                               // Reactivate this extension!
+                                               ACTIVATE_EXTENSION($ext);
+                                       } // END - if
+                               } // END - if
+                       }
+               } // END - if
+       } // END - while
+
+       // Close directory handle
+       closedir($handle);
+
+       // At last - but not least - check for own and new unassigned tasks...
+       $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
+FROM "._MYSQL_PREFIX."_task_system
+WHERE assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')
+ORDER BY userid DESC, task_type DESC, subject, task_created DESC",
+        array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result_tasks) > 0) {
+               // New jobs found!
+               $JOBS_DONE = false;
+       } // END - if
+
+       // Free the result
+       SQL_FREERESULT($result);
+
+       // Return status
+       return $JOBS_DONE;
+}
+
+//
+function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
+       global $_CONFIG, $NOTES;
+       if ((isset($_POST['assign'])) && (count($_POST['task']) > 0)) {
+               // Assign / do tasks
+               $OUT = ""; $SW = 2;
+               foreach ($_POST['task'] as $id => $sel) {
+                       $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM "._MYSQL_PREFIX."_task_system WHERE id=%s AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1",
+                        array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result_task) == 1) {
+                               // Task is valid...
+                               list($tid, $uid, $type, $subj, $text, $created, $status, $aid) = SQL_FETCHROW($result_task);
+                               SQL_FREERESULT($result_task);
+
+                               if ($aid == "0") {
+                                       // Assgin current admin to unassgigned task
+                                       $result_assign = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE id=%s LIMIT 1",
+                                        array(GET_ADMIN_ID(get_session('admin_login')), bigintval($tid)), __FILE__, __LINE__);
+                               } // END - if
+
+                               $ADD = "";
+                               if ($type == "SUPPORT_MEMBER") {
+                                       $mode = substr($text, 0, strpos($text, ":"));
+                                       $text = substr($text, strpos($text, ":") + 1);
+                                       $ADD = "<LI>".ADMIN_TASK_SUPPORT_MODE.": <STRONG>".$mode."</STRONG></LI>";
+                               } // END - if
+
+                               if ($uid > 0) {
+                                       $result_user = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                        array(bigintval($uid)), __FILE__, __LINE__);
+                                       if (SQL_NUMROWS($result_user) == 1) {
+                                               list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
+                                               SQL_FREERESULT($result_user);
+                                               $ADD = "<LI>".ADMIN_MEMBER_UID.": <STRONG>".ADMIN_USER_PROFILE_LINK($uid)." (<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</A>)</STRONG></LI>";
+                                       } // END - if
+                               } // END - if
+
+                               // Decode entities of the text
+                               $text = html_entity_decode($text);
+
+                               // Compile and insert text from task into table template
+                               $text = LOAD_TEMPLATE("admin_extensions_text", true, $text);
+
+                               // Initialize variables (no title for SQL commands by default)
+                               $ext_name = "";
+                               $title = TASK_NO_TITLE;
+
+                               // Shall I list SQL commands assigned to an extension installation or update task?
+                               if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+                                       $ext_name = substr($subj, 1, strpos($subj, ":") - 1);
+                                       if ($type == "EXTENSION") {
+                                               // Load SQL commands for registering
+                                               $SQLs = EXTENSION_REGISTER($ext_name, $id, true);
+
+                                               // Add notes to text
+                                               $text .= $NOTES;
+
+                                               // Set title
+                                               $title = ADMIN_SQLS_EXECUTED_ON_REGISTER;
+                                       } elseif ($type == "EXTENSION_UPDATE") {
+                                               // Load SQL commands for update (already done!)
+                                               $ext_name = substr($ext_name, 7);
+                                               $ext_name = substr($ext_name, 0, strpos($ext_name, "-"));
+                                               $test = "[UPDATE-".$ext_name."-";
+                                               $ext_ver = substr($subj, strlen($test));
+                                               $ext_ver = substr($ext_ver, 0, strpos($ext_ver, ":"));
+
+                                               // Load SQLs from file
+                                               $SQLs = EXTENSION_UPDATE("ext-".$ext_name.".php", $ext_name, $ext_ver, true);
+
+                                               // Add notes to text
+                                               $text .= $NOTES;
+
+                                               // Set title
+                                               $title = ADMIN_SQLS_EXECUTED_ON_UPDATE;
+                                       } else {
+                                               // Remove extension's name
+                                               $ext_name = "";
+                                       }
+
+                                       // Add SQLs to a table
+                                       if (empty($SQLs)) $SQLs = array();
+                                       if (empty($title)) $title = "";
+                                       if ((!empty($ext_name)) && (GET_EXT_VERSION("sql_patches")) && ($_CONFIG['verbose_sql'] == "Y")) {
+                                               // Add verbose SQL table
+                                               $text .= EXTENSION_VERBOSE_TABLE($SQLs, $title, " class=\"admin_table top2 left2 right2\"", true, "100%")."<br />\n";
+                                       } // END - if
+                               } else {
+                                       // Run SQL commands in dry mode but only return the notes
+                                       $SQLs = EXTENSION_UPDATE("ext-".$ext_name.".php", $ext_name, $ext_ver, true);
+                                       $text .= $NOTES;
+                               }
+
+                               // Prepare array for the template
+                               $content = array(
+                                       'sw'        => $SW,
+                                       'subj'      => $subj,
+                                       'add'       => $ADD,
+                                       'text'      => $text,
+                                       'created'   => MAKE_DATETIME($created, "1"),
+                                       'extension' => $ext_name
+                               );
+
+                               // Load template
+                               $OUT .= LOAD_TEMPLATE("admin_overview_row", true, $content);
+
+                               // Which task do we actually have here?
+                               switch ($type)
+                               {
+                               case "EXTENSION": // Install new extensions
+                                       $ext_name = substr($subj, 1, strpos($subj, ":") - 1);
+                                       $result_lines = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
+                                        array($ext_name), __FILE__, __LINE__);
+                                       $lines = SQL_NUMROWS($result_lines);
+                                       SQL_FREERESULT($result_lines);
+                                       if ($lines == "0") {
+                                               // New extension found
+                                               $OUT .= LOAD_TEMPLATE("admin_ext_reg_form", true, array(
+                                                       'id'       => bigintval($id),
+                                                       'ext_name' => $ext_name
+                                               ));
+                                       } else {
+                                               // Task is closed so nothing is todo
+                                               $OUT .= "<FONT class=\"admin_failed\">".ADMIN_EXT_ALREADY_REGISTERED."</FONT>\n";
+
+                                               // Close task but not already closes or deleted or update tasks
+                                               if (($status != "CLOSED") && ($status != "DELETED") && ($type != "EXTENSION_UPDATE")) {
+                                                       ADMIN_SOLVE_TASK($tid);
+                                               } // END - if
+                                       }
+                                       break;
+
+                               case "EXTENSION_UPDATE":
+                                       // Extension updates are installed automatically
+                                       $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_EXTENSION_UPDATED."</FONT>\n";
+
+                                       // Close task
+                                       if (($status != "CLOSED") && ($status != "DELETED")) {
+                                               // Solve the task
+                                               ADMIN_SOLVE_TASK($tid);
+                                       } // END - if
+                                       break;
+
+                               case "SUPPORT_MEMBER": // Assign on member's support request
+                                       switch ($mode)
+                                       {
+                                       default: // Unknown support mode
+                                               $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_UNKNOWN_SUPPORT_MODE_1.$mode.ADMIN_UNKNOWN_SUPPORT_MODE_2."</FONT>\n";
+                                               break;
+                                       }
+                                       break;
+
+                               case "PAYOUT_REQUEST": // Payout requests
+                                       if (EXT_IS_ACTIVE("payout")) {
+                                               // Extension is installed so let him send a notification to the user
+                                               $result_pay = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_payouts WHERE userid=%s AND payout_timestamp=%s LIMIT 1",
+                                                array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
+                                               list($pid) = SQL_FETCHROW($result_pay);
+                                               SQL_FREERESULT($result_pay);
+
+                                               if ((!empty($pid)) && ($pid > 0)) {
+                                                       // Payout ID can be obtained
+                                                       $content = array(
+                                                               'pid' => $pid,
+                                                               'tid' => $tid,
+                                                       );
+                                                       $OUT .= LOAD_TEMPLATE("admin_payout_overview_form", true, $content);
+                                               } else {
+                                                       // Problem obtaining payout ID
+                                                       $OUT .= "<FONT class=\"admin_failed medium\">".PAYOUT_OBTAIN_ID_FAILED."</FONT>\n";
+                                               }
+                                       } else {
+                                               // Extension is not installed
+                                               $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_PAYOUT_NOT_INSTALLED."</FONT>\n";
+                                       }
+                                       break;
+
+                               case "WERNIS_REQUEST": // Wernis requests
+                                       if (EXT_IS_ACTIVE("wernis")) {
+                                               // Extension is installed so let him send a notification to the user
+                                               $result_pay = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_wernis WHERE userid=%s AND wernis_timestamp=%s LIMIT 1",
+                                                array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
+                                               list($pid) = SQL_FETCHROW($result_pay);
+                                               SQL_FREERESULT($result_pay);
+
+                                               if ((!empty($pid)) && ($pid > 0)) {
+                                                       // Payout ID can be obtained
+                                                       $content = array(
+                                                               'pid' => $pid,
+                                                               'tid' => $tid,
+                                                       );
+                                                       $OUT .= LOAD_TEMPLATE("admin_wernis_overview_form", true, $content);
+                                               } else {
+                                                       // Problem obtaining wernis ID
+                                                       $OUT .= "<FONT class=\"admin_failed medium\">".WERNIS_OBTAIN_ID_FAILED."</FONT>\n";
+                                               }
+                                       } else {
+                                               // Extension is not installed
+                                               $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_WERNIS_NOT_INSTALLED."</FONT>\n";
+                                       }
+                                       break;
+
+                               case "HOLIDAY_REQUEST": // Holiday requests
+                                       $OUT .= LOAD_TEMPLATE("admin_task_holiday", true, $uid);
+                                       break;
+
+                               case "NL_UNSUBSCRIBE": // Newsletter unsubscriptions
+                                       $result = SQL_QUERY_ESC("SELECT nl_timespan FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                        array(bigintval($uid)), __FILE__, __LINE__);
+                                       list($span) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+
+                                       if ($span > 0) {
+                                               // Undone unscubscribe request
+                                               $content = array(
+                                                       'uid' => $uid,
+                                                       'id'  => $tid
+                                               );
+                                               $OUT .= LOAD_TEMPLATE("admin_newsletter_tsk", true, $content);
+                                       } else {
+                                               // Already unsubscribed
+                                               $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_NL_UNSUBSCRIBE_ALREADY."</FONT>\n";
+                                       }
+                                       break;
+
+                               default: // Unknown task type
+                                       $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_UNKNOWN_TASK_TYPE_1.$type.ADMIN_UNKNOWN_TASK_TYPE_2.$id.ADMIN_UNKNOWN_TASK_TYPE_3."</FONT>\n";
+                                       break;
+                               }
+                               $OUT .= "  </TD>
+  <TD width=\"1%\" class=\"switch_sw".$SW." bottom2 right2\">&nbsp;</TD>
+</TR>\n";
+                       } // END - if
+                       $SW = 3 - $SW;
+               } // END - foreach
+               define('__TASK_ROWS', $OUT);
+
+               // Load final template
+               LOAD_TEMPLATE("admin_overview_list");
+       } else {
+               if ((isset($_POST['task'])) && ((sizeof($_POST['task']) > 0) || ($_POST['task'][0] == "1"))) {
+                       // Only unassign / delete tasks when there are selected tasks posted
+                       if (!empty($_POST['unassign'])) {
+                               // Unassign from tasks
+                               foreach ($_POST['task'] as $id => $sel) {
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1",
+                                        array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+                               }
+                       } elseif (isset($_POST['del'])) {
+                               // Delete tasks
+                               foreach ($_POST['task'] as $id => $sel) {
+                                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE id=%s AND assigned_admin IN (%s,0) LIMIT 1",
+                                        array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+                               }
+                       }
+
+                       // Update query
+                       $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin=%s OR (assigned_admin=0 AND status='NEW') ORDER BY task_created DESC",
+                        array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+               } // END - if
+
+               // There are uncompleted jobs!
+               LOAD_TEMPLATE("admin_overview_header");
+               $SW = 2;
+               while (list($id, $admin, $uid, $type, $subj, $text, $created) = SQL_FETCHROW($result_tasks)) {
+                       $infos = "---";
+                       if ($admin == "0") {
+                               // No admin currently is assigned
+                               $admin = "<FONT class=\"admin_note\">".ADMIN_NO_ADMIN_ASSIGNED."</FONT>";
+                       } else {
+                               // Load admin's data
+                               $login = GET_ADMIN_LOGIN($admin);
+                               if ($login != "***") {
+                                       // Admin found
+                                       $admin = "<A href=\"".URL."/modules.php?module=admin&amp;what=admins_contct&amp;admin=".$admin."\">".$login."</A>";
+                               } else {
+                                       // Maybe deleted?
+                                       $admin = "<FONT class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</FONT>";
+                               }
+                       }
+                       $evl = "\$type_out = ADMIN_TASK_IS_".strtoupper($type).";";
+                       eval($evl);
+                       $type2 = substr($text, 0, strpos($text, ":"));
+                       // Generate infos
+                       switch ($type)
+                       {
+                       case "EXTENSION":
+                       case "EXTENSION_UPDATE":
+                               $infos = substr($subj, 1, strpos($subj, ":") - 1);
+                               break;
+                       }
+                       if ($uid > 0)
+                       {
+                               // Member found otherwise it's a system task
+                               $uid = ADMIN_USER_PROFILE_LINK($uid);
+                       }
+                        else
+                       {
+                               $uid = "<I>".ADMIN_IS_SYSTEM_TASK."</I>";
+                       }
+
+                       $content = array(
+                               'sw'      => $SW,
+                               'id'      => $id,
+                               'admin'   => $admin,
+                               'infos'   => $infos,
+                               'uid'     => $uid,
+                               'type'    => $type_out,
+                               'created' => MAKE_DATETIME($created, "2")
+                       );
+
+                       LOAD_TEMPLATE("admin_overview_list_rows", false, $content);
+                       $SW = 3 - $SW;
+               }
+               // Free memory
+               SQL_FREERESULT($result_tasks);
+
+               // Load footer template
+               LOAD_TEMPLATE("admin_overview_footer");
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what- b/inc/modules/admin/what-
new file mode 100644 (file)
index 0000000..fb5dca6
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-add_bank_package.php b/inc/modules/admin/what-add_bank_package.php
new file mode 100644 (file)
index 0000000..c24efeb
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/31/2007 *
+ * ================                             Last change: 05/31/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_bank_package.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Is the formular sent?
+if (isset($_POST['ok'])) {
+       // Save the row to the database
+       ADMIN_SAVE_SETTINGS($_POST, "_bank_packages", "", array("account_fee", "interest_plus", "interest_minus", "first_payment"), true);
+} else {
+       // Display form
+       LOAD_TEMPLATE("admin_add_bank_package");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-add_guestnl_cat.php b/inc/modules/admin/what-add_guestnl_cat.php
new file mode 100644 (file)
index 0000000..1898200
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/05/2005 *
+ * ================                             Last change: 02/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_guestnl_cat.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Add newsletter category                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Newsletter-Kategorie hinzufuegen                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Check if category does already exist
+}
+ else
+{
+       // Display form
+       LOAD_TEMPLATE("admin_add_guestnl_cat");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php
new file mode 100644 (file)
index 0000000..b161fd7
--- /dev/null
@@ -0,0 +1,126 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/23/2003 *
+ * ===============                              Last change: 09/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_points.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Add manually points to a user                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Manuell einem Mitglied Punkte gutschreiben       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Fix a notice
+if (!isset($_GET['u_id'])) $_GET['u_id'] = "";
+
+if ($_GET['u_id'] == "all") {
+       // Add points to all accounts
+       if ((isset($_POST['ok'])) && ($_POST['points'] > 0)) {
+               define('__POINTS_VALUE', $_POST['points']);
+               $result_main = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+               while (list($uid) = SQL_FETCHROW($result_main)) {
+                       // User ID found in URL so we use this give him some credits
+                       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1) {
+                               // Selected user does exist
+                               list($sname, $fname, $email) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               if ((isset($_POST['ok'])) && (!empty($_POST['points']))) {
+                                       // Ok, add points and send an email to him...
+                                       ADD_POINTS_REFSYSTEM($uid, bigintval($_POST['points']), false, "0", false, "direct");
+
+                                       // Prepare content
+                                       $content = array(
+                                               'text'   => SQL_ESCAPE($_POST['reason']),
+                                               'points' => bigintval($_POST['points'])
+                                       );
+
+                                       // Load email template and send email away
+                                       $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($uid));
+                                       SEND_EMAIL(bigintval($uid), ADMIN_ADD_SUBJ, $msg);
+                               }
+                       }
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_main);
+
+               // Output message
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_POINTS_ADDED);
+       } else {
+               // Display form add points
+               LOAD_TEMPLATE("admin_add_points_all");
+       }
+} elseif (!empty($_GET['u_id'])) {
+       // User ID found in URL so we use this give him some credits
+       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Selected user does exist
+               list($sname, $fname, $email) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               if ((isset($_POST['ok'])) && (!empty($_POST['points']))) {
+                       // Ok, add points and send an email to him...
+                       ADD_POINTS_REFSYSTEM(bigintval($_GET['u_id']), bigintval($_POST['points']), false, "0", false, "direct");
+
+                       // Prepare content
+                       $content = array(
+                               'text'   => SQL_ESCAPE($_POST['reason']),
+                               'points' => bigintval($_POST['points'])
+                       );
+
+                       // Message laden
+                       $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($_GET['u_id']));
+
+                       SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_ADD_SUBJ, $msg);
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_ADDED);
+               } else {
+                       // Opps, missing form here
+                       define('__USER_VALUE', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</A>");
+                       define('__UID_VALUE', $_GET['u_id']);
+                       LOAD_TEMPLATE("admin_add_points");
+               }
+       } else {
+               // User not found!
+               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+       }
+} else {
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX("0", true);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php
new file mode 100644 (file)
index 0000000..1eb0f2f
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/29/2004 *
+ * ================                             Last change: 08/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_rallye.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Add new rallye                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Neue Ref-Rallye einfuegen                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Generate timestamps
+       $START = mktime($_POST['start_hour'], $_POST['start_min'], $_POST['start_sec'], $_POST['start_month'], $_POST['start_day'], $_POST['start_year']);
+       $END   = mktime($_POST['end_hour']  , $_POST['end_min']  , $_POST['end_sec']  , $_POST['end_month']  , $_POST['end_day']  , $_POST['end_year']  );
+
+       // Is there already a rallye running?
+       $result = SQL_QUERY_ESC("SELECT id, admin_id FROM "._MYSQL_PREFIX."_rallye_data WHERE (start_time <= %s AND end_time >= %s) OR (start_time >= %s AND start_time <= %s) LIMIT 1",
+        array($START, $START, $START, $END), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Ok, start and end time did not overlap
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_rallye_data (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify)
+VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
+ array(
+       GET_ADMIN_ID(get_session('admin_login')),
+       $_POST['title'],
+       $_POST['descr'],
+       $_POST['template'],
+       $START,
+       $END,
+       $_POST['auto_add'],
+       $_POST['active'],
+       $_POST['notify'],
+), __FILE__, __LINE__);
+
+               // Load ID
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_data WHERE start_time='%s' AND end_time='%s' AND title='%s' LIMIT 1",
+                array($START, $END, $_POST['title']), __FILE__, __LINE__);
+               list($id) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               if (!empty($id))
+               {
+                       // Reload to prices...
+                       LOAD_URL("modules.php?module=admin&amp;what=config_rallye_prices&rallye=".$id);
+               }
+                else
+               {
+                       // Problem detected...
+                       LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_PROBLEM_CREATE);
+               }
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Overlapping detected
+               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_OVERLAP_TIMES);
+       }
+}
+
+// Prepare some constants for the template
+define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
+define('_ACTIVE_OPTIONS'  , ADD_OPTION_LINES("/ARRAY/", array('N','Y'), array(NO , YES)));
+define('_NOTIFY_OPTIONS'  , ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
+
+// Starting day
+define('_START_SEC'  , ADD_SELECTION("sec"  , "0"              , "start"));
+define('_START_MIN'  , ADD_SELECTION("min"  , "0"              , "start"));
+define('_START_HOUR' , ADD_SELECTION("hour" , date("G", time()), "start"));
+define('_START_DAY'  , ADD_SELECTION("day"  , date("d", time()), "start"));
+define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start"));
+define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start"));
+
+// Calcualte ending date
+$D = date("d", time() + ($_CONFIG['one_day'] * 7));
+$M = date("m", time() + ($_CONFIG['one_day'] * 7));
+$Y = date('Y', time() + ($_CONFIG['one_day'] * 7));
+
+// Ending day
+define('_END_SEC'  , ADD_SELECTION("sec"  , "0"              , "end"));
+define('_END_MIN'  , ADD_SELECTION("min"  , "0"              , "end"));
+define('_END_HOUR' , ADD_SELECTION("hour" , date("G", time()), "end"));
+define('_END_DAY'  , ADD_SELECTION("day"  , $D               , "end"));
+define('_END_MONTH', ADD_SELECTION("month", $M               , "end"));
+define('_END_YEAR' , ADD_SELECTION("year" , $Y               , "end"));
+
+// Transfer (maybe found) templates into constant for the template
+define('_TEMPLATES', RALLYE_TEMPLATE_SELECTION());
+
+// Load template
+LOAD_TEMPLATE("admin_add_rallye");
+
+//
+?>
diff --git a/inc/modules/admin/what-add_sponsor.php b/inc/modules/admin/what-add_sponsor.php
new file mode 100644 (file)
index 0000000..4583824
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/03/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_sponsor.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Add new sponsor                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Neuen Sponsor hinzufuegen                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save sponsor in database
+       SPONSOR_HANDLE_SPONSOR($_POST);
+} else {
+       // Prepare constants for the template
+       define('__SPONSOR_MIN_VALUE', $_CONFIG['sponsor_min_points']);
+
+       // Output form
+       LOAD_TEMPLATE("admin_add_sponsor");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-add_surfbar_url.php b/inc/modules/admin/what-add_surfbar_url.php
new file mode 100644 (file)
index 0000000..b3f5bf3
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-add_surfbar_url.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Admin may add own URLs to the surfbar            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin kann eigene URLs der Surfbar hinzufuegen   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Was an URL added?
+if ((isset($_POST['add'])) && (!empty($_POST['url']))) {
+       // Then add this URL
+       if (SURFBAR_ADMIN_ADD_URL($_POST['url'], $_POST['limit'])) {
+               // URL was added
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_URL_ADDED);
+       } else {
+               // Not added
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_URL_NOT_ADDED);
+       }
+} // END - if
+
+// Load template
+LOAD_TEMPLATE("admin_add_surfbar_url");
+
+//
+?>
diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php
new file mode 100644 (file)
index 0000000..fa44c2d
--- /dev/null
@@ -0,0 +1,206 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/27/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admin_add.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Add more entries to the admin menu               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mehr Menueeintraege zum Admin-Bereich einfuegen  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check if the admin has entered title and what-php file name...
+if (((empty($_POST['title'])) || (empty($_POST['menu'])) || (empty($_POST['descr']))) && (isset($_POST['ok']))) {
+       unset($_POST['ok']);
+}
+
+if (!isset($_POST['ok']))
+{
+       // Create arrays
+       $menus = array(); $titles = array(); $below = array();
+
+       // Get all available main menus
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Read menu structure
+               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+               {
+                       // Menu actions
+                       $menus[] = $act;
+
+                       // Menu titles
+                       $titles[] = $title;
+
+                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                       $below[] = $sort + 1;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Remove double eintries
+               $prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
+               foreach ($menus as $key => $value)
+               {
+                       if ($value == $prev)
+                       {
+                               unset($dmy[$key]);
+                               unset($dmy2[$key]);
+                               unset($dmy3[$key]);
+                       }
+                        else
+                       {
+                               $prev = $value;
+                       }
+               }
+               $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+               // Load sub menus :)
+               foreach ($menus as $key_main => $value_main)
+               {
+                       $result = SQL_QUERY_ESC("SELECT what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+                        array($value_main), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) > 0)
+                       {
+                               $menus[$value_main] = array();
+                               $titles[$value_main] = array();
+                               $below[$value_main] = array();
+                               // Read menu structure
+                               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+                               {
+                                       // Menu actions
+                                       $menus[$value_main][] = $act;
+
+                                       // Menu titles
+                                       $titles[$value_main][] = $title;
+
+                                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                                       $below[$value_main][] = $sort + 1;
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Remove double eintries
+                               $prev = ""; $dmy = $menus[$value_main]; $dmy2 = $titles[$value_main]; $dmy3 = $below[$value_main];
+                               foreach ($menus[$value_main] as $key => $value)
+                               {
+                                       if ($value == $prev)
+                                       {
+                                               unset($dmy[$key]);
+                                               unset($dmy2[$key]);
+                                               unset($dmy3[$key]);
+                                       }
+                                        else
+                                       {
+                                               $prev = $value;
+                                       }
+                               }
+                               $menus[$value_main] = $dmy; $titles[$value_main] = $dmy2; $below[$value_main] = $dmy3;
+                       }
+               }
+       }
+       $OUT = "    <SELECT class=\"admin_select\" name=\"sort\" size=\"1\">
+      <OPTION value=\"0\">".IS_FIRST_MENU."</OPTION>\n";
+       foreach ($below as $key => $m)
+       {
+               if (is_array($m))
+               {
+                       foreach ($m as $key2 => $m2)
+                       {
+                               $OUT .= "      <OPTION value=\"".$m2."\">".$titles[$key][$key2];
+                               foreach ($menus as $k => $v)
+                               {
+                                       if (($v == $key) && (!is_array($v)))
+                                       {
+                                               $OUT .= " (".$titles[$k].")";
+                                       }
+                               }
+                               $OUT .= "</OPTION>\n";
+                       }
+               }
+                else
+               {
+                       $OUT .= "      <OPTION value=\"".$m."\">".$titles[$key]."</OPTION>\n";
+               }
+       }
+       $OUT .= "</SELECT>";
+
+       define('__BELOW_SELECTION' , $OUT);
+       define('__WHAT_SELECTION'  , ADMIN_MAKE_MENU_SELECTION("admin", "what", "name"));
+       define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION("admin", "action", "menu"));
+
+       // Display form
+       LOAD_TEMPLATE("admin_admin_add");
+}
+ elseif (!IS_DEMO())
+{
+       // Insert new menu entry
+       if (!empty($_POST['menu']))
+       {
+               // Add sub menu
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`)
+VALUES('%s','%s','%s','%s','%s')",
+ array(
+       $_POST['menu'],
+       $_POST['name'],
+       $_POST['title'],
+       addslashes($_POST['descr']),
+       bigintval($_POST['sort']),
+), __FILE__, __LINE__);
+               CACHE_PURGE_ADMIN_MENU(0, $_POST['menu'], $_POST['name']);
+       }
+        else
+       {
+               // Add main menu
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, title, descr, sort)
+VALUES('%s','%s','%s','%s')",
+ array(
+       $_POST['name'],
+       $_POST['title'],
+       addslashes($_POST['descr']),
+       bigintval($_POST['sort']),
+), __FILE__, __LINE__);
+               CACHE_PURGE_ADMIN_MENU(0, $_POST['name']);
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
+}
+ else
+{
+       // Is demo login!
+       LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php
new file mode 100644 (file)
index 0000000..88db098
--- /dev/null
@@ -0,0 +1,305 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-adminedit.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit the admin menu                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Das Admin-Menue editieren                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Do we edit/delete/change main menus or sub menus?
+$AND = "(what = '' OR what IS NULL)"; $SUB = "";
+if (!empty($_GET['sub']))
+{
+       $AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub']));
+       $SUB = SQL_ESCAPE($_GET['sub']);
+}
+
+// Get count of (maybe) selected menu points
+$chk = 0;
+if (!empty($_POST['sel'])) $chk = SELECTION_COUNT($_POST['sel']);
+
+// List all menu points and make them editable
+if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) {
+       // Edit menu entries
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+       $cnt = 0; $SW = 2;
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu, $act, $wht, $descr) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'action' => ADMIN_MAKE_MENU_SELECTION("admin", "action", "sel_action[".$sel."]", $act),
+                                       'what'   => ADMIN_MAKE_MENU_SELECTION("admin", "what", "sel_what[".$sel."]", $wht),
+                                       'sw'     => $SW,
+                                       'sel'    => $sel,
+                                       'menu'   => $menu,
+                                       'descr'  => $descr,
+                                       'cnt'    => $cnt,
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_amenu_edit_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_amenu_edit_form");
+}
+ elseif ((isset($_POST['del'])) && (!IS_DEMO()))
+{
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+       // Del menu entries with or without confirmation
+       $SW = 2; $cnt = 0; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'menu' => $menu,
+                                       'cnt'  => $cnt,
+                                       'sel'  => $sel,
+                                       'sw'   => $SW
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_amenu_delete_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_amenu_delete");
+}
+ elseif ((isset($_POST['ok'])) && (!IS_DEMO()))
+{
+       // An action is done...
+       switch ($_POST['ok'])
+       {
+       case "edit": // Edit menu
+               foreach ($_POST['sel'] as $sel => $menu)
+               {
+                       // Secure ID
+                       $sel = bigintval($sel);
+
+                       // Update entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET
+title='%s',
+action='%s',
+what='%s',
+descr='%s'
+WHERE ".$AND." AND id=%s LIMIT 1",
+ array(
+       $menu,
+       $_POST['sel_action'][$sel],
+       $_POST['sel_what'][$sel],
+       addslashes($_POST['sel_desc'][$sel]),
+       $sel,
+), __FILE__, __LINE__);
+               }
+               CACHE_PURGE_ADMIN_MENU(0, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel]);
+               LOAD_TEMPLATE("admin_data_saved");
+               break;
+
+       case "del": // Delete menu
+               foreach ($_POST['sel'] as $sel => $menu)
+               {
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       CACHE_PURGE_ADMIN_MENU(0, "", "", $AND);
+               }
+               LOAD_TEMPLATE("admin_data_saved");
+               break;
+
+       default: // Unexpected action
+               define('__OK_VALUE', $_POST['ok']);
+               LOAD_TEMPLATE("admin_menu_unknown_okay");
+               break;
+       }
+}
+ else
+{
+       if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid'])))
+       {
+               // Get IDs
+               if (!empty($_GET['w']))
+               {
+                       // Sub menus selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+                else
+               {
+                       // Main menu selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+
+               if ((!empty($tid)) && (!empty($fid)))
+               {
+                       // Sort menu
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__);
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__);
+                       CACHE_PURGE_ADMIN_MENU(0, "", "", $AND);
+               }
+       }
+
+       // By default list menus
+       if (!empty($SUB))
+       {
+               // Sub menus of a main menu
+               $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC",
+                array($SUB), __FILE__, __LINE__);
+       }
+        else
+       {
+               // Main menus
+               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
+       }
+       $max = SQL_NUMROWS($result);
+       if ($max > 0)
+       {
+               define('__SUB_VALUE', $SUB);
+               $SW = 2; $cnt = 0; $OUT = "";
+               while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result))
+               {
+                       $cnt++;
+                       if (($sort == 0) || (($sort == 1) && (!empty($SUB))))
+                       {
+                               // Is highest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=adminedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+                        elseif ($cnt == $max)
+                       {
+                               // Is lowest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=adminedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>";
+                       }
+                        elseif ($sort > 0)
+                       {
+                               // Anything else between highest and lowest
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=adminedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>/<A href=\"".URL."/modules.php?module=admin&amp;what=adminedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+
+                       if (empty($act)) $act = "&nbsp;";
+                       if (empty($wht))   $wht   = "&nbsp;";
+                       if (empty($title))  $title  = "&nbsp;";
+
+                       $content = array(
+                               'sw'     => $SW,
+                               'id'     => $id,
+                               'action' => $act,
+                               'what'   => $wht,
+                               'title'  => $title,
+                               'navi'   => $NAVI,
+                               'mode'   => "admin",
+                       );
+                       $OUT .= LOAD_TEMPLATE("admin_menu_overview_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__MENU_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_amenu_edit");
+       }
+        else
+       {
+               // Menu entries are missing... (???)
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php
new file mode 100644 (file)
index 0000000..667568f
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/12/2004 *
+ * ================                             Last change: 04/18/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admins_add.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Add new administrator account                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Neues Administrator-Account anlegen              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+global $cacheInstance;
+
+// Display form is default
+$FORM = true;
+
+if ((isset($_POST['add'])) && (!empty($_POST['login'])) && (!empty($_POST['email'])) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] == $_POST['pass2']))
+{
+       // Add admin when not added already
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+        array($_POST['login']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Login does not exist so we can create it.
+               $FORM = false;
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins (login, password, email) VALUES ('%s','%s','%s')",
+                array($_POST['login'], generateHash($_POST['pass1']), $_POST['email']), __FILE__, __LINE__);
+
+               // Admin login saved
+               LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_done\">".ADMIN_ADMINS_ADD_DONE."</FONT>");
+
+               // Remove cache file
+               if (EXT_IS_ACTIVE("cache"))
+               {
+                       if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+               }
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+}
+
+if ($FORM)
+{
+       // Clear unset variables
+       if (empty($_POST['login'])) $_POST['login'] = "";
+       if (empty($_POST['email'])) $_POST['email'] = "";
+
+       // Load form from template
+       LOAD_TEMPLATE("admin_admins_add");
+}
+//
+?>
diff --git a/inc/modules/admin/what-admins_contct.php b/inc/modules/admin/what-admins_contct.php
new file mode 100644 (file)
index 0000000..f004def
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/19/2004 *
+ * ================                             Last change: 06/19/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admins_contct.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Contact an admin through mail or message         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin per Mail oder Nachricht kontaktieren       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ((isset($_POST['ok'])) && (!empty($_GET['admin']))) {
+       // Send mail or message
+       if ((EXT_IS_ACTIVE("msg")) && ($_POST['type'] == "msg")) {
+               // Add message
+               $msg = LOAD_EMAIL_TEMPLATE("admins_msg_contct_admin", $_POST['text'], "0");
+               SEND_ADMIN_MESSAGE($_GET['admin'], ADMINS_MSG_FROM_ADMIN, $msg);
+       } else {
+               // Load admin's email address
+               $email = GET_ADMIN_EMAIL(GET_ADMIN_LOGIN(bigintval($_GET['admin'])));
+
+               // Load email template and send the mail to the admin
+               $msg = LOAD_EMAIL_TEMPLATE("admins_mail_contct_admin", $_POST['text'], "0");
+               SEND_EMAIL($email, ADMINS_MSG_FROM_ADMIN, $msg);
+       }
+
+       // Mail / message dropped
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_ADMIN_CONTACTED);
+} elseif (!empty($_GET['admin'])) {
+       // Load contact form template
+       define('__ADMIN', $_GET['admin']);
+       if (EXT_IS_ACTIVE("msg")) {
+               // Add option to select between mail and message
+               define('ADMINS_MESSAGING_SELECTION', LOAD_TEMPLATE("admin_admins_contct_select", true));
+       } else {
+               // Outout hidden input
+               define('ADMINS_MESSAGING_SELECTION', LOAD_TEMPLATE("admin_admins_contct_default", true));
+       }
+       LOAD_TEMPLATE("admin_admins_contct_form");
+} else {
+       // Please select an admin!
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_SELECT_ADMIN);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-admins_edit.php b/inc/modules/admin/what-admins_edit.php
new file mode 100644 (file)
index 0000000..e4aaee8
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/18/2004 *
+ * ================                             Last change: 04/18/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admins_edit.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit admin accounts                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin-Account editieren                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Instance for the cache extension
+global $cacheInstance;
+
+// Set selection data to empty array when it is empty
+if (empty($_POST['sel'])) $_POST['sel'] = array();
+
+// Check if direct admin account was selected
+if (!empty($_GET['admin'])) {
+       // Secure ID number
+       $aid = bigintval($_GET['admin']);
+       $_POST['edit'] = "1";
+       $_POST['sel'][$aid] = "1";
+}
+
+if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+       // Edit account(s)
+       ADMINS_EDIT_ADMIN_ACCOUNTS($_POST);
+} elseif ((isset($_POST['change'])) && (sizeof($_POST['login']) > 0)) {
+       // Change admin accounts
+       ADMINS_CHANGE_ADMIN_ACCOUNT($_POST);
+} elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+       // Show admin accounts for deletetion
+       ADMINS_DELETE_ADMIN_ACCOUNTS($_POST);
+} else {
+       if ((isset($_POST['remove'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
+               // Remove accounts now
+               ADMINS_REMOVE_ADMIN_ACCOUNTS($_POST);
+       }
+
+       // List all admin accounts
+       ADMINS_LIST_ADMIN_ACCOUNTS();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php
new file mode 100644 (file)
index 0000000..3d7e951
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/14/2004 *
+ * ================                             Last change: 10/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admins_mails.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Control which admin shall receive which mail     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Stellen Sie ein, welcher Admin welche Mail erh.  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['edit']))
+{
+       // Check if entires are checked
+       $SEL = SELECTION_COUNT($_POST['sel']);
+       if ($SEL > 0)
+       {
+               // Add option for userlog
+               $cacheArray['admins'] = ADD_OPTION_LINES("admins", "id", "login", "", "email");
+               $SW = 2; $rowNameS = "";
+               foreach ($_POST['sel'] as $template => $sel)
+               {
+                       // First of all load data from DB
+                       $result = SQL_QUERY_ESC("SELECT admin_id, id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY id",
+                        array($template), __FILE__, __LINE__);
+                       $OUT = ""; $aid = 0; $aid2 = 0;
+                       while (list($aid, $id) = SQL_FETCHROW($result))
+                       {
+                               $OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
+<OPTION value=\"0\"";
+                               if ($aid == "0") $OUT .= " selected default";
+                               $OUT .=">".ADMINS_ALL_ADMINS."</OPTION>\n";
+                               if (EXT_IS_ACTIVE("userlog"))
+                               {
+                                       $OUT .= "<OPTION value=\"-1\"";
+                                       if ($aid == "-1") $OUT .= " selected default";
+                                       $OUT .= ">".ADMINS_TO_USERLOG."</OPTION>\n";
+                               }
+                               $OUT .= ADD_OPTION_LINES("admins", "id", "login", $aid, "email");
+                               $OUT .= "</SELECT><br />\n";
+                               $aid2 = $aid; $id2 = $id;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+
+                       $content = array(
+                               'sw'      => $SW,
+                               'id'      => $id,
+                               'id2'     => $id2,
+                               'tpl'     => $template,
+                               'admins'  => $cacheArray['admins']
+                       );
+
+                       if ($aid2 > 0)
+                       {
+                               // Add form for an additional admin
+                               $OUT .= LOAD_TEMPLATE("admin_admins_mails_edit_form", true, $content);
+                       }
+                       // Save full rendered content
+                       $content['content'] = $OUT;
+
+                       // Start outputing line
+                       $rowNameS .= LOAD_TEMPLATE("admin_admins_mails_edit_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               define('__ADMINS_ROWS', $rowNameS);
+
+               // Edit checked entries
+               LOAD_TEMPLATE("admin_admins_mails_edit");
+       }
+        else
+       {
+               // Nothing selected
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_NO_MAIL_CHECKED);
+       }
+}
+ else
+{
+       // Load all assigned mails
+       $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template
+FROM "._MYSQL_PREFIX."_admins_mails AS m
+LEFT JOIN "._MYSQL_PREFIX."_admins AS a
+ON m.admin_id=a.id
+WHERE (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != ''
+ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Shall I change entries?
+               if (isset($_POST['change']))
+               {
+                       // Ok, update database
+                       foreach ($_POST['admin_id'] as $id => $aid)
+                       {
+                               // Secure IDs
+                               $id  = bigintval($id);
+                               $aid = bigintval($aid);
+
+                               // Update entry
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_mails SET admin_id=%s WHERE id=%s ORDER BY id LIMIT 1",
+                                array($aid, $id), __FILE__, __LINE__);
+
+                               if (($aid < 1) && (!empty($_POST['template'][$id])))
+                               {
+                                       // Remove any other admin entries
+                                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' AND id != '%s'",
+                                        array($_POST['template'][$id], $id), __FILE__, __LINE__);
+                               }
+                               if ($_POST['admin_new'][$_POST['template'][$id]] > 0)
+                               {
+                                       // Add new admin
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_mails (admin_id, mail_template) VALUES ('%s','%s')",
+                                        array($aid, $_POST['template'][$id]), __FILE__, __LINE__);
+                               }
+                       }
+
+                       // Query again...
+                       $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template FROM "._MYSQL_PREFIX."_admins_mails AS m, "._MYSQL_PREFIX."_admins AS a WHERE m.admin_id=a.id OR m.admin_id < 1 ORDER BY m.admin_id", __FILE__, __LINE__);
+               }
+
+               // List found entries
+               $SW = 2; $OUT = "";
+               while(list($id, $aid, $admin, $templ) = SQL_FETCHROW($result))
+               {
+                       if ($aid > 0)
+                       {
+                               // Admin assigned
+                               $admin_link = "<A href=\"".URL."/modules.php?module=admin&amp;what=admins_contct&amp;admin=".$aid."\">".$admin."</A>";
+                       }
+                        elseif ($aid == 0)
+                       {
+                               // All admins
+                               $admin_link = "<I>".ADMINS_ALL_ADMINS."</I>";
+                       }
+                        elseif (($aid == -1) && (EXT_IS_ACTIVE("usrlog")))
+                       {
+                               // To userlog
+                               $admin_link = "<I>".ADMINS_TO_USERLOG."</I>";
+                       }
+                       $content = array(
+                               'sw'   => $SW,
+                               'tpl'  => $templ,
+                               'alnk' => $admin_link
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("admin_admins_mails_list_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free result
+               SQL_FREERESULT($result);
+               define('__MAILS_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_admins_mails_list");
+       }
+        else
+       {
+               // No entries found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_MAILS_NO_ENTRIES);
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-autopurge.php b/inc/modules/admin/what-autopurge.php
new file mode 100644 (file)
index 0000000..cc27e51
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/25/2004 *
+ * ================                             Last change: 06/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-autopurge.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : AutoPurge configuration                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : AutoPurge-Konfiguration                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Data was submitted so we store it
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Setup constants for the template
+       switch ($_CONFIG['autopurge_inactive']) {
+               case 'Y':
+                       define('__YES_IN', " checked=\"checked\"");
+                       define('__NO_IN' , "");
+                       break;
+
+               case 'N':
+                       define('__YES_IN', "");
+                       define('__NO_IN' , " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['autopurge_unconfirmed']) {
+               case 'Y':
+                       define('__YES_UN', " checked=\"checked\"");
+                       define('__NO_UN' , "");
+                       break;
+
+               case 'N':
+                       define('__YES_UN', "");
+                       define('__NO_UN' , " checked=\"checked\"");
+                       break;
+       }
+
+       define('__AP_IN_SINCE', $_CONFIG['ap_inactive_since']);
+       define('__AP_IN_TIME' , $_CONFIG['ap_in_time']);
+       define('__AP_UN_TIME' , $_CONFIG['ap_un_time']);
+
+       // Output template
+       LOAD_TEMPLATE("admin_config_autopurge");
+}
+//
+?>
diff --git a/inc/modules/admin/what-bonus.php b/inc/modules/admin/what-bonus.php
new file mode 100644 (file)
index 0000000..aa9c985
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ================                             Last change: 04/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-bonus.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Bonus pages                                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bonusseiten                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-cache_stats.php b/inc/modules/admin/what-cache_stats.php
new file mode 100644 (file)
index 0000000..ee2f431
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/29/2005 *
+ * ================                             Last change: 04/29/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-cache_stats.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Stats for the caching extension                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Statistiken fuer die Cache-Erweiterung           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Calculate total hits
+$totalHits = ($_CONFIG['db_hits'] + $_CONFIG['cache_hits']);
+
+// Prepare data for the template
+define('__DB_HITS'   , TRANSLATE_COMMA($_CONFIG['db_hits']));
+define('__CACHE_HITS', TRANSLATE_COMMA($_CONFIG['cache_hits']));
+define('__TOTAL_HITS', TRANSLATE_COMMA($totalHits));
+define('__CACHE_PERC', TRANSLATE_COMMA(($_CONFIG['cache_hits'] / $totalHits * 100)));
+
+// Load template
+LOAD_TEMPLATE("admin_cache_stats");
+
+//
+?>
diff --git a/inc/modules/admin/what-chk_regs.php b/inc/modules/admin/what-chk_regs.php
new file mode 100644 (file)
index 0000000..8f8ebc3
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 03/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-chk_regs.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Check new registrations                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Neue Anmeldungen pruefen                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR ("admin", basename(__FILE__));
+
+// Check for accounts
+$query = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash FROM "._MYSQL_PREFIX."_user_data WHERE status='UNCONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($query) > 0) {
+       // We have some (new?) registrations!
+       $SW = 2; $OUT = "";
+       while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $hash) = SQL_FETCHROW($query)) {
+               if ($ref > 0) $ref = ADMIN_USER_PROFILE_LINK($ref);
+               // Prepare array for the row template
+               $content = array(
+                       'sw'     => $SW,
+                       'gender' => TRANSLATE_GENDER($gender),
+                       'sname'  => $sname,
+                       'fname'  => $fname,
+                       'email'  => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>",
+                       'ip'     => $IP,
+                       'ref'    => $ref,
+                       'hash'   => $hash,
+                       'link'   => ADMIN_USER_PROFILE_LINK($uid),
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_reg_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($query);
+       define('__REG_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_reg");
+} else {
+       // No registrations left - or all has confirmed their email address... :-)
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_CONFIRMED_EMAIL);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_active.php b/inc/modules/admin/what-config_active.php
new file mode 100644 (file)
index 0000000..3a7e0d8
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/20/2005 *
+ * ================                             Last change: 03/20/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_active.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for active list                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration der Aktiv-Liste                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Minimum mails / active
+       define('__LIMIT_VALUE', $_CONFIG['active_limit']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_active");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_admin.php b/inc/modules/admin/what-config_admin.php
new file mode 100644 (file)
index 0000000..8b78570
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/13/2006 *
+ * ================                             Last change: 01/13/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_admin.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure administrator's menu                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Administratormenue einstellen                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save configuration
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data for the template
+       switch ($_CONFIG['admin_menu'])
+       {
+       case "NEW":
+               define('__ADMIN_MENU_NEW', " checked=\"checked\"");
+               define('__ADMIN_MENU_OLD'   , "");
+               break;
+
+       case "OLD":
+               define('__ADMIN_MENU_NEW', "");
+               define('__ADMIN_MENU_OLD'   , " checked=\"checked\"");
+               break;
+       }
+
+       // Display form
+       LOAD_TEMPLATE("admin_config_admin");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_admins.php b/inc/modules/admin/what-config_admins.php
new file mode 100644 (file)
index 0000000..c1bf553
--- /dev/null
@@ -0,0 +1,278 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/30/2004 *
+ * ================                             Last change: 07/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File: what-config_admins.php                                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure admin ACLs                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Admin-ACLs einstellen                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$SEL = 0;
+if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
+
+if ((isset($_POST['edit'])) && ($SEL > 0)) {
+       // Edit ACLs
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $sel) {
+               // Load data for the ID
+               $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($aid, $act, $wht, $mode) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'               => $SW,
+                       'id'               => $id,
+                       'admins_selection' => ADD_OPTION_LINES("admins", "id", "login", $aid, "default_acl"),
+                       'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
+                       'what_selection'   => ADMIN_MENU_SELECTION("what", $wht, $id),
+                       'mode_options'     => ADD_OPTION_LINES(
+                               "/ARRAY/",
+                               array("allow", "deny"),
+                               array(ADMINS_ALLOW_MODE, ADMINS_DENY_MODE),
+                               $mode
+                       ),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_config_admins_edit_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__ACL_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_admins_edit");
+} elseif ((isset($_POST['change'])) && ($SEL > 0)) {
+       // Change entries
+       foreach ($_POST['sel'] as $id => $sel) {
+               // Secure ID
+               $id = bigintval($id);
+
+               // Update entries
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins_acls SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE id=%s LIMIT 1",
+                array($_POST['admin'][$id], $_POST['action_menu'][$id], $_POST['what_menu'][$id], $_POST['mode'][$id], $id),__FILE__, __LINE__);
+       }
+
+       // Update cache when installed
+       if (EXT_IS_ACTIVE("cache")) {
+               if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+
+               // Purge menu cache
+               CACHE_PURGE_ADMIN_MENU($_POST['admin'][$id]);
+       }
+
+       // Entries changed
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_CHANGED);
+} elseif ((isset($_POST['del'])) && ($SEL > 0)) {
+       // Delete ACLs
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $sel) {
+               // Load data for the ID
+               $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($admin, $act, $wht, $mode) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare variables
+               if (empty($act)) $act = "---";
+               if (empty($wht)) $wht   = "---";
+               $eval = "\$mode = ADMINS_".strtoupper($mode)."_MODE;";
+               eval($eval);
+
+               // Load admin's data
+               $login = GET_ADMIN_LOGIN($admin);
+               if ($login != "***") {
+                       // Admin found
+                       $admin = "<A href=\"".URL."/modules.php?module=admin&amp;what=admins_contct&amp;admin=".$admin."\">".$login."</A>";
+               } else {
+                       // Maybe deleted?
+                       $admin = "<FONT class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</FONT>";
+               }
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'     => $SW,
+                       'id'     => $id,
+                       'admin'  => $admin,
+                       'action' => $act,
+                       'what'   => $wht,
+                       'mode'   => $mode,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_config_admins_del_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__ACL_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_admins_del");
+} elseif ((isset($_POST['remove'])) && ($SEL > 0)) {
+       // Remove entries
+       foreach ($_POST['sel'] as $id => $sel) {
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1",
+                array(bigintval($id)),__FILE__, __LINE__);
+       }
+
+       // Update cache when installed
+       if (EXT_IS_ACTIVE("cache")) {
+               if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+
+               // @TODO This causes the whole (!) menu cache being rebuild
+               CACHE_PURGE_ADMIN_MENU();
+       }
+
+       // Entries deleted
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_DELETED);
+} elseif (isset($_POST['add'])) {
+       // Check if everything is fine...
+       $mode = GET_ADMIN_DEFAULT_ACL(GET_ADMIN_LOGIN(bigintval($_POST['admin_id'])));
+
+       // Default ACL is false
+       $ACL = false;
+       if (!empty($_POST['what_menu'])) {
+               // Check parent ACL
+               $ACL = ADMINS_CHECK_ACL(GET_ACTION("admin", $_POST['what_menu']), "");
+       }
+
+       if ($mode != $_POST['mode'] || ($ACL)) {
+               // Mode is fine
+               $BOTH = ((!empty($_POST['action_menu'])) && (!empty($_POST['what_menu'])));
+               if (((!empty($_POST['action_menu'])) || (!empty($_POST['what_menu']))) && (!$BOTH)) {
+                       // Main or sub menu selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins_acls WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
+                        array(bigintval($_POST['admin_id']), $_POST['action_menu'], $_POST['what_menu']), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 0) {
+                               // Finally add the new ACL
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_acls (admin_id, action_menu, what_menu, access_mode)
+VALUES ('%s','%s','%s','%s')",
+ array(
+       bigintval($_POST['admin_id']),
+       $_POST['action_menu'],
+       $_POST['what_menu'],
+       $_POST['mode']
+), __FILE__, __LINE__);
+                               $content = ADMIN_ADMINS_ACL_SAVED;
+
+                               // Update cache when installed
+                               if (EXT_IS_ACTIVE("cache")) {
+                                       if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+
+                                       // Purge cache
+                                       CACHE_PURGE_ADMIN_MENU($_POST['admin_id'], $_POST['action_menu'], $_POST['what_menu']);
+                               } // END - if
+                       } else {
+                               // ACL does already exist!
+                               $content = ADMIN_ADMINS_ACL_ALREADY_ADDED;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               } else {
+                       // No menu selected makes also no sence...
+                       $content = ADMIN_ADMINS_SELECT_ACTION_WHAT;
+               }
+       } else {
+               // Same mode makes no sence...
+               $content = ADMIN_ADMINS_SAME_MODE_SELECTED;
+       }
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+} else {
+       // List all ACLs
+       $result_acls = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, id", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_acls) > 0)
+       {
+               // List ACLs
+               $SW = 2; $OUT = "";
+               while(list($id, $admin, $act, $wht, $mode) = SQL_FETCHROW($result_acls))
+               {
+                       // Prepare variables
+                       if (empty($act)) $act = "---";
+                       if (empty($wht))   $wht   = "---";
+                       $eval = "\$mode = ADMINS_".strtoupper($mode)."_MODE;";
+                       eval($eval);
+
+                       // Load admin's data
+                       $login = GET_ADMIN_LOGIN($admin);
+                       if ($login != "***")
+                       {
+                               // Admin found
+                               $admin = "<A href=\"".URL."/modules.php?module=admin&amp;what=admins_contct&amp;admin=".$admin."\">".$login."</A>";
+                       }
+                        else
+                       {
+                               // Maybe deleted?
+                               $admin = "<FONT class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</FONT>";
+                       }
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'     => $SW,
+                               'id'     => $id,
+                               'admin'  => $admin,
+                               'action' => $act,
+                               'what'   => $wht,
+                               'mode'   => $mode,
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_config_admins_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__ACL_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_config_admins");
+       }
+
+       // Prepare some constants for the template
+       define('_ADMINS_SELECTION', ADD_OPTION_LINES("admins", "id", "login", "", "default_acl"));
+       define('_ACTION_SELECTION', ADMIN_MENU_SELECTION("action"));
+       define('_WHAT_SELECTION'  , ADMIN_MENU_SELECTION("what"));
+       define('_MODE_OPTIONS'    , ADD_OPTION_LINES("/ARRAY/", array("allow", "deny"), array(ADMINS_ALLOW_MODE, ADMINS_DENY_MODE)));
+
+       // Load template for adding new ACL
+       LOAD_TEMPLATE("admin_admins_add_acl");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_autopurge.php b/inc/modules/admin/what-config_autopurge.php
new file mode 100644 (file)
index 0000000..abbb29a
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/25/2004 *
+ * ================                             Last change: 05/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-autopurge.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : AutoPurge configuration                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : AutoPurge-Konfiguration                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Data was submitted so we store it
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Output de-/activation selections
+       define('__AP_INACTIVE_SELECTION'   , ADD_SELECTION("yn", $_CONFIG['autopurge_inactive']   , "autopurge_inactive"));
+       define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", $_CONFIG['autopurge_unconfirmed'], "autopurge_unconfirmed"));
+       define('__AP_TASKS_SELECTION'      , ADD_SELECTION("yn", $_CONFIG['ap_tasks']             , "autopurge_tasks"));
+       define('__AP_DEL_MAILS_SELECTION'  , ADD_SELECTION("yn", $_CONFIG['ap_del_mails']         , "ap_del_mails"));
+
+       // Output notification selections
+       define('__AP_NOTIFY_INACTIVE'      , ADD_SELECTION("yn", $_CONFIG['ap_in_mail']   , "ap_in_notify"));
+       define('__AP_NOTIFY_UNCONFIRMED'   , ADD_SELECTION("yn", $_CONFIG['ap_un_mail']   , "ap_un_notify"));
+       define('__AP_NOTIFY_TASKS'         , ADD_SELECTION("yn", $_CONFIG['ap_tasks_mail'], "ap_tasks_notify"));
+       define('__AP_NOTIFY_DEL_MAILS'     , ADD_SELECTION("yn", $_CONFIG['ap_dm_notify'] , "ap_dm_notify"));
+
+       // Output time selection boxes
+       define('__AP_IN_SINCE'      , CREATE_TIME_SELECTIONS($_CONFIG['ap_inactive_since'], "ap_inactive_since"  , "MWDh"));
+       define('__AP_IN_TIME'       , CREATE_TIME_SELECTIONS($_CONFIG['ap_in_time']       , "ap_inactive_time"   , "MWDh"));
+       define('__AP_UN_TIME'       , CREATE_TIME_SELECTIONS($_CONFIG['ap_un_time']       , "ap_unconfirmed_time", "MWDh"));
+       define('__AP_TASK_TIME'     , CREATE_TIME_SELECTIONS($_CONFIG['ap_tasks_time']    , "ap_tasks_time"      , "MWDh"));
+       define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS($_CONFIG['ap_dm_timeout']    , "ap_dm_timeout"      , "MWDh"));
+
+       // Mail confirmation links
+       define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS($_CONFIG['auto_purge'], "auto_purge", "MWD"));
+       if ($_CONFIG['auto_purge_active'] == "N") {
+               define('_CFG_AP_ACTIVE_N', " checked=\"checked\"");
+               define('_CFG_AP_ACTIVE_Y', "");
+       } else {
+               define('_CFG_AP_ACTIVE_N', "");
+               define('_CFG_AP_ACTIVE_Y', " checked=\"checked\"");
+       }
+
+       // Output template
+       LOAD_TEMPLATE("admin_config_autopurge");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php
new file mode 100644 (file)
index 0000000..40d412e
--- /dev/null
@@ -0,0 +1,169 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/09/2005 *
+ * ================                             Last change: 01/09/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_beg.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup beg link                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bettel-Link einstellen                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Translate german decimal commas to computer decimal dots
+       $_POST['beg_points']       = str_replace(",", ".", $_POST['beg_points']      );
+       $_POST['beg_points_max']   = str_replace(",", ".", $_POST['beg_points_max']  );
+       $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+
+       // Remember new settings
+       $_CONFIG['beg_rallye']        = $_POST['beg_rallye'];
+       $_CONFIG['beg_ral_en_notify'] = $_POST['beg_ral_en_notify'];
+       $_CONFIG['beg_ral_di_notify'] = $_POST['beg_ral_di_notify'];
+
+       // Include sending out mails
+       if ((($_CONFIG['beg_rallye'] == "Y") && ($_CONFIG['beg_ral_en_notify'] == "Y")) || (($_CONFIG['beg_rallye'] == "N") && ($_CONFIG['beg_ral_di_notify'] == "Y")))
+       {
+               include(PATH."inc/mails/beg_mails.php");
+       }
+}
+ else
+{
+       // Prepare constants for the template
+       define('__BEG_POINTS'           , TRANSLATE_COMMA($_CONFIG['beg_points']      , false));
+       define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA($_CONFIG['beg_points_max']  , false));
+       define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA($_CONFIG['beg_notify_bonus'], false));
+       define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS($_CONFIG['beg_timeout']    , "beg_timeout"    , "Dhm"));
+       define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS($_CONFIG['beg_uid_timeout'], "beg_uid_timeout", "Dhm"));
+       define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['beg_ip_timeout'] , "beg_ip_timeout" , "Dhm"));
+       define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS($_CONFIG['beg_notify_wait'], "beg_notify_wait", "ms" ));
+       define('__BEG_RANKS', $_CONFIG['beg_ranks']);
+
+       // Activate / Deactivate beg rallye (Y/N)
+       switch ($_CONFIG['beg_rallye'])
+       {
+       case 'Y':
+               define('__BEG_RALLYE_Y', " checked=\"checked\"");
+               define('__BEG_RALLYE_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_RALLYE_Y', "");
+               define('__BEG_RALLYE_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_active'])
+       {
+       case 'Y':
+               define('__BEG_ACTIVE_Y', " checked=\"checked\"");
+               define('__BEG_ACTIVE_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_ACTIVE_Y', "");
+               define('__BEG_ACTIVE_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_mode'])
+       {
+       case "DIRECT":
+               define('__BEG_MODE_DIRECT', " checked=\"checked\"");
+               define('__BEG_MODE_REF'   , "");
+               break;
+
+       case "REF":
+               define('__BEG_MODE_DIRECT', "");
+               define('__BEG_MODE_REF'   , " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_ral_en_notify'])
+       {
+       case 'Y':
+               define('__BEG_RAL_EN_NOTIFY_Y', " checked=\"checked\"");
+               define('__BEG_RAL_EN_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_RAL_EN_NOTIFY_Y', "");
+               define('__BEG_RAL_EN_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_ral_di_notify'])
+       {
+       case 'Y':
+               define('__BEG_RAL_DI_NOTIFY_Y', " checked=\"checked\"");
+               define('__BEG_RAL_DI_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_RAL_DI_NOTIFY_Y', "");
+               define('__BEG_RAL_DI_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_new_mem_notify'])
+       {
+       case 'Y':
+               define('__BEG_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
+               define('__BEG_NEW_MEMBER_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_NEW_MEMBER_NOTIFY_Y', "");
+               define('__BEG_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['beg_include_own'])
+       {
+       case 'Y':
+               define('__BEG_INCLUDE_OWN_Y', " checked=\"checked\"");
+               define('__BEG_INCLUDE_OWN_N', "");
+               break;
+
+       case 'N':
+               define('__BEG_INCLUDE_OWN_Y', "");
+               define('__BEG_INCLUDE_OWN_N', " checked=\"checked\"");
+               break;
+       }
+
+       // Add data to constant __MEMBER_SELECTION
+       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true, "beg_uid"));
+
+       // Load form template
+       LOAD_TEMPLATE("admin_config_beg");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_birthday.php b/inc/modules/admin/what-config_birthday.php
new file mode 100644 (file)
index 0000000..42a2b8e
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_birthday.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure birthday mails                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Geburtstagsgruesse einstellen                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save configuration
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data for the template
+       define('__POINTS_VALUE', $_CONFIG['birthday_points']);
+       switch ($_CONFIG['birthday_active'])
+       {
+       case 'Y':
+               define('__BIRTHDAY_ACTIVE_Y', " checked=\"checked\"");
+               define('__BIRTHDAY_ACTIVE_N', "");
+               break;
+
+       case 'N':
+               define('__BIRTHDAY_ACTIVE_Y', "");
+               define('__BIRTHDAY_ACTIVE_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['birthday_mode'])
+       {
+       case "DIRECT":
+               define('__BIRTHDAY_MODE_DIRECT', " checked=\"checked\"");
+               define('__BIRTHDAY_MODE_REF'   , "");
+               break;
+
+       case "REF":
+               define('__BIRTHDAY_MODE_DIRECT', "");
+               define('__BIRTHDAY_MODE_REF'   , " checked=\"checked\"");
+               break;
+       }
+
+       // Display form
+       LOAD_TEMPLATE("admin_config_birthday");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php
new file mode 100644 (file)
index 0000000..e7a1bb2
--- /dev/null
@@ -0,0 +1,242 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2004 *
+ * ================                             Last change: 11/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_bonus.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure "turbo-click-bonus"                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellen der Turbo-Klick-Verguetungen          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Replace german decimal commas to computer decimal dots
+       $_POST['login_bonus']         = str_replace(",", ".", $_POST['login_bonus']        );
+       $_POST['turbo_bonus']         = str_replace(",", ".", $_POST['turbo_bonus']        );
+       $_POST['bonus_ref']           = str_replace(",", ".", $_POST['bonus_ref']          );
+       $_POST['bonus_order']         = str_replace(",", ".", $_POST['bonus_order']        );
+       $_POST['bonus_notify_points'] = str_replace(",", ".", $_POST['bonus_notify_points']);
+
+       // Generate string for saving ranks
+       $_POST['turbo_rates'] = ""; $RATES = array();
+       foreach ($_POST['rate'] as $rate)
+       {
+               $rate = trim(str_replace(",", ".", $rate));
+               if (isset($rate)) $RATES[] = $rate;
+       }
+       $_POST['turbo_rates'] = trim(implode(";", $RATES));
+       unset($_POST['rate']);
+
+       // Automatically calculate bonus points for ranks 2 and 3 when not set
+       if (empty($_POST['turbo_rates'])) $_POST['turbo_rates'] = "".round($_CONFIG['turbo_bonus'] / 2).";".round($_CONFIG['turbo_bonus'] / 4)."";
+
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+
+       // Remember new settings
+       $_CONFIG['bonus_active']    = $_POST['bonus_active'];
+       $_CONFIG['bonus_en_notify'] = $_POST['bonus_en_notify'];
+       $_CONFIG['bonus_di_notify'] = $_POST['bonus_di_notify'];
+
+       // Include sending out mails
+       if ((($_CONFIG['bonus_active'] == "Y") && ($_CONFIG['bonus_en_notify'] == "Y")) || (($_CONFIG['bonus_active'] == "N") && ($_CONFIG['bonus_di_notify'] == "Y"))) {
+               include(PATH."inc/mails/bonus_mails.php");
+       }
+} else {
+       // Prepare contants for the template
+       define('__LOGIN_VALUE' , TRANSLATE_COMMA($_CONFIG['login_bonus']        , false));
+       define('__TURBO_VALUE' , TRANSLATE_COMMA($_CONFIG['turbo_bonus']        , false));
+       define('__ORDER_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_order']        , false));
+       define('__REF_VALUE'   , TRANSLATE_COMMA($_CONFIG['bonus_ref']          , false));
+       define('__STATS_VALUE' , TRANSLATE_COMMA($_CONFIG['bonus_stats']        , false));
+       define('__NOTIFY_VALUE', TRANSLATE_COMMA($_CONFIG['bonus_notify_points'], false));
+       define('__TRANKS_VALUE', $_CONFIG['bonus_ranks']);
+       define('__TLINES_VALUE', $_CONFIG['bonus_lines']);
+
+       // Transfer options to template __MEMBER_SELECTION
+       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['bonus_uid'], false, true, true));
+
+       // Initialize array for the points list
+       $RANKS = explode(";", $_CONFIG['bonus_ranks']);
+
+       // Automatically calculate bonus points for ranks 2 and 3 when not set
+       if (empty($_CONFIG['bonus_ranks'])) $RANKS = array(round($_CONFIG['turbo_bonus'] / 2), round($_CONFIG['turbo_bonus'] / 4));
+
+       // Generate list
+       $OUT = "<OL start=\"2\">\n";
+       foreach ($RANKS as $k => $rate) {
+               if (!empty($rate))      {
+                       // Print only when something is in
+                       $OUT .= "  <LI><INPUT type=\"text\" name=\"rate[".($k + 2)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\" value=\"".$rate."\">&nbsp;<FONT class=\"admin_notes\">(".POINTS.")</FONT?</LI>\n";
+               }
+       }
+       for ($i = 3; $i < 8; $i++) {
+               $OUT .= "  <LI><INPUT type=\"text\" name=\"rate[".($k + $i)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\">&nbsp;<FONT class=\"admin_notes\">(".POINTS.")</FONT?</LI>\n";
+       }
+       $OUT .= "</OL>\n";
+       define('__TRATES_LIST', $OUT);
+
+       define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['login_timeout']    , "login_timeout"    , "WDh"));
+       define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['bonus_timeout']    , "bonus_timeout"    , "WDh"));
+       define('__WAIT_SELECTION'         , CREATE_TIME_SELECTIONS($_CONFIG['bonus_notify_wait'], "bonus_notify_wait", "ms" ));
+
+       // Activate / Deactivate bonus active rallye (Y/N)
+       switch ($_CONFIG['bonus_active'])
+       {
+       case 'Y':
+               define('__BONUS_ACTIVE_Y', " checked=\"checked\"");
+               define('__BONUS_ACTIVE_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_ACTIVE_Y', "");
+               define('__BONUS_ACTIVE_N', " checked=\"checked\"");
+               break;
+       }
+       // Other bonus to de-/activate
+       switch ($_CONFIG['bonus_login_yn'])
+       {
+       case 'Y':
+               define('__BONUS_LOGIN_Y', " checked=\"checked\"");
+               define('__BONUS_LOGIN_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_LOGIN_Y', "");
+               define('__BONUS_LOGIN_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_stats_yn'])
+       {
+       case 'Y':
+               define('__BONUS_STATS_Y', " checked=\"checked\"");
+               define('__BONUS_STATS_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_STATS_Y', "");
+               define('__BONUS_STATS_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_order_yn'])
+       {
+       case 'Y':
+               define('__BONUS_ORDER_Y', " checked=\"checked\"");
+               define('__BONUS_ORDER_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_ORDER_Y', "");
+               define('__BONUS_ORDER_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_ref_yn'])
+       {
+       case 'Y':
+               define('__BONUS_REF_Y', " checked=\"checked\"");
+               define('__BONUS_REF_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_REF_Y', "");
+               define('__BONUS_REF_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_click_yn'])
+       {
+       case 'Y':
+               define('__BONUS_CLICK_Y', " checked=\"checked\"");
+               define('__BONUS_CLICK_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_CLICK_Y', "");
+               define('__BONUS_CLICK_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_en_notify'])
+       {
+       case 'Y':
+               define('__BONUS_EN_NOTIFY_Y', " checked=\"checked\"");
+               define('__BONUS_EN_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_EN_NOTIFY_Y', "");
+               define('__BONUS_EN_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_di_notify'])
+       {
+       case 'Y':
+               define('__BONUS_DI_NOTIFY_Y', " checked=\"checked\"");
+               define('__BONUS_DI_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_DI_NOTIFY_Y', "");
+               define('__BONUS_DI_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_new_mem_notify'])
+       {
+       case 'Y':
+               define('__BONUS_NEW_MEMBER_NOTIFY_Y', " checked=\"checked\"");
+               define('__BONUS_NEW_MEMBER_NOTIFY_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_NEW_MEMBER_NOTIFY_Y', "");
+               define('__BONUS_NEW_MEMBER_NOTIFY_N', " checked=\"checked\"");
+               break;
+       }
+       switch ($_CONFIG['bonus_include_own'])
+       {
+       case 'Y':
+               define('__BONUS_INCLUDE_OWN_Y', " checked=\"checked\"");
+               define('__BONUS_INCLUDE_OWN_N', "");
+               break;
+
+       case 'N':
+               define('__BONUS_INCLUDE_OWN_Y', "");
+               define('__BONUS_INCLUDE_OWN_N', " checked=\"checked\"");
+               break;
+       }
+
+       // Load final template
+       LOAD_TEMPLATE("admin_config_bonus", false);
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_cache.php b/inc/modules/admin/what-config_cache.php
new file mode 100644 (file)
index 0000000..ddb518f
--- /dev/null
@@ -0,0 +1,195 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/29/2006 *
+ * ================                             Last change: 01/29/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_cache.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for the caching system             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration des Caching-Systems                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Cache path has been not changed by default so don't test it again
+       $_POST['cache_tested'] = "N";
+
+       // Check if path has been changed
+       if ($_POST['cache_path'] != $_CONFIG['cache_path']) {
+               // Okay, cache path has been altered so we have to test it again!
+               $_POST['cache_tested'] = "Y";
+       }
+
+       // Delete deactivated cache files
+       if (($_POST['cache_admins'] == "N") && ($cacheInstance->cache_file("admins", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_acls'] == "N") && ($cacheInstance->cache_file("acls", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_exts'] == "N") && ($cacheInstance->cache_file("extensions", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_config'] == "N") && ($cacheInstance->cache_file("config", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_modreg'] == "N") && ($cacheInstance->cache_file("modreg", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_refdepth'] == "N") && ($cacheInstance->cache_file("refdepth", true))) {
+               $cacheInstance->cache_destroy();
+       }
+       if (($_POST['cache_refsys'] == "N") && ($cacheInstance->cache_file("refsys", true))) {
+               $cacheInstance->cache_destroy();
+       }
+
+       // Save configuration
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data
+       switch ($_CONFIG['cache_admins']) {
+               case 'Y':
+                       define('__ADMINS_Y', " checked=\"checked\"");
+                       define('__ADMINS_N', "");
+                       break;
+
+               case 'N':
+                       define('__ADMINS_Y', "");
+                       define('__ADMINS_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_acls']) {
+               case 'Y':
+                       define('__ACLS_Y', " checked=\"checked\"");
+                       define('__ACLS_N', "");
+                       break;
+
+               case 'N':
+                       define('__ACLS_Y', "");
+                       define('__ACLS_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_exts']) {
+               case 'Y':
+                       define('__EXTS_Y', " checked=\"checked\"");
+                       define('__EXTS_N', "");
+                       break;
+
+               case 'N':
+                       define('__EXTS_Y', "");
+                       define('__EXTS_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_config']) {
+               case 'Y':
+                       define('__CONFIG_Y', " checked=\"checked\"");
+                       define('__CONFIG_N', "");
+                       break;
+
+               case 'N':
+                       define('__CONFIG_Y', "");
+                       define('__CONFIG_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_modreg']) {
+               case 'Y':
+                       define('__MODREG_Y', " checked=\"checked\"");
+                       define('__MODREG_N', "");
+                       break;
+
+               case 'N':
+                       define('__MODREG_Y', "");
+                       define('__MODREG_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_refdepth']) {
+               case 'Y':
+                       define('__REFDEPTH_Y', " checked=\"checked\"");
+                       define('__REFDEPTH_N', "");
+                       break;
+
+               case 'N':
+                       define('__REFDEPTH_Y', "");
+                       define('__REFDEPTH_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_refsys']) {
+               case 'Y':
+                       define('__REFSYS_Y', " checked=\"checked\"");
+                       define('__REFSYS_N', "");
+                       break;
+
+               case 'N':
+                       define('__REFSYS_Y', "");
+                       define('__REFSYS_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_themes']) {
+               case 'Y':
+                       define('__THEMES_Y', " checked=\"checked\"");
+                       define('__THEMES_N', "");
+                       break;
+
+               case 'N':
+                       define('__THEMES_Y', "");
+                       define('__THEMES_N', " checked=\"checked\"");
+                       break;
+       }
+
+       switch ($_CONFIG['cache_admin_menu']) {
+               case 'Y':
+                       define('__ADMIN_MENU_Y', " checked=\"checked\"");
+                       define('__ADMIN_MENU_N', "");
+                       break;
+
+               case 'N':
+                       define('__ADMIN_MENU_Y', "");
+                       define('__ADMIN_MENU_N', " checked=\"checked\"");
+                       break;
+       }
+
+       define('__PATH', $_CONFIG['cache_path']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_cache");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_cats.php b/inc/modules/admin/what-config_cats.php
new file mode 100644 (file)
index 0000000..3f9584d
--- /dev/null
@@ -0,0 +1,201 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/10/2003 *
+ * ===============                              Last change: 07/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_cats.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Add new categories and edit / delete existing    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Neue Kategorien hinzufuegen und bestehende       *
+ *                     editieren / loeschen                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Init variable to avoid a notice
+$CATS = "";
+
+if (isset($_POST['add'])) {
+       // Add a new category
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_cats WHERE cat='%s' LIMIT 1",
+        array(addslashes($_POST['catname'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Category does not exists, we simply add it...
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_cats (cat, visible, sort) VALUES ('%s','%s','%s')",
+                array(addslashes($_POST['catname']), $_POST['visible'], bigintval($_POST['parent'] + 1)), __FILE__, __LINE__);
+               $content = "<SPAN class=\"admin_done\">".CATEGORY_ADDED."</SPAN>";
+       } else {
+               // Category does already exists
+               $content = "<SPAN class=\"admin_failed\">".CATEGORY_ALREADY_EXISTS."</SPAN>";
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+} elseif ((isset($_POST['ok'])) && (isset($_POST['id'])) && (is_array($_POST['id']))) {
+       // Change or delete categories...
+       $TEXT = "";
+       foreach ($_POST['id'] as $id => $cat) {
+               // Secure ID
+               $id = bigintval($id);
+
+               // Is the entry set?
+               if (!empty($cat)) {
+                       switch ($_GET['do'])
+                       {
+                       case "edit": // Change categories
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_cats SET cat='%s', visible='%s', sort=%s WHERE id=%s LIMIT 1",
+                                array($cat, $_POST['vis'][$id], $_POST['sort'][$id], $id), __FILE__, __LINE__);
+                               $TEXT = CATEGORIES_SAVED;
+                               break;
+
+                       case "del": // Delete categories
+                               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
+                                array($id), __FILE__, __LINE__);
+                               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
+                                array($id), __FILE__, __LINE__);
+                               $TEXT = CATEGORIES_DELETED;
+                               break;
+                       }
+               } else {
+                       // Entry not saved
+                       $TEXT .= sprintf(CATEGORY_NOT_SAVED, $id);
+               }
+       }
+
+       if (isset($TEXT)) {
+               // Display message
+               LOAD_TEMPLATE("admin_settings_saved", false, $TEXT);
+       }
+}
+ elseif ((isset($_POST['del'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0]))))
+{
+       // Delete categories
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value)
+       {
+               // Load data of category
+               $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($cat) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'  => $SW,
+                       'id'  => $id,
+                       'cat' => $cat,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_del_cats_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__CAT_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_del_cats");
+} elseif ((isset($_POST['edit'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
+       // Edit categories
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value)
+       {
+               // Load data from the category
+               $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($cat, $vis, $sort) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'   => $SW,
+                       'id'   => $id,
+                       'cat'  => $cat,
+                       'vis'  => ADD_SELECTION("yn", $vis, "vis", $id),
+                       'sort' => $sort,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_edit_cats_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__CAT_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_edit_cats");
+}
+ else
+{
+       // Load all categories
+       $result = SQL_QUERY("SELECT id, cat, visible, sort FROM "._MYSQL_PREFIX."_cats ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List already existing categories for editing
+               $SW = 2; $OUT = ""; $CATS = "";
+               while (list($id, $cat, $visible, $sort) = SQL_FETCHROW($result))
+               {
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'   => $SW,
+                               'id'   => $id,
+                               'cat'  => $cat,
+                               'vis'  => TRANSLATE_YESNO($visible),
+                               'sort' => $sort,
+                       );
+
+                       // Put cat descriptions into variable for the selection box
+                       if (strlen($cat) > 20) $cat = substr($cat, 0, 17)."...";
+                       $CATS .= "      <OPTION value=\"".$sort."\">".$cat."</OPTION>\n";
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_config_cats_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__CAT_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_config_cats");
+       }
+
+       define('CATS', $CATS);
+
+       // Form to add a new category
+       LOAD_TEMPLATE("admin_add_cat");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_doubler.php b/inc/modules/admin/what-config_doubler.php
new file mode 100644 (file)
index 0000000..42bbc12
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2005 *
+ * ================                             Last change: 02/12/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_doubler.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Points doubler                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punkte verdoppeln                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Replace commata with decimal dot
+       $_POST['doubler_charge'] = str_replace(",", ".", ($_POST['doubler_charge'] / 100));
+       $_POST['doubler_ref']    = str_replace(",", ".", ($_POST['doubler_ref'] / 100));
+       $_POST['doubler_min']    = str_replace(",", ".", $_POST['doubler_min']);
+       $_POST['doubler_max']    = str_replace(",", ".", $_POST['doubler_max']);
+       $_POST['doubler_left']   = str_replace(",", ".", $_POST['doubler_left']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data for the template
+       // - Charge rate
+       define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false));
+       // - Referral rate
+       define('__DOUBLER_REFERRAL', TRANSLATE_COMMA(($_CONFIG['doubler_ref'] * 100), false));
+       // - Minimum points to double
+       define('__DOUBLER_MINIMUM', TRANSLATE_COMMA($_CONFIG['doubler_min'], false));
+       // - Maximum points to double
+       define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA($_CONFIG['doubler_max'], false));
+       // - Points left on users account after doubling
+       define('__DOUBLER_LEFT', TRANSLATE_COMMA($_CONFIG['doubler_left'], false));
+       // - Max payouts to check per click/reset
+       define('__DOUBLER_MAX_SENT', $_CONFIG['doubler_max_sent']);
+       // - Group sending
+       define('__DOUBLER_GROUP_SENT', $_CONFIG['doubler_group_sent']);
+
+       // Take points from jackpot (Y/N)
+       switch ($_CONFIG['doubler_jackpot'])
+       {
+       case 'Y':
+               define('__DOUBLER_JACKPOT_Y', " checked=\"checked\"");
+               define('__DOUBLER_JACKPOT_N', "");
+               break;
+
+       case 'N':
+               define('__DOUBLER_JACKPOT_Y', "");
+               define('__DOUBLER_JACKPOT_N', " checked=\"checked\"");
+               break;
+       }
+
+       // Take points from own account (Y/N)
+       switch ($_CONFIG['doubler_own'])
+       {
+       case 'Y':
+               define('__DOUBLER_OWN_Y', " checked=\"checked\"");
+               define('__DOUBLER_OWN_N', "");
+               break;
+
+       case 'N':
+               define('__DOUBLER_OWN_Y', "");
+               define('__DOUBLER_OWN_N', " checked=\"checked\"");
+               break;
+       }
+
+       // Mail send mode
+       switch ($_CONFIG['doubler_send_mode'])
+       {
+       case "DIRECT":
+               define('__DOUBLER_SEND_DIRECT', " checked=\"checked\"");
+               define('__DOUBLER_SEND_RESET' , "");
+               break;
+
+       case "RESET":
+               define('__DOUBLER_SEND_DIRECT', "");
+               define('__DOUBLER_SEND_RESET' , " checked=\"checked\"");
+               break;
+       }
+
+       // Take points from own account (Y/N)
+       switch ($_CONFIG['doubler_sent_all'])
+       {
+       case 'Y':
+               define('__DOUBLER_SENT_ALL_Y', " checked=\"checked\"");
+               define('__DOUBLER_SENT_ALL_N', "");
+               break;
+
+       case 'N':
+               define('__DOUBLER_SENT_ALL_Y', "");
+               define('__DOUBLER_SENT_ALL_N', " checked=\"checked\"");
+               break;
+       }
+
+       // Transfer options (!!!) to __MEMBER_SELECTION
+       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true, "doubler_uid"));
+
+       // Number of rows to display (option lines!!!)
+       define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new']));
+       define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_pay']));
+       define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_old']));
+
+       // Timeout selection box or input box?
+       define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['doubler_timeout']  , "doubler_timeout"  , "WDh"));
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_doubler");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_email.php b/inc/modules/admin/what-config_email.php
new file mode 100644 (file)
index 0000000..c41ae6c
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2003 *
+ * ===============                              Last change: 07/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_emails.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit all things around email and sending         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Aendern aller Email-Einstellungen                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Remove empty array index
+if (empty($_POST['max'])) unset($_POST['add_max']);
+
+if (isset($_POST['add_max'])) {
+       // Save all settings
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_max_receive WHERE value='%s' LIMIT 1",
+        array(bigintval($_POST['max'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Add this value (including comment)
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_max_receive (value, comment) VALUES ('%s','%s')",
+                array(bigintval($_POST['max']), $_POST['comment']),__FILE__, __LINE__);
+               $content = "<SPAN class=\"admin_done\">".MAX_VALUE_SAVED."</SPAN>";
+       } else {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Value does alread exists!
+               $content = "<SPAN class=\"admin_failed\">".MAX_VALUE_ALREADY."</SPAN>";
+       }
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+} elseif ((isset($_POST['ok'])) && (isset($_GET['do']))) {
+       // Change or delete entries...
+       $TEXT = "";
+       foreach ($_POST['id'] as $id => $value) {
+               // Secure ID
+               $id = bigintval($id);
+
+               switch ($_GET['do'])
+               {
+               case "edit": // Change entries
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_max_receive SET value='%s', comment='%s' WHERE id=%s LIMIT 1",
+                        array(bigintval($_POST['val'][$id]), $_POST['comm'][$id], $id),__FILE__, __LINE__);
+                       $TEXT = MRECEIVE_SAVED;
+                       break;
+
+               case "del":
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE id=%s LIMIT 1",
+                        array($id), __FILE__, __LINE__);
+                       $TEXT = MRECEIVE_DELETED;
+                       break;
+               }
+       }
+
+       if (isset($TEXT)) {
+               // Display message
+               LOAD_TEMPLATE("admin_settings_saved", false, $TEXT);
+       }
+} elseif ((isset($_POST['del'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
+       // Delete entries
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value)
+       {
+               // Load data
+               $result = SQL_QUERY_ESC("SELECT value, comment FROM "._MYSQL_PREFIX."_max_receive WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($value, $comment) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'      => $SW,
+                       'id'      => $id,
+                       'value'   => $value,
+                       'comment' => $comment,
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_config_email_del_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_email_del");
+} elseif ((isset($_POST['edit'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
+       // Edit entries
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value) {
+               // Load data
+               $result = SQL_QUERY_ESC("SELECT value, comment FROM "._MYSQL_PREFIX."_max_receive WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($value, $comment) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'      => $SW,
+                       'id'      => $id,
+                       'value'   => $value,
+                       'comment' => $comment,
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_config_email_edit_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_email_edit");
+} else {
+       $result = SQL_QUERY("SELECT id, value, comment FROM "._MYSQL_PREFIX."_max_receive ORDER BY value", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0) {
+               // List already existing entries for editing
+               $SW = 2; $OUT = "";
+               while (list($id, $value, $comment) = SQL_FETCHROW($result)) {
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'      => $SW,
+                               'id'      => $id,
+                               'value'   => $value,
+                               'comment' => $comment,
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_config_email_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_config_email");
+       }
+
+       // Display form
+       LOAD_TEMPLATE("admin_add_max");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_extensions.php b/inc/modules/admin/what-config_extensions.php
new file mode 100644 (file)
index 0000000..4c09b2b
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/12/2004 *
+ * ================                             Last change: 09/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_extensions.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for the extension system           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration des Erweiterungs-Management        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save configuration
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data
+       switch ($_CONFIG['verbose_sql']) {
+               case 'Y':
+                       define('__VERBOSE_Y', " checked=\"checked\"");
+                       define('__VERBOSE_N', "");
+                       break;
+
+               case 'N':
+                       define('__VERBOSE_Y', "");
+                       define('__VERBOSE_N', " checked=\"checked\"");
+                       break;
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_extensions");
+
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_holiday.php b/inc/modules/admin/what-config_holiday.php
new file mode 100644 (file)
index 0000000..ffb4949
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 11/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_holiday.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellungen                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Prepare constants for the template
+       define('__MAX_VALUE', $_CONFIG['holiday_max']);
+       define('__LOCKED'   , CREATE_TIME_SELECTIONS($_CONFIG['holiday_lock']  , "holiday_lock"  , "WDh"));
+
+       switch ($_CONFIG['holiday_mode']) {
+       case "RESET":
+               define('__RESET_DEFAULT' , " checked=\"checked\"");
+               define('__DIRECT_DEFAULT', "");
+               break;
+
+       case "DIRECT":
+               define('__RESET_DEFAULT' , "");
+               define('__DIRECT_DEFAULT', " checked=\"checked\"");
+               break;
+       }
+
+       // Load form template
+       LOAD_TEMPLATE("admin_config_holiday");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php
new file mode 100644 (file)
index 0000000..e4b640b
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/22/2004 *
+ * ================                             Last change: 09/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_home.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Set "home" page                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : "Home"-Seite festlegen                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$sub = "";
+if (!empty($_GET['sub'])) $sub = $_GET['sub'];
+
+switch ($sub)
+{
+case "": // Output selection table
+       LOAD_TEMPLATE("admin_config_home_main");
+       break;
+
+case "settings": // Settings related to the index page
+       if (isset($_POST['ok']))
+       {
+               // Save settings
+               ADMIN_SAVE_SETTINGS($_POST);
+               OUTPUT_HTML("<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</A>");
+       }
+        else
+       {
+               // Prepare data for the template
+               $content = array_fill(-1, 60, "");
+               $content[$_CONFIG['index_delay']] = " selected=\"selected\"";
+
+               define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['index_cookie'], "index_cookie", "YMWD"));
+               LOAD_TEMPLATE("admin_config_home_settings", false, $content);
+       }
+       break;
+
+case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)
+       if (isset($_GET['home'])) {
+               // Set new home
+               UPDATE_CONFIG("index_home", $_GET['home']);
+               $_CONFIG['index_home'] = SQL_ESCAPE($_GET['home']);
+       } // END - if
+
+       // Load all what menu points
+       $result = SQL_QUERY("SELECT id, what, title
+FROM "._MYSQL_PREFIX."_guest_menu
+WHERE action='main' AND what != '' AND what IS NOT NULL AND locked='N'
+ORDER BY sort ASC", __FILE__, __LINE__);
+
+       $SW = 2; $OUT = ""; $atitle = "";
+       while (list($id, $wht, $wtitle) = SQL_FETCHROW($result))
+       {
+               $LINK = "<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=target&amp;home=".$wht."\">"._IS_NEW_HOME."</A>";
+               if ($wht == $_CONFIG['index_home'])
+               {
+                       // Is current home
+                       $LINK   = "<STRONG class=\"admin_note\">"._IS_CURRENT_HOME."</STRONG>";
+                       $atitle = "<STRONG class=\"admin_note\">".$atitle."</STRONG>";
+                       $wtitle = "<STRONG class=\"admin_note\">".$wtitle."</STRONG>";
+               }
+
+               // Add row...
+               $OUT .= "<TR>
+         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$id."</TD>
+         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$wtitle."</TD>
+         <TD class=\"switch_sw".$SW." bottom\" align=\"center\">
+           ".$LINK."
+         </TD>
+       </TR>\n";
+
+               // Switch color
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__HOME_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_home");
+       break;
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_mediadata.php b/inc/modules/admin/what-config_mediadata.php
new file mode 100644 (file)
index 0000000..5af3aa5
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Test timestamp
+       $STAMP = mktime(0, 0, 0, bigintval($_POST['month']), bigintval($_POST['day']), bigintval($_POST['year']));
+       if ($STAMP > time())
+       {
+               // Date is in the future!
+               unset($_POST['ok']);
+       }
+        else
+       {
+               // Remove entries
+               unset($_POST['day']);
+               unset($_POST['month']);
+               unset($_POST['year']);
+
+               // Remember timestamp
+               $_POST['mt_start'] = $STAMP;
+       }
+
+       // Convert some data
+       $_POST['mt_stage'] = bigintval($_POST['mt_stage']);
+       if ($_POST['mt_stage'] <= GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true))
+       {
+               // Not enougth!
+               unset($_POST['ok']);
+       }
+}
+
+if (isset($_POST['ok']))
+{
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Start of this exchange
+       if ($_CONFIG['mt_start'] > 0)
+       {
+               // Only show start
+               define('__MT_START', "<STRONG>".MAKE_DATETIME($_CONFIG['mt_start'], "3")."</STRONG>");
+       }
+        else
+       {
+               // Make start editable
+               define('__MT_START',
+                       ADD_SELECTION("day"  , date("d", time())).
+                       ADD_SELECTION("month", date("m", time())).
+                       ADD_SELECTION("year",  -1)
+               );
+       }
+
+       // Next stage of this MT
+       define('__MT_STAGE', $_CONFIG['mt_stage']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_mediadata");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php
new file mode 100644 (file)
index 0000000..9bc4c99
--- /dev/null
@@ -0,0 +1,162 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2004 *
+ * ================                             Last change: 08/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_mods.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Module configuration                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Modul-Konfiguration                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$SEL = 0;
+if (isset($_POST['edit']))
+{
+       // Check if at least one module is selected
+       $SEL = SELECTION_COUNT($_POST['sel']);
+       if ($SEL > 0)
+       {
+               // Output header
+               $OUT = ""; $SW = 2;
+
+               // Edit selected modules
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Load module data
+                       $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM "._MYSQL_PREFIX."_mod_reg WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       list($mod, $title, $locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare array for the template
+                       $content = array(
+                               'sw'     => $SW,
+                               'mod'    => $mod,
+                               'id'     => $id,
+                               'title'  => $title,
+                               'locked' => ADD_SELECTION("yn", $locked, "locked", $id),
+                               'hidden' => ADD_SELECTION("yn", $hidden, "hidden", $id),
+                               'admin'  => ADD_SELECTION("yn", $admin , "admin" , $id),
+                               'mem'    => ADD_SELECTION("yn", $mem   , "member", $id),
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("admin_mods_edit_row", true, $content);
+               }
+               define('__MODS_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_mods_edit");
+       }
+        else
+       {
+               // Nothing selected
+               LOAD_TEMPLATE("admin_settings_saved", false, MODS_NOTHING_SELECTED);
+               OUTPUT_HTML("<br />");
+
+               // Remove maybe confusing data
+               unset($_POST['edit']);
+               unset($_POST['change']);
+       }
+}
+ elseif (isset($_POST['change']))
+{
+       // Change modules
+       foreach ($_POST['sel'] as $id => $sel)
+       {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // Update module
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_mod_reg SET title='%s', locked='%s', hidden='%s', admin_only='%s', mem_only='%s' WHERE id=%s LIMIT 1",
+                array($_POST['title'][$id], $_POST['locked'][$id], $_POST['hidden'][$id], $_POST['admin'][$id], $_POST['member'][$id], $id),  __FILE__, __LINE__);
+       }
+
+       // Remove cache file if version matches
+       if (GET_EXT_VERSION("cache") >= "0.1.2")
+       {
+               if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
+       }
+
+       // Entries updated
+       LOAD_TEMPLATE("admin_settings_saved", false, MODS_CHANGED);
+       OUTPUT_HTML("<br />");
+}
+
+if ($SEL == 0)
+{
+       // Load module data (We do not need to check if there's at least one...)
+       $result = SQL_QUERY("SELECT id, module, locked, hidden, admin_only, title, mem_only, clicks
+FROM "._MYSQL_PREFIX."_mod_reg
+ORDER BY module", __FILE__, __LINE__);
+       $OUT = ""; $SW = 2;
+       while (list($id, $mod, $locked, $hidden, $admin, $title, $mem) = SQL_FETCHROW($result))
+       {
+               // Reset title to --- if it is NULL
+               if (empty($title)) $title = "---";
+               if (($mod == "index") || ($mod == "login"))
+               {
+                       // Add link to detail statistics
+                       $mod = "<STRONG><A href=\"".URL."/modules.php?module=admin&amp;what=stats_mods&amp;mod=".$mod."\">".$mod."</A></STRONG>";
+               }
+
+               // Prepare array for the template
+               $content = array(
+                       'sw'     => $SW,
+                       'id'     => $id,
+                       'mod'    => $mod,
+                       'title'  => $title,
+                       'locked' => TRANSLATE_YESNO($locked),
+                       'hidden' => TRANSLATE_YESNO($hidden),
+                       'admin'  => TRANSLATE_YESNO($admin),
+                       'mem'    => TRANSLATE_YESNO($mem),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_mods_list_row", true, $content);
+
+               // Switch colors
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__MODS_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_mods_list");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_newsletter.php b/inc/modules/admin/what-config_newsletter.php
new file mode 100644 (file)
index 0000000..c7dc393
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/03/2005 *
+ * ================                             Last change: 03/03/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_newsletter.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure the newsletter                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellen der Turbo-Klick-Verguetungen          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Save data
+       $_POST['nl_charge'] = str_replace(",", ".", $_POST['nl_charge']);
+
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Prepare contants for the template
+       define('__CHARGE_VALUE'  , TRANSLATE_COMMA($_CONFIG['nl_charge'], false));
+
+       // Prepare constants and load template
+       LOAD_TEMPLATE("admin_config_newsletter", false);
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_nickname.php b/inc/modules/admin/what-config_nickname.php
new file mode 100644 (file)
index 0000000..b08d423
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/22/2004 *
+ * ================                             Last change: 12/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_nickname.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Nickname configuration                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration des Nicknamens                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Load template
+       LOAD_TEMPLATE("admin_config_nickname");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php
new file mode 100644 (file)
index 0000000..e048a10
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/22/2004 *
+ * ================                             Last change: 09/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_order.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for order page                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration der Mailbuchungsseite              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare constants for the template
+       switch ($_CONFIG['order_max_full'])
+       {
+       case "ORDER":
+               define('__ORDER_DEFAULT', " checked=\"checked\"");
+               define('__MAX_DEFAULT'  , "");
+               break;
+
+       case "MAX":
+               define('__ORDER_DEFAULT', "");
+               define('__MAX_DEFAULT'  , " checked=\"checked\"");
+               break;
+       }
+
+       // Minimum mails / order
+       define('__MIN_VALUE', $_CONFIG['order_min']);
+
+       // Sorting mode (ascending / descending)
+       switch ($_CONFIG['order_mode'])
+       {
+       case "ASC":
+               define('__ASC_DEFAULT' , " selected=\"selected\"");
+               define('__DESC_DEFAULT', "");
+               break;
+
+       case "DESC":
+               define('__ASC_DEFAULT' , "");
+               define('__DESC_DEFAULT', " selected=\"selected\"");
+               break;
+       }
+
+       // Transfer other config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
+       define('_CFG_UNCONFIRMED'   , $_CONFIG['unconfirmed']);
+       define('_CFG_MAX_TLENGTH'   , $_CONFIG['max_tlength']);
+
+       if ($_CONFIG['test_text'] == "N") {
+               define('_CFG_TEST_TEXT_N', " checked=\"checked\"");
+               define('_CFG_TEST_TEXT_Y', "");
+       } else {
+               define('_CFG_TEST_TEXT_N', "");
+               define('_CFG_TEST_TEXT_Y', " checked=\"checked\"");
+       }
+
+       switch ($_CONFIG['repay_deleted_mails']) {
+               case "REPAY":
+                       define('_CFG_REPAY_POINTS_REPAY'  , " selected=\"selected\"");
+                       define('_CFG_REPAY_POINTS_JACKPOT', "");
+                       define('_CFG_REPAY_POINTS_SHRED'  , "");
+                       break;
+
+               case "JACKPOT":
+                       define('_CFG_REPAY_POINTS_REPAY'  , "");
+                       define('_CFG_REPAY_POINTS_JACKPOT', " selected=\"selected\"");
+                       define('_CFG_REPAY_POINTS_SHRED'  , "");
+                       break;
+
+               case "SHRED":
+                       define('_CFG_REPAY_POINTS_REPAY'  , "");
+                       define('_CFG_REPAY_POINTS_JACKPOT', "");
+                       define('_CFG_REPAY_POINTS_SHRED'  , " selected=\"selected\"");
+                       break;
+       }
+
+       if ($_CONFIG['test_subj'] == "N") {
+               define('_CFG_TEST_SUBJ_N', " checked=\"checked\"");
+               define('_CFG_TEST_SUBJ_Y', "");
+       } else {
+               define('_CFG_TEST_SUBJ_N', "");
+               define('_CFG_TEST_SUBJ_Y', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['url_blacklist'] == "N") {
+               define('_CFG_URL_BLIST_N', " checked=\"checked\"");
+               define('_CFG_URL_BLIST_Y', "");
+       } else {
+               define('_CFG_URL_BLIST_N', "");
+               define('_CFG_URL_BLIST_Y', " checked=\"checked\"");
+       }
+
+       // Selection list
+       define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST($_CONFIG['order_select']));
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_order");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php
new file mode 100644 (file)
index 0000000..c356122
--- /dev/null
@@ -0,0 +1,191 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2003 *
+ * ===============                              Last change: 09/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_other.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : basic settings                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Grund Einstellungen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("other")) || (GET_EXT_VERSION("other") == "")) {
+       // Missing extension!
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "other"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Stop saving data if one input field is !isset
+if (isset($_POST['ok'])) {
+       if (function_exists('CREATE_TIME_SELECTIONS')) {
+               // Calculate stamps and set calculated stamps
+               $_POST['online_timeout']        = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout"           , $_POST);
+               $_POST['url_tlock']             = CREATE_TIMESTAMP_FROM_SELECTIONS("url_tlock"            , $_POST);
+               $_POST['profile_lock']          = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_lock"         , $_POST);
+               $_POST['profile_update']        = CREATE_TIMESTAMP_FROM_SELECTIONS("profile_update"       , $_POST);
+               $_POST['resend_profile_update'] = CREATE_TIMESTAMP_FROM_SELECTIONS("resend_profile_update", $_POST);
+       }
+
+       // Online-Timeout shall be > 0 or your database will crow and crow and crow...
+       if (!isset($_POST['online_timeout']))        { unset($_POST['ok']); }
+
+       // Chedck other timestamps (which can be zero!)
+       if (!isset($_POST['profile_lock']))          { unset($_POST['ok']); }
+       if (!isset($_POST['url_tlock']))             { unset($_POST['ok']); }
+       if (!isset($_POST['profile_update']))        { unset($_POST['ok']); }
+       if (!isset($_POST['resend_profile_update'])) { unset($_POST['ok']); }
+
+       // Check other settings
+       if (!isset($_POST['max_send']))              { unset($_POST['ok']); }
+       if (!isset($_POST['code_length']))           { unset($_POST['ok']); }
+       if (!isset($_POST['reject_url']))            { unset($_POST['ok']); }
+}
+
+if (isset($_POST['ok'])) {
+       // Update stamps directly
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Transfer config data into constants for the template (DO NOT set $_CONFIG as global in LOAD_TEMPLATE!!!)
+       define('_CFG_CODE_LENGTH'   , $_CONFIG['code_length']);
+       define('_CFG_ACT_SYSTEM'    , $_CONFIG['activate_xchange']);
+       define('_CFG_MAX_SEND'      , $_CONFIG['max_send']);
+       define('_CFG_REJECT_URL'    , $_CONFIG['reject_url']);
+
+       // Is there the pro-version function avaiable to create selection boxes instead of input boxes?
+       if (function_exists('CREATE_TIME_SELECTIONS')) {
+               // Only pro versions: time selection boxes
+               define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS($_CONFIG['online_timeout'], "ip_timeout"           , "ms"));
+               define('_CFG_URL_TLOCK'     , CREATE_TIME_SELECTIONS($_CONFIG['url_tlock']     , "url_tlock"            , "WDh"));
+               define('_CFG_PROFILE_LOCK'  , CREATE_TIME_SELECTIONS($_CONFIG['profile_lock']  , "profile_lock"         , "WDh"));
+               define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS($_CONFIG['profile_update'], "profile_update"       , "YM"));
+               define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS($_CONFIG['resend_profile_update'] , "resend_profile_update", "MWD"));
+       } else {
+               // Normal input boxes
+               define('_CFG_ONLINE_TIMEOUT', "<INPUT type=\"text\" name=\"online_timeout\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['online_timeout']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_URL_TLOCK'     , "<INPUT type=\"text\" name=\"url_tlock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['url_tlock']     ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROFILE_LOCK'  , "<INPUT type=\"text\" name=\"profile_lock\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['profile_lock']  ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROFILE_UPDATE', "<INPUT type=\"text\" name=\"profile_update\" class=\"admin_normal\" size=\"10\" maxlength=\"255\" value=\"".$_CONFIG['profile_update']."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+               define('_CFG_PROF_REUPDATE' , "<INPUT type=\"text\" name=\"resend_profile_update\" class=\"admin_normal\" size=\"6\"  maxlength=\"255\" value=\"".$_CONFIG['resend_profile_update'] ."\"> <FONT class=\"tiny\">("._SECONDS.")</FONT>");
+       }
+
+       if ($_CONFIG['order_multi_page'] == "N") {
+               define('_CFG_ORDER_MULTI_N', " checked=\"checked\"");
+               define('_CFG_ORDER_MULTI_Y', "");
+       } else {
+               define('_CFG_ORDER_MULTI_N', "");
+               define('_CFG_ORDER_MULTI_Y', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['autosend_active'] == "N") {
+               define('_CFG_AUTOSEND_ACTIVE_N', " checked=\"checked\"");
+               define('_CFG_AUTOSEND_ACTIVE_Y', "");
+       } else {
+               define('_CFG_AUTOSEND_ACTIVE_N', "");
+               define('_CFG_AUTOSEND_ACTIVE_Y', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['send_prof_update'] == "N") {
+               define('_CFG_SEND_UPDATE_N', " checked=\"checked\"");
+               define('_CFG_SEND_UPDATE_Y', "");
+       } else {
+               define('_CFG_SEND_UPDATE_N', "");
+               define('_CFG_SEND_UPDATE_Y', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['admin_notify'] == "N") {
+               define('_CFG_ADMIN_NOTIFY_N', " checked=\"checked\"");
+               define('_CFG_ADMIN_NOTIFY_Y', "");
+       } else {
+               define('_CFG_ADMIN_NOTIFY_N', "");
+               define('_CFG_ADMIN_NOTIFY_Y', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['css_php'] == "DIRECT") {
+               define('_CFG_CSS_PHP_DIRECT', " checked=\"checked\"");
+               define('_CFG_CSS_PHP_FILE', "");
+       } else {
+               define('_CFG_CSS_PHP_DIRECT', "");
+               define('_CFG_CSS_PHP_FILE', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['guest_menu'] == "Y") {
+               define('_CFG_GUEST_MENU_ACTIVE', " checked=\"checked\"");
+               define('_CFG_GUEST_MENU_INACTIVE', "");
+       } else {
+               define('_CFG_GUEST_MENU_ACTIVE', "");
+               define('_CFG_GUEST_MENU_INACTIVE', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['member_menu'] == "Y") {
+               define('_CFG_MEMBER_MENU_ACTIVE', " checked=\"checked\"");
+               define('_CFG_MEMBER_MENU_INACTIVE', "");
+       } else {
+               define('_CFG_MEMBER_MENU_ACTIVE', "");
+               define('_CFG_MEMBER_MENU_INACTIVE', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['youre_here'] == "Y") {
+               define('_CFG_YOURE_HERE_ACTIVE', " checked=\"checked\"");
+               define('_CFG_YOURE_HERE_INACTIVE', "");
+       } else {
+               define('_CFG_YOURE_HERE_ACTIVE', "");
+               define('_CFG_YOURE_HERE_INACTIVE', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['show_timings'] == "Y") {
+               define('_CFG_SHOW_TIMINGS_Y', " checked=\"checked\"");
+               define('_CFG_SHOW_TIMINGS_N', "");
+       } else {
+               define('_CFG_SHOW_TIMINGS_Y', "");
+               define('_CFG_SHOW_TIMINGS_N', " checked=\"checked\"");
+       }
+
+       if ($_CONFIG['mailid_error_redirect'] == 'INDEX') {
+               define('_CFG_MAILID_REDIRECT_INDEX', " checked=\"checked\"");
+               define('_CFG_MAILID_REDIRECT_REJECT', "");
+       } else {
+               define('_CFG_MAILID_REDIRECT_INDEX', "");
+               define('_CFG_MAILID_REDIRECT_REJECT', " checked=\"checked\"");
+       }
+
+       for ($i = 0; $i <= 5; $i++) {
+               $eval = "define('_COMMA_DEF_".$i."', \"\");";
+               if ($_CONFIG['max_comma'] == $i) $eval = "define('_COMMA_DEF_".$i."', \" selected\");";
+               eval($eval);
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_other");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_payouts.php b/inc/modules/admin/what-config_payouts.php
new file mode 100644 (file)
index 0000000..58e0447
--- /dev/null
@@ -0,0 +1,249 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/11/2004 *
+ * ================                             Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_payouts.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure payout types                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungensarten editieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_POST['rate'])) $_POST['rate'] = str_replace(",", ".", $_POST['rate']);
+
+if ((isset($_POST['add'])) && (!empty($_POST['title'])) && ($_POST['rate'] > 0))
+{
+       // Add new payout type
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_payout_types WHERE type='%s' LIMIT 1",
+        array($_POST['title']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Add now
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_payout_types
+(type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url)
+VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')",
+ array(
+       $_POST['title'],
+       bigintval($_POST['rate']),
+       bigintval($_POST['mpoi']),
+       $_POST['yacc'],
+       $_POST['ypass'],
+       $_POST['yurl'],
+       $_POST['yrdone'],
+       $_POST['yrfailed'],
+       $_POST['ytrans'],
+       $_POST['allow_url'],
+), __FILE__, __LINE__);
+               $msg = "<FONT class=\"admin_done\">".ADMIN_PAYOUT_TYPE_ADDED."</FONT>";
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Does already exist
+               $msg = "<FONT class=\"admin_failed\">".ADMIN_PAYOUT_TYPE_ALREADY."</FONT>";
+       }
+}
+
+// Payout requests by your members
+$result_mem = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_user_payouts WHERE status='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
+
+$display = true;
+if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0))
+{
+       // Edit payout types
+       if ((isset($_GET['ok'])) && ($_GET['ok'] == "ok"))
+       {
+               // Edit entries
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Secure ID
+                       $id = bigintval($id);
+
+                       // Edit only if something is entered
+                       if ((!empty($_POST['title'][$id])) && ($_POST['rate'][$id] > 0))
+                       {
+                               // Update entry
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_payout_types SET
+type='%s',
+rate=%s,
+min_points=%s,
+allow_url='%s'
+WHERE id='".$id."' LIMIT 1",
+ array(
+       $_POST['title'][$id],
+       bigintval(str_replace(",", ".", $_POST['rate'][$id])),
+       bigintval(str_replace(",", ".", $_POST['mpoi'][$id])),
+       $_POST['allow'][$id],
+),__FILE__, __LINE__);
+                       }
+               }
+               $msg = ADMIN_PAYOUT_ENTRIES_CHANGED;
+       }
+        else
+       {
+               $display = false; //Suppress any other outputs
+               $SW = 2; $OUT = "";
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Load data
+                       $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       list($title, $rate, $mpoi, $allow) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'    => $SW,
+                               'id'    => $id,
+                               'title' => COMPILE_CODE($title),
+                               'rate'  => TRANSLATE_COMMA($rate),
+                               'mpoi'  => TRANSLATE_COMMA($mpoi),
+                               'allow' => ADD_SELECTION("yn", $allow, "allow[".$id."]"),
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_config_payouts_edit_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               define('__PAYOUT_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_config_payouts_edit");
+       }
+}
+ elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0))
+{
+       // Delete payout types
+       if ($_GET['ok'] == "ok")
+       {
+               // Delete entries
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+               }
+               $msg = ADMIN_PAYOUT_ENTRIES_DELETED;
+       }
+        else
+       {
+               $display = false; //Suppress any other outputs
+               $SW = 2; $OUT = "";
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Secure ID number
+                       $id = bigintval($id);
+
+                       // Load data
+                       $result = SQL_QUERY_ESC("SELECT type, rate, min_points FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
+                        array($id), __FILE__, __LINE__);
+                       list($title, $rate, $mpoi) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'    => $SW,
+                               'id'    => $id,
+                               'title' => COMPILE_CODE($title),
+                               'rate'  => TRANSLATE_COMMA($rate),
+                               'mpoi'  => TRANSLATE_COMMA($mpoi),
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_config_payouts_del_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               define('__PAYOUT_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_config_payouts_del");
+       }
+}
+
+if (!empty($msg))
+{
+       // Output message
+       LOAD_TEMPLATE("admin_settings_saved", false, $msg);
+}
+
+// Payout types
+$result_type = SQL_QUERY("SELECT id, type, rate, min_points, from_account FROM "._MYSQL_PREFIX."_payout_types ORDER BY type", __FILE__, __LINE__);
+
+if ((SQL_NUMROWS($result_type) > 0) && ($display))
+{
+       // List all payout types
+       $SW = 2; $OUT = "";
+       while (list($id, $type, $rate, $mpoi, $from) = SQL_FETCHROW($result_type))
+       {
+               // Prepare data for the row template
+               $content = array(
+                       'sw'    => $SW,
+                       'id'    => $id,
+                       'from'  => COMPILE_CODE($from),
+                       'type'  => COMPILE_CODE($type),
+                       'rate'  => TRANSLATE_COMMA($rate),
+                       'mpoi'  => TRANSLATE_COMMA($mpoi),
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_config_payouts_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_type);
+       define('__PAYOUT_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_payouts");
+}
+
+// Does your members request payouts?
+if ((SQL_NUMROWS($result_mem) > 0) && ($display))
+{
+       // Members has requested payouts
+       SQL_FREERESULT($result_mem);
+       OUTPUT_HTML("<P><A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts\">".ADMIN_PAYOUT_LIST_REQUESTS."</A></P>");
+}
+ elseif ($display)
+{
+       // No member requests so far
+       OUTPUT_HTML("<P><STRONG>".ADMIN_PAYOUT_NO_MEMBER_REQUESTS."</STRONG></P>");
+}
+// Add new paypout type
+if ($display) LOAD_TEMPLATE("admin_payout_add_new");
+
+//
+?>
diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php
new file mode 100644 (file)
index 0000000..d5a7b23
--- /dev/null
@@ -0,0 +1,310 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/12/2003 *
+ * ===============                              Last change: 12/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_points.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup welcome-points for registration etc.       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellen der Willkommensgutschrift usw.        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['sub'])) {
+       switch ($_GET['sub'])
+       {
+       case "points":
+               if ((empty($_POST['points_register'])) || (empty($_POST['points_ref']))) {
+                       unset($_POST['ok']);
+               }
+               break;
+
+       case "ref":
+               if (isset($_GET['do'])) {
+                       if (((empty($_POST['lvl'])) || (empty($_POST['perc']))) && ($_GET['do'] == "add")) {
+                               unset($_POST['ok']);
+                       }
+               }
+               break;
+       }
+} else {
+       // Display overview
+       $_GET['sub'] = "overview";
+}
+
+if (isset($_POST['ok'])) {
+       $SQL = array();
+       switch ($_GET['sub'])
+       {
+       case "points":
+               $SQL[] = "UPDATE "._MYSQL_PREFIX."_config SET points_register='".$_POST['points_register']."', points_ref='".$_POST['points_ref']."' WHERE config=0 LIMIT 1";
+               break;
+
+       case "ref":
+               switch ($_GET['do'])
+               {
+               case "add":
+                       $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_refdepths (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')";
+                       break;
+
+               case "edit": // Change entries
+                       foreach ($_POST['lvl'] as $id => $value) {
+                               // Secure ID
+                               $id = bigintval($id);
+
+                               // Revert german commata
+                               $_POST['perc'][$id] = REVERT_COMMA($_POST['perc'][$id]);
+
+                               // Update entry
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
+                                array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__);
+                       }
+                       $TEXT = REF_DEPTHS_SAVED;
+                       break;
+
+               case "del":
+                       foreach ($_POST['id'] as $id => $value) {
+                               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1",
+                                array(bigintval($id)), __FILE__, __LINE__);
+                       }
+                       $TEXT = REF_DEPTHS_DELETED;
+                       break;
+               }
+
+               // Update cache file
+               if (GET_EXT_VERSION("cache") >= "0.1.2") {
+                       if ($cacheInstance->cache_file("refdepths", true)) $cacheInstance->cache_destroy();
+               }
+               break;
+
+       case "settings":
+               $REF = bigintval($_POST['ref_payout']);
+               $SQL[] = sprintf("UPDATE "._MYSQL_PREFIX."_config SET
+allow_direct_pay='%s',
+reg_points_mode='%s',
+ref_payout='%s'
+WHERE config=0 LIMIT 1",
+ $_POST['allow_direct_pay'],
+ $_POST['reg_points_mode'],
+ $REF
+               );
+               if (($_CONFIG['ref_payout'] == 0) && ($_POST['ref_payout'] > 0))
+               {
+                       // Update account's ref_payout for "must-confirm"
+                       $SQL[] = sprintf("UPDATE "._MYSQL_PREFIX."_user_data SET ref_payout=(%s - mails_confirmed)
+WHERE mails_confirmed < %s", $REF, $REF);
+               }
+                elseif (($_CONFIG['ref_payout'] > 0) && ($_POST['ref_payout'] == 0))
+               {
+                       // Update account's ref_payout for "not-must-confirm"
+                       $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_data SET ref_payout=0 WHERE ref_payout > 0";
+                       $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_points SET points=points+locked_points WHERE locked_points>0";
+                       $SQL[] = "UPDATE "._MYSQL_PREFIX."_user_points SET locked_points=0 WHERE locked_points>0";
+               }
+               break;
+       }
+       if ((isset($SQL)) && (is_array($SQL)) && (!empty($SQL[0])))
+       {
+               if (strpos($SQL[0], "INSERT") > -1)
+               {
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
+                        array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
+                       SQL_FREERESULT($result);
+               }
+               if (count($SQL) > 0)
+               {
+                       // Run all SQL commands
+                       foreach ($SQL as $s)
+                       {
+                               $result = SQL_QUERY($s, __FILE__, __LINE__);
+                       }
+
+                       $content = "<SPAN class=\"admin_done\">".SETTINGS_SAVED."</SPAN>";
+
+                       // Destroy config cache file here...
+                       REBUILD_CACHE("config", "config");
+               }
+                else
+               {
+                       $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+               }
+               unset($SQL);
+               LOAD_TEMPLATE("admin_settings_saved", false, $content);
+       }
+        elseif (isset($TEXT))
+       {
+               LOAD_TEMPLATE("admin_settings_saved", false, $TEXT);
+       }
+}
+ elseif ($_GET['sub'] == "settings")
+{
+       // Setup some settings like direct pay and so on
+       // Including new add-mode for one-time referral bonus
+       switch ($_CONFIG['allow_direct_pay'])
+       {
+       case 'Y':
+               define('__DIRECT_Y', " checked=\"checked\"");
+               define('__DIRECT_N', "");
+               break;
+
+       case 'N':
+               define('__DIRECT_Y', "");
+               define('__DIRECT_N', " checked=\"checked\"");
+               break;
+       }
+
+       // One-time referral bonus add-mode
+       switch ($_CONFIG['reg_points_mode'])
+       {
+               case "ref"   : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', "");         break;
+               case "direct": define('__MODE_REF', "");         define('__MODE_DIRECT', " checked=\"checked\""); break;
+       }
+
+       // Referral payout value
+       define('__REF_PAYOUT', round($_CONFIG['ref_payout']));
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_point_settings");
+}
+ elseif ($_GET['sub'] == "ref")
+{
+        if ((isset($_POST['del'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0]))))
+       {
+               // Delete entries
+               $SW = 2; $OUT = "";
+               foreach ($_POST['sel'] as $id => $value)
+               {
+                       $result = SQL_QUERY_ESC("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       list($lvl, $perc) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'  => $SW,
+                               'id'  => $id,
+                               'lvl' => $lvl,
+                               'per' => TRANSLATE_COMMA($perc),
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_points_del_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               define('__LEVEL_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_points_del");
+       }
+        elseif ((isset($_POST['edit'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0]))))
+       {
+               // Edit entries
+               $SW = 2; $OUT = "";
+               foreach ($_POST['sel'] as $id => $value)
+               {
+                       $result = SQL_QUERY_ESC("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       list($lvl, $perc) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'  => $SW,
+                               'id'  => $id,
+                               'lvl' => $lvl,
+                               'per' => TRANSLATE_COMMA($perc),
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_points_edit_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+               define('__LEVEL_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_points_edit");
+       }
+        else
+       {
+               // Referral levels
+               $result = SQL_QUERY("SELECT id, level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       // Make referral levels editable and deletable
+                       $SW = 2; $OUT = "";
+
+                       // List already existing categories for editing
+                       while (list($id, $lvl, $perc) = SQL_FETCHROW($result))
+                       {
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'id'  => $id,
+                                       'lvl' => $lvl,
+                                       'per' => TRANSLATE_COMMA($perc),
+                               );
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_points_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+                       define('__LEVEL_ROWS', $OUT);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_points");
+               }
+
+               // Form for adding new referral levels
+               LOAD_TEMPLATE("admin_add_reflvl");
+       }
+}
+ elseif ($_GET['sub'] == "points")
+{
+       // First points for registration and other fixed points including new add-mode for one-time referral bonus...
+       define('P_REG_VALUE', $_CONFIG['points_register']);
+       define('P_REF_VALUE', $_CONFIG['points_ref']);
+
+       // Load templates
+       LOAD_TEMPLATE("admin_config_sub_points");
+}
+ else
+{
+       // Display selection box
+       LOAD_TEMPLATE("admin_config_points");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_primera.php b/inc/modules/admin/what-config_primera.php
new file mode 100644 (file)
index 0000000..bd559c2
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_primera.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure primera sub-system                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungensarten editieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // First merge temporarily the new API data into the current config
+       $_CONFIG = array_merge($_CONFIG, $_POST);
+
+       // Is the password set?
+       if (isset($_POST['pass'])) {
+               // Then hash and remove it
+               $_POST['primera_api_md5'] = md5($_POST['pass']);
+               unset($_POST['pass']);
+       } // END - if
+
+       // Let's test the API first (hold your horses here, cowboy! Thanks. :) )
+       if (PRIMERA_TEST_API()) {
+               // Save settings
+               ADMIN_SAVE_SETTINGS($_POST);
+       } else {
+               // Failed to test the API!
+               LOAD_TEMPLATE("admin_settings_saved", false, GET_PRIMERA_ERROR_MESSAGE());
+       }
+}  else {
+       // Prepare data for template output
+       $content = array(
+               'min_payout'    => bigintval($_CONFIG['primera_min_payout']),
+               'min_withdraw'  => bigintval($_CONFIG['primera_min_withdraw']),
+               'api_name'              => $_CONFIG['primera_api_name'],
+               'api_md5'               => $_CONFIG['primera_api_md5']
+       );
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_primera", false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_proxy.php b/inc/modules/admin/what-config_proxy.php
new file mode 100644 (file)
index 0000000..df6e62b
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2008 *
+ * ================                             Last change: 08/27/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_proxy.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Proxy settings                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Proxy-Einstellungen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Test proxy settings
+       if (ADMIN_TEST_PROXY_SETTINGS($_POST)) {
+               // Save configuration
+               ADMIN_SAVE_SETTINGS($_POST);
+       } else {
+               // Invalid!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_PROXY_SETTINGS_INVALID);
+       }
+} else {
+       // Prepare content
+       $content = array(
+               'proxy_host'     => $_CONFIG['proxy_host'],
+               'proxy_port'     => $_CONFIG['proxy_port'],
+               'proxy_username' => $_CONFIG['proxy_username'],
+               'proxy_password' => $_CONFIG['proxy_password'],
+       );
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_proxy", false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php
new file mode 100644 (file)
index 0000000..463e7ed
--- /dev/null
@@ -0,0 +1,299 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/03/2004 *
+ * ================                             Last change: 08/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_rallye_prices.php                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup rallye prices                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Rallye-Preise einrichten                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['rallye']))
+{
+       // Price submitted?
+       if (isset($_POST['add']))
+       {
+               if ((!empty($_POST['level'])) && ((!empty($_POST['points'])) || (!empty($_POST['info']))))
+               {
+                       // Submitted data is valid, but maybe we already have this price level?
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s AND price_level='%s' LIMIT 1",
+                        array(bigintval($_GET['rallye']), bigintval($_POST['level'])), __FILE__, __LINE__);
+
+                       if (SQL_NUMROWS($result) == 0)
+                       {
+                               // Ok, new price level entered!
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_rallye_prices (rallye_id, price_level, points, info)
+VALUES ('%s','%s','%s','%s')",
+ array(
+       bigintval($_GET['rallye']),
+       bigintval($_POST['level']),
+       $_POST['points'],
+       $_POST['info']
+), __FILE__, __LINE__);
+                               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_PRICE_LEVEL_SAVED);
+                       }
+                        else
+                       {
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Price level found!
+                               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_PRICE_ALREADY_FOUND);
+                       }
+               }
+       }
+        elseif (isset($_POST['remove']))
+       {
+               // Check if at last one line is selected
+               $SEL = SELECTION_COUNT($_POST['sel']);
+               if ($SEL > 0)
+               {
+                       // Delete selected entries
+                       foreach ($_POST['sel'] as $id => $sel)
+                       {
+                               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_prices WHERE id=%s LIMIT 1",
+                                array(bigintval($id)), __FILE__, __LINE__);
+                       }
+
+                       // Output message
+                       LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_ENTRIES_DELETED);
+               }
+                else
+               {
+                       LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_ENTRIES_NOT_DELETED);
+               }
+       }
+        elseif (isset($_POST['change']))
+       {
+               // Change entries
+               foreach ($_POST['level'] as $id => $level)
+               {
+                       // Secure ID
+                       $id = bigintval($id);
+
+                       // Update entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_prices SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE id=%s LIMIT 1",
+                        array($_POST['rallye_id'][$id], bigintval($level), $_POST['points'][$id], $_POST['infos'][$id], $id), __FILE__, __LINE__);
+               }
+
+               // Output message
+               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_ENTRIES_CHANGED);
+       }
+
+       if (isset($_POST['edit']))
+       {
+               // Check if at last one line is selected
+               $SEL = SELECTION_COUNT($_POST['sel']);
+               if ($SEL > 0)
+               {
+                       // Make selected editable
+                       $SW = 2; $OUT = "";
+                       foreach ($_POST['sel'] as $id => $sel)
+                       {
+                               // Load data to selected rallye
+                               $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE id=%s LIMIT 1",
+                                array(bigintval($id)), __FILE__, __LINE__);
+                               list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'      => $SW,
+                                       'id'      => $id,
+                                       'rallyes' => ADD_OPTION_LINES("rallye_data", "id", "title", $rallye),
+                                       'level'   => $level,
+                                       'points'  => $points,
+                                       'infos'   => $infos,
+                               );
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_config_rallye_edit_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+                       define('__PRICE_ROWS', $OUT);
+
+                       // Prepare data for the main template
+                       define('__RALLYE_ID', $_GET['rallye']);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_config_rallye_edit");
+               }
+                else
+               {
+                       // Nothing selected
+                       $content = RALLYE_NO_PRICES_SELECTED_1."<A href=\"".URL."/modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</A>".RALLYE_NO_PRICES_SELECTED_3;
+                       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+               }
+       }
+        elseif (isset($_POST['del']))
+       {
+               // Check if at last one line is selected
+               $SEL = SELECTION_COUNT($_POST['sel']);
+               if ($SEL > 0)
+               {
+                       // List all prices
+                       $SW = 2; $OUT = "";
+                       foreach ($_POST['sel'] as $id => $sel)
+                       {
+                               // Load data to selected rallye
+                               $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE id=%s LIMIT 1",
+                                array(bigintval($id)), __FILE__, __LINE__);
+                               list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               if (empty($infos)) $infos = "---";
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'      => $SW,
+                                       'id'      => $id,
+                                       'level'   => $level,
+                                       'points'  => $points,
+                                       'infos'   => $infos,
+                               );
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_config_rallye_del_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+                       define('__PRICE_ROWS', $OUT);
+
+                       // Prepare data for the main template
+                       define('__RALLYE_ID', $_GET['rallye']);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_config_rallye_del");
+               }
+                else
+               {
+                       // Nothing selected
+                       $content = RALLYE_NO_PRICES_SELECTED_1."<A href=\"".URL."/modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</A>".RALLYE_NO_PRICES_SELECTED_3;
+                       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+               }
+       }
+        else
+       {
+               // A rallye was selected, so check if there are already prices assigned...
+               $result = SQL_QUERY_ESC("SELECT id, price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
+                array(bigintval($_GET['rallye'])), __FILE__, __LINE__);
+
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       // Load all prices for the selected rallye
+                       $SW = 2; $OUT = "";
+                       while(list($id, $level, $points, $infos) = SQL_FETCHROW($result))
+                       {
+                               if (empty($infos)) $infos = "---";
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'      => $SW,
+                                       'id'      => $id,
+                                       'level'   => $level,
+                                       'points'  => $points,
+                                       'infos'   => $infos,
+                               );
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_config_rallye_prices_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+                       define('__PRICE_ROWS', $OUT);
+
+                       // Prepare data for the main template
+                       define('__RALLYE_ID', $_GET['rallye']);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_config_rallye_prices");
+               }
+       }
+
+       // Add form for adding new price level
+       if (empty($_POST['edit']))
+       {
+               LOAD_TEMPLATE("admin_add_rallye_prices", false, $_GET['rallye']);
+       }
+}
+ else
+{
+       // No rallye selected so display all available without prices
+       $result = SQL_QUERY("SELECT d.id, d.admin_id, d.start_time, d.end_time, d.title, a.login, d.is_active
+FROM "._MYSQL_PREFIX."_rallye_data AS d, "._MYSQL_PREFIX."_admins AS a
+WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List found rallyes
+               $SW = 2; $OUT = "";
+               while (list($id, $aid, $start, $end, $title, $alogin, $active) = SQL_FETCHROW($result))
+               {
+                       $select = "<INPUT type=\"checkbox\" name=\"sel[".$id."]\" class=\"admin_normal\" value=\"1\">";
+                       if ($active == "Y") $select = "<STRONG class=\"big\">".$id."</STRONG>";
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'         => $SW,
+                               'id'         => $id,
+                               'select'     => $select,
+                               'title'      => $title,
+                               'aid'        => $aid,
+                               'email_link' => CREATE_EMAIL_LINK($aid),
+                               'alogin'     => $alogin,
+                               'start'      => MAKE_DATETIME($start, "3"),
+                               'end'        => MAKE_DATETIME($end, "3"),
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_list_rallye_prices_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__RALLYE_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_list_rallye_prices");
+       }
+        else
+       {
+               // No rallyes setup so far
+               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_NO_RALLYES_SETUP);
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_refid.php b/inc/modules/admin/what-config_refid.php
new file mode 100644 (file)
index 0000000..22ca2ee
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/23/2004 *
+ * ================                             Last change: 11/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_refid.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup default referral ID                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Standart Referral-ID einstellen                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save data
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare contants for the template
+       define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true, "def_refid"));
+
+       switch ($_CONFIG['refid_target'])       {
+               case "index":    define('__DEF_RT_INDEX', " selected=\"selected\""); define('__DEF_RT_REGISTER', "");          break;
+               case "register": define('__DEF_RT_INDEX', "");          define('__DEF_RT_REGISTER', " selected=\"selected\""); break;
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_refid");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_reg.php b/inc/modules/admin/what-config_reg.php
new file mode 100644 (file)
index 0000000..9c5922d
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/12/2003 *
+ * ===============                              Last change: 04/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_reg.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup for the registration form                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellungen fuer das Anmeldeformular           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ((isset($_POST['ok'])) && (function_exists('CREATE_TIME_SELECTIONS')))
+{
+       // Calculate timestamp from selections...
+       $_POST['ip_timeout'] = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout", $_POST);
+}
+
+if ((empty($_POST['least_cats'])) || (empty($_POST['ip_timeout'])))
+{
+       unset($_POST['ok']);
+}
+if (isset($_POST['ok']))
+{
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Remember stuff in constants
+       define('LEAST_CATS_VALUE'   , $_CONFIG['least_cats']);
+       define('__CFG_SHOW_REFID'   , ADD_SELECTION("yn", $_CONFIG['display_refid'], "display_refid"));
+       define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['ip_timeout'], "ip_timeout", "Dhm"));
+       define('__CFG_DBL_EMAIL'    , ADD_SELECTION("yn", $_CONFIG['check_double_email'], "check_double_email"));
+       define('__CFG_DBL_PASS'     , ADD_SELECTION("yn", $_CONFIG['check_double_pass'] , "check_double_pass"));
+       define('__REF_PAYOUT'       , $_CONFIG['ref_payout']);
+
+       // Load normal template
+       LOAD_TEMPLATE("admin_config_reg");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_register.php b/inc/modules/admin/what-config_register.php
new file mode 100644 (file)
index 0000000..06b5cf4
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/10/2004 *
+ * ===============                              Last change: 07/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_register.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup for the registration form                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellungen fuer das Anmeldeformular           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Do we want to save changes?
+if (isset($_POST['ok'])) {
+       foreach ($_POST['sel'] as $id => $value) {
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_must_register SET field_required='%s' WHERE id=%s AND field_required != '%s' LIMIT 1",
+                array($value, bigintval($id), $value),__FILE__, __LINE__);
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, REGISTER_ADMIN_CHANGES_SAVED);
+}
+
+// List all register values
+$result = SQL_QUERY("SELECT id, field_name, field_required FROM "._MYSQL_PREFIX."_must_register ORDER BY id", __FILE__, __LINE__);
+$SW = 2; $OUT = "";
+while (list($id, $name, $required) = SQL_FETCHROW($result)) {
+       $eval = "\$name = ".strtoupper($name).";";
+       eval($eval);
+       $OUT .= "<TR>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".$id."</TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\">&nbsp;&nbsp;".$name."</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">
+    ".ADD_SELECTION("yn", $required, "sel[".$id."]")."
+  </TD>
+</TR>\n";
+       $SW = 3 - $SW;
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+// Remember rows in constant
+define('__REGISTER_ROWS', $OUT);
+
+// Load template
+LOAD_TEMPLATE("admin_config_register");
+
+//
+?>
diff --git a/inc/modules/admin/what-config_register2.php b/inc/modules/admin/what-config_register2.php
new file mode 100644 (file)
index 0000000..32a9a79
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/12/2003 *
+ * ===============                              Last change: 11/29/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_register2.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup for the registration form                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellungen fuer das Anmeldeformular           *
+ * -------------------------------------------------------------------- *
+ *          Adapted from what-config_reg.php                            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Calculate timestamp from selections...
+       $_POST['ip_timeout'] = CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout", $_POST);
+       $_POST['least_cats'] = round($_POST['least_cats']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Remember stuff in constants
+       define('LEAST_CATS_VALUE'   , round($_CONFIG['least_cats']));
+       define('__CFG_SHOW_REFID'   , ADD_SELECTION("yn", $_CONFIG['display_refid']   , "display_refid"));
+       define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['ip_timeout']   , "ip_timeout", "Dhm"));
+       define('__CFG_DBL_EMAIL'    , ADD_SELECTION("yn", $_CONFIG['check_double_email']       , "check_double_email"));
+       define('__CFG_DBL_PASS'     , ADD_SELECTION("yn", $_CONFIG['check_double_pass']        , "check_double_pass"));
+       define('__CFG_CAT_DEFAULT'  , ADD_SELECTION("yn", $_CONFIG['register_default'], "register_default"));
+
+       // Load normal template
+       LOAD_TEMPLATE("admin_config_register2");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_removeip.php b/inc/modules/admin/what-config_removeip.php
new file mode 100644 (file)
index 0000000..443d032
--- /dev/null
@@ -0,0 +1,168 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/01/2008 *
+ * ================                             Last change: 10/01/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_removeip.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for the caching system             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration des Caching-Systems                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save configuration
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare data
+       switch ($_CONFIG['removeip_anon_ip']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_ANON_IP_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_ANON_IP_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_ANON_IP_Y', "");
+                       define('__CFG_REMOVEIP_ANON_IP_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_anon_host']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_ANON_HOST_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_ANON_HOST_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_ANON_HOST_Y', "");
+                       define('__CFG_REMOVEIP_ANON_HOST_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_anon_ua']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_ANON_UA_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_ANON_UA_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_ANON_UA_Y', "");
+                       define('__CFG_REMOVEIP_ANON_UA_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_anon_ref']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_ANON_REF_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_ANON_REF_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_ANON_REF_Y', "");
+                       define('__CFG_REMOVEIP_ANON_REF_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_admin_show']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', "");
+                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_guest_show']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_GUEST_SHOW_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', "");
+                       define('__CFG_REMOVEIP_GUEST_SHOW_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_member_show']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', "");
+                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['removeip_sponsor_show']) {
+               case 'Y':
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', " checked=\"checked\"");
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', "");
+                       break;
+
+               case 'N':
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', "");
+                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', " checked=\"checked\"");
+                       break;
+       } // END - switch
+
+       switch ($_CONFIG['anonymous_ip']) {
+               case "127.0.0.1":
+                       define('__CFG_ANONYMOUS_IP_LOCAL' , " selected=\"selected\"");
+                       define('__CFG_ANONYMOUS_IP_ZERO'  , "");
+                       define('__CFG_ANONYMOUS_IP_RANDOM', "");
+                       break;
+
+               case "0.0.0.0":
+                       define('__CFG_ANONYMOUS_IP_LOCAL' , "");
+                       define('__CFG_ANONYMOUS_IP_ZERO'  , " selected=\"selected\"");
+                       define('__CFG_ANONYMOUS_IP_RANDOM', "");
+                       break;
+
+               case "RANDOM":
+                       define('__CFG_ANONYMOUS_IP_LOCAL' , "");
+                       define('__CFG_ANONYMOUS_IP_ZERO'  , "");
+                       define('__CFG_ANONYMOUS_IP_RANDOM', " selected=\"selected\"");
+                       break;
+       } // END - switch
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_removeip");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_rewrite.php b/inc/modules/admin/what-config_rewrite.php
new file mode 100644 (file)
index 0000000..a4761c9
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_rewrite.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Rewrite-Engine configuration                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Rewrite-Engine Konfiguration                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Generate string
+       $MODs = array();
+       foreach ($_POST['mod'] as $mod => $sel) {
+               // Now you can never deselect the admin module, bah!!! ;-)
+               if (($sel == "Y") || ($mod == "admin")) {
+                       // Add module to queue
+                       $MODs[] = $mod;
+               }
+       }
+
+       // Implode array to string and remove posted mod array
+       $_POST['rewrite_skip'] = implode(":", $MODs);
+       unset($_POST['mod']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Load existing modules and generate TR rows for the template
+       $result = SQL_QUERY("SELECT module, title FROM "._MYSQL_PREFIX."_mod_reg ORDER BY module", __FILE__, __LINE__);
+       $SW = 2; $OUT = "";
+       while(list($mod, $title) = SQL_FETCHROW($result)) {
+               // Set title to three dashes when no title is supplied
+               if (empty($title)) $title = "---";
+
+               // Already registered module?
+               if (ereg($mod, $_CONFIG['rewrite_skip'])) {
+                       // Found
+                       $y = " checked=\"checked\"";
+                       $n = "";
+               } else {
+                       // Not found
+                       $y = "";
+                       $n = " checked=\"checked\"";
+               }
+
+               // Remember data in array for the dynamic row template
+               $content = array(
+                       'module'    => $mod,
+                       'title'     => $title,
+                       'y_default' => $y,
+                       'n_default' => $n,
+                       'sw'        => $SW,
+               );
+
+               // Load template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_config_rewrite_rows", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__MODULE_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_config_rewrite");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_secure.php b/inc/modules/admin/what-config_secure.php
new file mode 100644 (file)
index 0000000..6b69b6d
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2003 *
+ * ===============                              Last change: 12/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_secure.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Security related settings                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sicherheitsrelevante Einstellungen               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // If salt length is empty or null then we shall generate new passwords
+       if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0"))
+       {
+               // Generate new passwords for all!
+               require(PATH."/inc/gen_sql_patches.php");
+
+               // Forget the wrong number!
+               unset($_POST['salt_length']);
+
+               // Redirect to logout link
+               LOAD_URL("modules.php?module=admin&logout=1");
+       }
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Remember stuff in constants
+       define('__PASS_LEN'   , $_CONFIG['pass_len']);
+
+       // Password-salt length
+       define('__SALT_LENGTH', $_CONFIG['salt_length']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_secure");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_session.php b/inc/modules/admin/what-config_session.php
new file mode 100644 (file)
index 0000000..316b9de
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/30/2008 *
+ * ================                             Last change: 09/30/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_session.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Session settings                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Session-Einstellungen                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Test Path
+       if ((empty($_POST['session_save_path'])) || ((is_dir($_POST['session_save_path'])) && (is_writeable($_POST['session_save_path'])))) {
+               // Save configuration
+               ADMIN_SAVE_SETTINGS($_POST);
+       } else {
+               // Invalid!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SESSION_SAVE_PATH_INVALID);
+       }
+} else {
+       // Prepare content
+       $content = array(
+               'session_save_path' => $_CONFIG['session_save_path'],
+       );
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_session", false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_sponsor.php b/inc/modules/admin/what-config_sponsor.php
new file mode 100644 (file)
index 0000000..59dd718
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 12/21/2004 *
+ * ================                             Last change: 12/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_title.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Allow only direct points (non-floating)
+       $_POST['sponsor_min_points'] = bigintval($_POST['sponsor_min_points']);
+       $_POST['sponsor_ref_points'] = bigintval($_POST['sponsor_ref_points']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Remember config data in constants for the template
+       define('__SPONSOR_MIN_POINTS', $_CONFIG['sponsor_min_points']);
+       define('__SPONSOR_REF_POINTS', $_CONFIG['sponsor_ref_points']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_sponsor");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_stats.php b/inc/modules/admin/what-config_stats.php
new file mode 100644 (file)
index 0000000..e550e24
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/09/2004 *
+ * ================                             Last change: 04/09/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-stats.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Setup default statistics mode                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Standart Modus der Statistiken einstellen        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Was the form submitted?
+if (isset($_POST['ok'])) {
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Guest stats
+       switch (strtolower($_CONFIG['guest_stats']))
+       {
+       case "members":
+               define('__MEMBERS_RADIO', " checked selected");
+               define('__MODULES_RADIO', "");
+               define('__INACTIVE_RADIO', "");
+               break;
+
+       case "modules":
+               define('__MEMBERS_RADIO', "");
+               define('__MODULES_RADIO', " checked selected");
+               define('__INACTIVE_RADIO', "");
+               break;
+
+       case "inactive":
+               define('__MEMBERS_RADIO', "");
+               define('__MODULES_RADIO', "");
+               define('__INACTIVE_RADIO', " checked selected");
+               break;
+       }
+
+       // Max stats entries per page
+       define('__STATS_LIMIT', $_CONFIG['stats_limit']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_stats");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php
new file mode 100644 (file)
index 0000000..f486767
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ================                             Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_surfbar.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for surfbar                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration fuer Surfbar                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Was the form submitted?
+if (isset($_POST['ok'])) {
+       // Replace german decimal comma with computer decimal dot
+       if (isset($_POST['surfbar_static_reward']))   $_POST['surfbar_static_reward']   = str_replace(",", ".", $_POST['surfbar_static_reward']);
+       if (isset($_POST['surfbar_static_costs']))    $_POST['surfbar_static_costs']    = str_replace(",", ".", $_POST['surfbar_static_costs']);
+       if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = str_replace(",", ".", $_POST['surfbar_dynamic_percent']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare content
+       $content = array(
+               'surfbar_static_reward'   => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
+               'surfbar_static_costs'    => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_static_time'     => $_CONFIG['surfbar_static_time'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_restart_time'    => $_CONFIG['surfbar_restart_time'],
+               'surfbar_static_lock'     => $_CONFIG['surfbar_static_lock'],
+               'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
+               'surfbar_max_order'       => $_CONFIG['surfbar_max_order'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_stats_reload'    => $_CONFIG['surfbar_stats_reload'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_purge_deleted'   => $_CONFIG['surfbar_purge_deleted'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_purge_migrated'  => $_CONFIG['surfbar_purge_migrated'],
+               'surfbar_pause_url'       => $_CONFIG['surfbar_pause_url'],
+               'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'],
+               // @TODO Rewrite this to tiny selection boxes
+               'surfbar_low_interval'    => $_CONFIG['surfbar_low_interval'],
+       );
+
+       // Prepare payment model for template
+       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+               // Static model
+               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
+       } else {
+               // Dynamic model
+               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , "");
+               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\"");
+       }
+
+       // Prepare auto-sart
+       if ($_CONFIG['surfbar_autostart'] == "Y") {
+               // Yes selected
+               define('__CONFIG_SURFBAR_AUTOSTART_Y', " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_AUTOSTART_N', "");
+       } else {
+               // No selected
+               define('__CONFIG_SURFBAR_AUTOSTART_Y', "");
+               define('__CONFIG_SURFBAR_AUTOSTART_N', " checked=\"checked\"");
+       }
+
+       // Prepare notify limits
+       if ($_CONFIG['surfbar_notify_limits'] == "Y") {
+               // Yes selected
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', "");
+       } else {
+               // No selected
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', "");
+               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\"");
+       }
+
+       // Prepare order migration
+       if ($_CONFIG['surfbar_migrate_order'] == "Y") {
+               // Yes selected
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', "");
+       } else {
+               // No selected
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', "");
+               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', " checked=\"checked\"");
+       }
+
+       // Pause URL mode
+       if ($_CONFIG['surfbar_pause_mode'] == "INTERNAL") {
+               // Internal pause page
+               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "");
+       } else {
+               // External pause page (if not empty)
+               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "");
+               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', " checked=\"checked\"");
+       }
+
+       // Notification mode
+       if ($_CONFIG['surfbar_notification_mode'] == "INSTANT") {
+               // Instant notification
+               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\"");
+               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , "");
+       } else {
+               // Only daily reset
+               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', "");
+               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , " selected=\"selected\"");
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_surfbar", false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_title.php b/inc/modules/admin/what-config_title.php
new file mode 100644 (file)
index 0000000..9d1c039
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/21/2004 *
+ * ================                             Last change: 12/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_title.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Remember config data in constants for the template
+       define('__CFG_TITLE_LEFT'     , $_CONFIG['title_left']);
+       define('__CFG_TITLE_MIDDLE'   , $_CONFIG['title_middle']);
+       define('__CFG_TITLE_RIGHT'    , $_CONFIG['title_right']);
+       define('__CFG_TITLE_DECOS'    , ADD_SELECTION("yn", $_CONFIG['enable_title_deco'], "enable_title_deco"));
+       define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", $_CONFIG['enable_mod_title'] , "enable_mod_title" ));
+       define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", $_CONFIG['enable_what_title'], "enable_what_title"));
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_title");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_top10.php b/inc/modules/admin/what-config_top10.php
new file mode 100644 (file)
index 0000000..9977a7f
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/24/2004 *
+ * ================                             Last change: 11/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_top10.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstellungen                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Prepare constants for the template
+       define('__MAX_VALUE', $_CONFIG['top10_max']);
+
+       // Load form template
+       LOAD_TEMPLATE("admin_config_top10");
+}
+//
+?>
diff --git a/inc/modules/admin/what-config_transfer.php b/inc/modules/admin/what-config_transfer.php
new file mode 100644 (file)
index 0000000..c4d3a67
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/06/2004 *
+ * ================                             Last change: 10/06/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_transfer.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration of transfer system                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration des Punktetransfersystems          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // Save settings...
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+
+// Prepare constants for template
+define('__TRANS_MAX_VALUE'    , $_CONFIG['transfer_max']);
+define('__TRANS_BALANCE_VALUE', $_CONFIG['transfer_balance']);
+define('__TRANS_CODE_VALUE'   , $_CONFIG['transfer_code']);
+
+// Autppurge expired transfer entries?
+switch ($_CONFIG['autopurge_inactive']) {
+       case 'Y':
+               define('__YES_AP', " selected=\"selected\"");
+               define('__NO_AP', "");
+               break;
+
+       case 'N':
+               define('__YES_AP', "");
+               define('__NO_AP', " selected=\"selected\"");
+               break;
+}
+
+// Time selection box
+define('__TRANS_AGE_SELECTION'    , CREATE_TIME_SELECTIONS($_CONFIG['transfer_age'], "transfer_age", "MWDh"));
+define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS($_CONFIG['transfer_timeout'], "transfer_timeout", "MWDh"));
+
+// Load template
+LOAD_TEMPLATE("admin_config_transfer");
+
+//
+?>
diff --git a/inc/modules/admin/what-config_user.php b/inc/modules/admin/what-config_user.php
new file mode 100644 (file)
index 0000000..be7a72c
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/11/2005 *
+ * ================                             Last change: 03/11/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_user.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Userlist configyuration                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitgliederliste konvfigurieren                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+}
+ else
+{
+       // Prepare constants for the template
+       define('__LIMIT_VALUE', $_CONFIG['user_limit']);
+       define('__ALPHA_VALUE', $_CONFIG['user_alpha']);
+
+       // Load form template
+       LOAD_TEMPLATE("admin_config_user");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php
new file mode 100644 (file)
index 0000000..313868b
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/26/2007 *
+ * ================                             Last change: 12/26/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_wernis.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Configure wernis sub-system                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungensarten editieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok'])) {
+       // First merge temporarily the new API data into the current config
+       $_CONFIG = array_merge($_CONFIG, $_POST);
+
+       // Let's test the API first (hold your horses here, cowboy! Thanks. :) )
+       if (WERNIS_TEST_API()) {
+               // Revert german commata
+               foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
+                       $_POST['wernis_'.$revert] = REVERT_COMMA($_POST['wernis_'.$revert]);
+               } // END - if
+
+               // Save settings
+               ADMIN_SAVE_SETTINGS($_POST);
+       } else {
+               // Failed to test the API!
+               LOAD_TEMPLATE("admin_settings_saved", false, GET_WERNIS_ERROR_MESSAGE());
+       }
+}  else {
+       // Prepare data for template output
+       $content = array(
+               'min_payout'           => bigintval($_CONFIG['wernis_min_payout']),
+               'min_withdraw'         => bigintval($_CONFIG['wernis_min_withdraw']),
+               'api_id'               => bigintval($_CONFIG['wernis_api_id']),
+               'api_md5'              => $_CONFIG['wernis_api_md5'],
+               'api_url'              => $_CONFIG['wernis_api_url'],
+               'refid'                => bigintval($_CONFIG['wernis_refid']),
+               'payout_factor'        => TRANSLATE_COMMA($_CONFIG['wernis_payout_factor']),
+               'withdraw_factor'      => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_factor']),
+               'payout_fee_percent'   => TRANSLATE_COMMA($_CONFIG['wernis_payout_fee_percent']),
+               'withdraw_fee_percent' => TRANSLATE_COMMA($_CONFIG['wernis_withdraw_fee_percent']),
+               'payout_fee_fix'       => bigintval($_CONFIG['wernis_payout_fee_fix']),
+               'withdraw_fee_fix'     => bigintval($_CONFIG['wernis_withdraw_fee_fix'])
+       );
+
+       // Prepare payout Y/N selection
+       if ($_CONFIG['wernis_payout_active'] == "Y") {
+               // Payout allowed
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', " checked=\"checked\"");
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_N', "");
+       } else {
+               // Payout disabled
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_Y', "");
+               define('__CFG_WERNIS_PAYOUT_ACTIVE_N', " checked=\"checked\"");
+       }
+
+       // Prepare withdraw Y/N selection
+       if ($_CONFIG['wernis_withdraw_active'] == "Y") {
+               // Payout allowed
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', " checked=\"checked\"");
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', "");
+       } else {
+               // Payout disabled
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_Y', "");
+               define('__CFG_WERNIS_WITHDRAW_ACTIVE_N', " checked=\"checked\"");
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_wernis", false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php
new file mode 100644 (file)
index 0000000..bcc1fcc
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_email.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Delete a bonus or normal mail                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bonus- / Normal-Mail loeschen                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ *  Module by Robert Niedziela, Megacomputing                           *
+ *          web : http://mc-p.mcserver.de                               *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['mid'])) {
+       // Load email data
+       $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+        array(bigintval($_GET['mid'])), __FILE__, __LINE__);
+
+       // Delete mail only once
+       if (SQL_NUMROWS($result) == 1) {
+               // Load data
+               list ($id, $sender, $subject, $url, $timestamp, $payId) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Get points we shall pay back per mail
+               $price = GET_PAY_POINTS($payId, "price");
+
+               // Prepare data for the template
+               define('__ID'     , $id);
+               define('__SENDER' , ADMIN_USER_PROFILE_LINK($sender));
+               define('__SUBJECT', $subject);
+               define('__URL'    , DEREFERER($url));
+               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+
+               // Load template
+               LOAD_TEMPLATE("admin_del_email_normal");
+
+               // Transfer data to data array
+               $DATA = array('url' => $url, 'subject' => $subject);
+
+               // Load email template and send the email away
+               $msg_user = LOAD_EMAIL_TEMPLATE("order-deleted", array(), $sender);
+               SEND_EMAIL($sender, MEMBER_ORDER_DELETED, $msg_user);
+
+               // Delete mail from queue
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                array(bigintval($_GET['mid'])), __FILE__, __LINE__);
+
+               // Fetch right stats_id from pool
+               $result = SQL_QUERY_ESC("SELECT s.id FROM "._MYSQL_PREFIX."_user_stats AS s
+LEFT JOIN "._MYSQL_PREFIX."_pool AS p
+ON s.pool_id=p.id
+WHERE s.pool_id=%s LIMIT 1",
+ array(bigintval($_GET['mid'])), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch stats id
+                       list($stats_id) = SQL_FETCHROW($result);
+
+                       // Free the result
+                       SQL_FREERESULT($result);
+
+                       // Get all user links
+                       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS 'cnt' FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s",
+                               array(bigintval($stats_id)), __FILE__, __LINE__);
+
+                       // Get unconfirmed links for calculation of total points
+                       list($links) = SQL_FETCHROW($result);
+
+                       // Free result
+                       SQL_FREERESULT($result);
+
+                       // Calc total points and pay them back
+                       $totalPoints = $links * $price;
+
+                       // Shall we pay the points back to the user?
+                       if ($_CONFIG['repay_deleted_mails'] != 'SHRED') {
+                               //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
+                               if ($totalPoints > 0) {
+                                       // Shall we payback to user or jackpot?
+                                       if ($_CONFIG['repay_deleted_mails'] == "JACKPOT") {
+                                               // Set jackpot
+                                               $sender = 0;
+                                       }
+
+                                       // Pay back points
+                                       //* DEBUG: */ echo "PAYBACK:".$sender."<br />\n";
+                                       ADD_POINTS_REFSYSTEM($sender, $totalPoints, true, "0", false,"direct");
+
+                                       // Output message
+                                       if ($_CONFIG['repay_deleted_mails'] == 'REPAY') {
+                                               // Repayed
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_REPAYED,
+                                                       number_format($totalPoints, 0, ",", ".")
+                                               ));
+                                       } else {
+                                               // To jackpot
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_TO_JACKPOT,
+                                                       number_format($totalPoints, 0, ",", ".")
+                                               ));
+                                       }
+                               } else {
+                                       // No points repayed!
+                                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_POINTS_REPAYED);
+                               }
+                       } else {
+                               // Points shredded!
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_SHREDDED, $totalPoints));
+                       }
+
+                       // Remove links from DB
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%s",
+                        array(bigintval($stats_id)), __FILE__, __LINE__);
+
+                       // Output link for manually removing stats entry
+                       LOAD_TEMPLATE("admin_settings_saved", false, "<A href=\"".URL."/modules.php?module=admin&amp;what=del_email&amp;pid=".bigintval($_GET['mid'])."\">".ADMIN_REMOVE_STATS_ENTRY."</A>");
+               }
+       } else {
+               // Mail already deleted!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NORMAL_MAIL_ALREADY_DELETED);
+       }
+} elseif (!empty($_GET['pid'])) {
+       // Remove stats entries
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s LIMIT 1",
+        array(bigintval($_GET['pid'])), __FILE__, __LINE__);
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_USER_STATS_REMOVED);
+} elseif ((!empty($_GET['bid'])) && (EXT_IS_ACTIVE("bonus"))) {
+       // Load data from bonus mail
+       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM "._MYSQL_PREFIX."_bonus WHERE id=%s",
+        array(bigintval($_GET['bid'])), __FILE__, __LINE__);
+
+       // Delete mail only once
+       if (SQL_NUMROWS($result) == 1) {
+               // Load data
+               list ($id, $subject, $url, $timestamp) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Delete bonus mail entirely from database
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+                array(bigintval($_GET['bid'])), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s",
+                array(bigintval($_GET['bid'])), __FILE__, __LINE__);
+
+               // Prepare data for the template
+               define('__ID'     , $id);
+               define('__SUBJECT', $subject);
+               define('__URL'    , DEREFERER($url));
+               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+
+               // Load template
+               LOAD_TEMPLATE("admin_del_email_bonus");
+       } else {
+               // Mail already deleted!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_MAIL_ALREADY_DELETED);
+       }
+} else {
+       // No mail orders fond
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-del_holiday.php b/inc/modules/admin/what-del_holiday.php
new file mode 100644 (file)
index 0000000..42d9c9e
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 08/09/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_holiday.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Remove holiday requests                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Urlaubsschaltungen entfernen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check for selected holidays
+$SUM = 0;
+if (isset($_POST['sel'])) $SUM = SELECTION_COUNT($_POST['sel']);
+
+// Shall I delete selected holidays???
+if ($SUM > 0)
+{
+       // Delete multiple holiday requests (for list_holiday)
+       $cnt = 0;
+       foreach ($_POST['sel'] as $id => $sel)
+       {
+               // Get the userid
+               $result = SQL_QUERY_ESC("SELECT userid, holiday_start, holiday_end
+FROM "._MYSQL_PREFIX."_user_holidays
+WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Load data and free memory
+                       list($uid, $start, $end) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Update user's account
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET holiday_active='N', holiday_activated='0'
+WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
+
+                       // Remove holiday
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_holidays
+WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+
+                       // Prepare loaded data for the
+                       $content = array(
+                               'start' => MAKE_DATETIME($start, "3"),
+                               'end'   => MAKE_DATETIME($end  , "3")
+                       );
+
+                       // Send email to user
+                       $msg = LOAD_EMAIL_TEMPLATE("member_holiday_removed", $content, $uid);
+                       SEND_EMAIL($uid, HOLIDAY_ADMIN_REMOVED_SUBJ, $msg);
+                       $cnt++;
+               }
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_ADMIN_MULTI_DEL_1.$cnt.HOLIDAY_ADMIN_MULTI_DEL_2);
+}
+ elseif (!empty($_GET['u_id']))
+{
+       // Set default message
+       $MSG = HOLIDAY_ADMIN_SINGLE_404;
+
+       // Fetch data
+       $result_load = SQL_QUERY_ESC("SELECT holiday_start AS start, holiday_end AS end
+FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_load) == 1)
+       {
+               // Load data
+               $content = SQL_FETCHARRAY($result_load);
+
+               // Free some memory
+               unset($content[0]);
+               unset($content[1]);
+
+               // Delete one holiday request (for task)
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+
+               // Send email to user
+               $msg = LOAD_EMAIL_TEMPLATE("member_holiday_removed", $content, $_GET['u_id']);
+               SEND_EMAIL($_GET['u_id'], HOLIDAY_ADMIN_REMOVED_SUBJ, $msg);
+
+               // Set message
+               $MSG = HOLIDAY_ADMIN_SINGLE_DELETED;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_load);
+
+       // Output message
+       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+}
+ else
+{
+       // Please call me over other scripts... ;)
+       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_NO_DIRECT_CALL);
+}
+//
+?>
diff --git a/inc/modules/admin/what-del_sponsor.php b/inc/modules/admin/what-del_sponsor.php
new file mode 100644 (file)
index 0000000..ee6b104
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/24/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_sponsor.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit sponsor account                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenaccount aendern                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['id']))) {
+       // Check for selected sponsor
+       $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Remove sponsor
+               if (isset($_POST['ok'])) {
+                       // Load data and remember it in constants
+                       list($email, $gender, $surname, $family) = SQL_FETCHROW($result);
+
+                       // Free result
+                       SQL_FREERESULT($result);
+
+                       define('__EMAIL'  , $email);
+                       define('__GENDER'  , TRANSLATE_GENDER($gender));
+                       define('__SURNAME', $surname);
+                       define('__FAMILY' , $family);
+
+                       // Prepare message and send it away
+                       $msg = LOAD_EMAIL_TEMPLATE("del_sponsor", $_POST['reason'], bigintval($_GET['id']));
+                       SEND_EMAIL($email, SPONSOR_ADMIN_DEL_SUBJECT, $msg);
+
+                       // Remove account
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+                        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+
+                       // Remove orders
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_orders WHERE sponsorid='%s' LIMIT 1",
+                        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+
+                       // Output message
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_DELETED_1.bigintval($_GET['id']).SPONSOR_DELETED_2);
+               } elseif (!empty($_POST['no'])) {
+                       // Do not delete him...
+                       LOAD_URL(URL."/modules.php?module=admin&amp;what=list_sponsor&amp;id=".bigintval($_GET['id']));
+               } else {
+                       // Load data
+                       list ($email, $gender, $sname, $fname) = SQL_FETCHROW($result);
+
+                       // Transfer data to constants for the template
+                       define('__EMAIL', $email);
+                       define('__SNAME', $sname);
+                       define('__FNAME', $fname);
+                       define('__GENDER', TRANSLATE_GENDER($gender));
+                       define('__UID'  , bigintval($_GET['id']));
+
+                       // Display form
+                       LOAD_TEMPLATE("admin_del_sponsor");
+               }
+       } else {
+               // Sponsor not found!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.bigintval($_GET['id']).ADMIN_SPONSOR_404_2);
+       }
+} else {
+       // Not called by what-list_sponsor.php
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-del_task.php b/inc/modules/admin/what-del_task.php
new file mode 100644 (file)
index 0000000..9eaf84c
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/03/2004 *
+ * ================                             Last change: 08/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_task.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Delete a task from DB                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Aufgabe aus der Datenbank loeschen               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-del_transfer.php b/inc/modules/admin/what-del_transfer.php
new file mode 100644 (file)
index 0000000..0f1b927
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/07/2004 *
+ * ================                             Last change: 11/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_transfer.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Point transfers                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punktetransfers                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']) || (!IS_ADMIN()))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['del']))
+{
+       // Delete entries from tables
+       $SEL = SELECTION_COUNT($_POST['sel']);
+       if ($SEL > 0)
+       {
+               // Delete entries...
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_transfers_in WHERE trans_id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_transfers_out WHERE trans_id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+               }
+       }
+}
+
+// We only need outgoing transfers
+$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
+$total = 0;
+if (SQL_NUMROWS($result) > 0)
+{
+       // Output rows
+       $OUT = ""; $SW = 2;
+       while(list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result))
+       {
+               // Prepare data for the row template
+               $content = array(
+                       'sw'       => $SW,
+                       'idx'      => $idx,
+                       'stamp'    => MAKE_DATETIME($stamp, "3"),
+                       'uid_from' => ADMIN_USER_PROFILE_LINK($uid1),
+                       'uid_to'   => ADMIN_USER_PROFILE_LINK($uid1),
+                       'reason'   => $reason,
+                       'points'   => TRANSLATE_COMMA($points),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_del_transfer_row", true, $content);
+
+               // Sum points and switch colors
+               $total += $points; $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+ else
+{
+       // Nothing for in and out
+       $OUT = "<TR>
+  <TD colspan=\"6\" align=\"center\" class=\"bottom2\" height=\"70\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, TRANSFER_NO_INOUT_TRANSFERS)."
+  </TD>
+</TR>";
+}
+
+// ... and add them to a constant for the template
+define('__TRANSFER_ROWS', $OUT);
+
+// Remeber total amount
+define('__TRANSFER_TOTAL_VALUE', $total);
+
+// Set title
+define('__TRANSFER_TITLE', TRANSFER_LIST_ALL);
+
+// Show delete button here
+define('__TRANSFER_DELETE', "<INPUT type=\"reset\" class=\"admin_reset\" value=\"".UNDO_SELECTIONS."\">&nbsp;*&nbsp;<INPUT type=\"submit\" name=\"del\" class=\"admin_delete\" value=\"".TRANSFER_DELETE."\">");
+
+// Load final template
+LOAD_TEMPLATE("admin_list_transfer");
+
+//
+?>
diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php
new file mode 100644 (file)
index 0000000..0ffb8df
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 06/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-del_user.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Delete members                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder loeschen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Display only title when no form was submitted
+ADD_DESCR("admin", basename(__FILE__));
+
+// User exists..
+if ((isset($_POST['ok'])) || ((isset($_POST['del'])) && (!empty($_POST['reason'])))) {
+       // Delete users account
+       $result_user = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_user) == 1) {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Delete user account
+               DELETE_USER_ACCOUNT(bigintval($_GET['u_id']), $_POST['reason']);
+               OUTPUT_HTML("<STRONG class=\"admin_green\">".ADMIN_DEL_COMPLETED."</STRONG>");
+       } else {
+               // Account does not exists!
+               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+       }
+} elseif (!empty($_POST['no'])) {
+       // Do not delete him...
+       LOAD_URL("modules.php?module=admin&amp;what=list_user&amp;u_id=".$_GET['u_id']);
+} elseif (empty($_GET['u_id'])) {
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX();
+} else {
+       // Realy want to delete?
+       $result = SQL_QUERY_ESC("SELECT email, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Load data
+               list ($email, $sname, $fname) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Transfer data to constants for the template
+               define('__EMAIL', CREATE_EMAIL_LINK($email, "user_data"));
+               define('__SNAME', $sname);
+               define('__FNAME', $fname);
+               define('__UID'  , $_GET['u_id']);
+
+               // Display form
+               LOAD_TEMPLATE("admin_del_user");
+       } else {
+               // Account does not exists!
+               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-edit_emails.php b/inc/modules/admin/what-edit_emails.php
new file mode 100644 (file)
index 0000000..2921842
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 04/09/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-edit_emails.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit ordered mails e.g. redirecting the URL      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Werbebuchungen aendern (z.B. umleiten der URL)   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ((isset($_POST['ok'])) && (empty($_POST['id']))) {
+       unset($_POST['ok']);
+}
+
+$result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM "._MYSQL_PREFIX."_pool ORDER BY timestamp", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0)
+{
+       if (isset($_POST['ok']))
+       {
+               // Make mail editable...
+               $result = SQL_QUERY_ESC("SELECT subject, text, url FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                array(bigintval($_POST['id'])), __FILE__, __LINE__);
+               list($subj, $text, $url) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+               define('__ID_VALUE'  , $_POST['id']);
+               define('__URL_VALUE' , $url);
+               define('__SUBJ_VALUE', $subj);
+               define('__TEXT_VALUE', $text);
+
+               // Load template
+               LOAD_TEMPLATE("admin_edit_email");
+       }
+        elseif (!empty($_POST['save']))
+       {
+               // Save changes
+               if (!empty($SQL))
+               {
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET
+subject='%s',
+text='%s',
+url='%s'
+WHERE id=%s LIMIT 1",
+ array(
+       addslashes($_POST['subj']),
+       addslashes($_POST['text']),
+       addslashes($_POST['url']),
+       bigintval($_POST['id']),
+), __FILE__, __LINE__);
+                       if (SQL_AFFECTEDROWS() == 1)
+                       {
+                               $content = "<SPAN class=\"admin_done\">".SETTINGS_SAVED."</SPAN>";
+                       }
+                        else
+                       {
+                               $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+                       }
+               }
+                else
+               {
+                       $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+               }
+
+               // Display message
+               LOAD_TEMPLATE("admin_settings_saved", false, $content);
+       }
+        else
+       {
+               // There are mail orders available
+               $SW = 2; $OUT = "";
+               while (list($id, $sender, $subj, $pay, $cat) = SQL_FETCHROW($result))
+               {
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'   => $SW,
+                               'id'   => $id,
+                               'subj' => $subj,
+                               'uid'  => ADMIN_USER_PROFILE_LINK($sender),
+                               'pay'  => GET_PAYMENT($pay),
+                               'cat'  => GET_CATEGORY($cat),
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_edit_email_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__EMAIL_SELECT_ROWS', $OUT);
+
+               // Load email template
+               LOAD_TEMPLATE("admin_edit_email_select");
+       }
+} else {
+       // No mail orders left in pool
+       OUTPUT_HTML("<SPAN class=\"admin_failed\">".ADMIN_NO_MAILS_IN_POOL."</SPAN>");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php
new file mode 100644 (file)
index 0000000..9b4a761
--- /dev/null
@@ -0,0 +1,200 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/24/2005 *
+ * ================                             Last change: 05/12/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-edit_sponsor.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit sponsor account                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenaccount aendern                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
+       // Check for selected sponsor
+       $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Load sponsor details
+               $DATA = SQL_FETCHARRAY($result);
+               SQL_FREERESULT($result);
+
+               // Prepare all data for the template
+               //  Sponsor's ID
+               define('__SPONSOR_ID' , bigintval($_GET['id']));
+               //  Company's data
+               define('__COMPANY'    , $DATA['company']);
+               define('__POSITION'   , $DATA['position']);
+               define('__TAX_IDENT'  , $DATA['tax_ident']);
+               //  Personal data
+               switch ($DATA['gender'])
+               {
+               case "M":
+                       define('__GENDER_M', " selected=\"selected\"");
+                       define('__GENDER_F', "");
+                       define('__GENDER_C', "");
+                       break;
+
+               case "F":
+                       define('__GENDER_M', "");
+                       define('__GENDER_F', " selected=\"selected\"");
+                       define('__GENDER_C', "");
+                       break;
+
+               case "C":
+                       define('__GENDER_M', "");
+                       define('__GENDER_F', "");
+                       define('__GENDER_C', " selected=\"selected\"");
+                       break;
+               }
+               define('__SURNAME'    , $DATA['surname']);
+               define('__FAMILY'     , $DATA['family']);
+               define('__STREET1'    , $DATA['street_nr1']);
+               define('__STREET2'    , $DATA['street_nr2']);
+               define('__ZIP'        , $DATA['zip']);
+               define('__CITY'       , $DATA['city']);
+               define('__COUNTRY'    , $DATA['country']);
+               //  Contact data
+               define('__PHONE'      , $DATA['phone']);
+               define('__FAX'        , $DATA['fax']);
+               define('__CELL'       , $DATA['cell']);
+               define('__EMAIL'      , $DATA['email']);
+               define('__URL'        , $DATA['url']);
+               //  Warning because low points
+               define('__REC_WARNING', ADD_SELECTION("yn", $DATA['receive_warnings'], "receive_warning"));
+               define('__INTERVAL'   , CREATE_TIME_SELECTIONS($DATA['warning_interval'], "warning_interval", "MWDh"));
+
+               // Init variables here
+               $TPL = sprintf("admin_edit_sponsor_%s", SQL_ESCAPE($_GET['mode']));
+               $SQLs = array();
+
+               // Sponsor was found
+               if ((isset($_POST['ok'])) || (isset($_POST['edit']))) {
+                       // Perform action on mode
+                       switch ($_GET['mode'])
+                       {
+                       case "add_points": // Add points
+                               if (strval($_POST['points']) > 0) {
+                                       // Replace german decimal comma with computer's decimal dot
+                                       $POINTS = strval(str_replace(",", ".", $_POST['points']));
+
+                                       // Add points to account
+                                       $result_add = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1",
+                                        array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__);
+
+                                       // Remember points /reason for the template
+                                       define('__POINTS' , TRANSLATE_COMMA($POINTS));
+                                       define('__REASON' , $_POST['reason']);
+
+                                       // Send email
+                                       $msg = LOAD_EMAIL_TEMPLATE("sponsor_add_points", $_POST['reason'], true);
+                                       SEND_EMAIL(__EMAIL, SPONSOR_ADMIN_ADD_POINTS, $msg);
+                                       $MSG = ADMIN_SPONSOR_POINTS_ADDED;
+                               } else {
+                                       // No points entered to add!
+                                       $MSG = ADMIN_SPONSPOR_NO_POINTS_TO_ADD;
+                               }
+                               break;
+
+                       case "sub_points": // Subtract points
+                               if (strval($_POST['points']) > 0) {
+                                       // Replace german decimal comma with computer's decimal dot
+                                       $POINTS = strval(str_replace(",", ".", $_POST['points']));
+
+                                       // Add points to account
+                                       $result_add = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_used=points_used+%s WHERE id='%s' LIMIT 1",
+                                        array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__);
+
+                                       // Remember points /reason for the template
+                                       define('__POINTS' , TRANSLATE_COMMA($POINTS));
+                                       define('__REASON' , $_POST['reason']);
+
+                                       // Send email
+                                       $msg = LOAD_EMAIL_TEMPLATE("sponsor_sub_points", $_POST['reason'], true);
+                                       SEND_EMAIL(__EMAIL, SPONSOR_ADMIN_SUB_POINTS, $msg);
+                                       $MSG = ADMIN_SPONSOR_POINTS_SUBTRACTED;
+                               } else {
+                                       // No points entered to add!
+                                       $MSG = ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT;
+                               }
+                               break;
+
+                       case "edit": // Edit sponsor account
+                               $PASS = true;
+                               if (($_POST['pass1'] != $_POST['pass2']) || ((empty($_POST['pass1'])) && (empty($_POST['pass1'])))) {
+                                       // Remove passwords
+                                       unset($_POST['pass1']);
+                                       unset($_POST['pass2']);
+                                       $PASS = false;
+                               }
+                               SPONSOR_HANDLE_SPONSOR($_POST);
+
+                               // Convert some data for the email template
+                               $_POST['gender'] = TRANSLATE_GENDER($_POST['gender']);
+                               $_POST['warning_interval'] = CREATE_FANCY_TIME($_POST['warning_interval']);
+                               if (!$PASS) $_POST['pass1'] = SPONSOR_PASS_UNCHANGED;
+
+                               // Load email template and send the mail away
+                               $msg = LOAD_EMAIL_TEMPLATE("admin_sponsor_edit", $_POST, false);
+                               SEND_EMAIL($_POST['email'], SPONSOR_ADMIN_EDIT_SUBJECT, $msg);
+                               break;
+
+                       default: // Unknown mode
+                               $MSG = ADMIN_INVALID_MODE_1.SQL_ESCAPE($_GET['mode']).ADMIN_INVALID_MODE_2;
+                               break;
+                       }
+
+                       if (!empty($MSG)) {
+                               // Output message
+                               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+                       } // END - if
+               } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", PATH, GET_LANGUAGE(), $TPL))) {
+                       // Create mailto link
+                       define('__SPONSOR_VALUE', "<A href=\"mailto:".__EMAIL."\">".__SURNAME." ".__FAMILY."</A>");
+
+                       // Load mode template
+                       LOAD_TEMPLATE($TPL);
+               } else {
+                       // Template not found!
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_TPL_404_1.SQL_ESCAPE($_GET['mode']).ADMIN_TPL_404_2);
+               }
+       } else {
+               // Sponsor not found!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.bigintval($_GET['id']).ADMIN_SPONSOR_404_2);
+       }
+} else {
+       // Not called by what-list_sponsor.php
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-edit_user.php b/inc/modules/admin/what-edit_user.php
new file mode 100644 (file)
index 0000000..882d713
--- /dev/null
@@ -0,0 +1,153 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 06/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-edit_user.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit member's profiles                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitgliederprofile aendern                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Fix a notice
+$result_main = false;
+if (isset($_GET['u_id'])) {
+       //                                    0      1        2         3      4     5      6       7         8          9           10         11
+       $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+}
+
+if ((SQL_NUMROWS($result_main) == 1) || (empty($_GET['u_id'])))
+{
+       // User found
+       if (empty($_GET['u_id']))
+       {
+               // Output selection form with all confirmed user accounts listed
+               ADD_MEMBER_SELECTION_BOX();
+       }
+        elseif (isset($_POST['edit']))
+       {
+               // Ok, change the account...
+               $PASS = false; $ADD = "";
+               if ((empty($_POST['pass1'])) && (empty($_POST['pass2'])))
+               {
+                       // Don't change the password
+                       $PASS = true;
+               }
+                elseif (($_POST['pass1'] == $_POST['pass2']))
+               {
+                       // Change the password
+                       $PASS = true;
+                       $ADD = ", password='".generateHash($_POST['pass1'])."'";
+               }
+               if ($PASS)
+               {
+                       // We have to add the following things: birthday and max receive mails
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET
+gender='%s',
+surname='%s',
+family='%s',
+street_nr='%s',
+country='%s',
+zip=%s,
+city='%s',
+email='%s'
+".$ADD."
+WHERE userid=%s LIMIT 1",
+ array(
+       substr($_POST['gender'], 0, 1),
+       $_POST['surname'],
+       $_POST['family_name'],
+       $_POST['street_nr'],
+       $_POST['country'],
+       bigintval($_POST['zip']),
+       $_POST['city'],
+       $_POST['email'],
+       bigintval($_GET['u_id']),
+), __FILE__, __LINE__);
+                       $content = USER_ACCOUNT_SAVED;
+               }
+                else
+               {
+                       // Problem while saving data
+                       $content = USER_ACCOUNT_NOT_SAVED;
+               }
+
+               // Load template
+               LOAD_TEMPLATE("admin_settings_saved", false, $content);
+       }
+        else
+       {
+               // Display form to edit
+               list($gender, $surname, $family, $street, $zip, $city, $country, $email, $bday, $bmonth, $byear, $max) = SQL_FETCHROW($result_main);
+               SQL_FREERESULT($result_main);
+
+               // Transfer data to constants for the template
+               switch ($gender)
+               {
+               case "M":
+                       define('_GENDER_M', " selected=\"selected\"");
+                       define('_GENDER_F', "");
+                       define('_GENDER_C', "");
+                       break;
+
+               case "F":
+                       define('_GENDER_M', "");
+                       define('_GENDER_F', " selected=\"selected\"");
+                       define('_GENDER_C', "");
+                       break;
+
+               case "C":
+                       define('_GENDER_M', "");
+                       define('_GENDER_F', "");
+                       define('_GENDER_C', " selected=\"selected\"");
+                       break;
+               }
+
+               define('_SURNAME', $surname); define('_FAMILY', $family); define('_CITY'     , $city);
+               define('_STREET' , $street);  define('_ZIP'   , $zip);    define('_MAX_MAILS', $max);
+               define('_COUNTRY', $country); define('_EMAIL' , $email);
+
+               // Load template
+               LOAD_TEMPLATE("admin_edit_user", false, bigintval($_GET['u_id']));
+       }
+}
+ else
+{
+       // Account does not exists!
+       OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php
new file mode 100644 (file)
index 0000000..fb6df18
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 04/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-email_archiv .php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : See send emails details of ordered mails         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle  Mails ansehen die versand wurden           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ * -------------------------------------------------------------------- *
+ * Mod-Copyright (c) 2004 by Robert Niedziela                           *
+ * www.megacomputing.de                                                 *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//             0     1        2      3        4          5           6          7      8         9        10
+$SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
+ FROM "._MYSQL_PREFIX."_pool
+ WHERE data_type='SEND' OR data_type='DELETED'
+ ORDER BY timestamp DESC";
+
+// Check for maximum pages
+$result_normal = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+// Set offset an current page to default values
+if (empty($_GET['page']))   $_GET['page']   = "1";
+if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page'];
+
+// Add limitation to SQL string
+$SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
+
+// Run SQL query for normal mails
+$result = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+// Calculate pages
+$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.5);
+SQL_FREERESULT($result_normal);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // Mail orders are in pool so we can display them
+
+       // Add navigation table rows
+       if ($PAGES > 1)
+       {
+               define('__TOP_EMAIL_NAV'   , ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], true , "3", true));
+               define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true));
+       }
+        else
+       {
+               define('__TOP_EMAIL_NAV'   , "");
+               define('__BOTTOM_EMAIL_NAV', "");
+       }
+
+       $SW = 2; $OUT = "";
+       while ($pool = SQL_FETCHROW($result))
+       {
+               // Check sent mails and clicks
+               $result_mails = SQL_QUERY_ESC("SELECT max_rec, clicks FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s LIMIT 1",
+                array(bigintval($pool[0])), __FILE__, __LINE__);
+               list($sent, $clicks) = SQL_FETCHROW($result_mails);
+               SQL_FREERESULT($result_mails);
+
+               // Unconfirmed mails
+               $unconfirmed = $sent - $clicks;
+               if ($unconfirmed > 0)
+               {
+                       // Add link to list_unconfirmed what-file
+                       $unconfirmed = "<STRONG><A href=\"".URL."/modules.php?module=admin&amp;what=list_unconfirmed&amp;mid=".$pool[0]."\">".$unconfirmed."</A></STRONG>";
+               }
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'          => $SW,
+                       'u_link'      => ADMIN_USER_PROFILE_LINK($pool[1]),
+                       'subj'        => COMPILE_CODE($pool[2]),
+                       'text'        => COMPILE_CODE($pool[3]),
+                       'pay'         => GET_PAYMENT($pool[5]),
+                       'cat'         => GET_CATEGORY($pool[10]),
+                       'sent'        => $sent,
+                       'ruids'       => str_replace(";", ", ", $pool[4]),
+                       'unconfirmed' => $unconfirmed,
+                       'type'        => TRANSLATE_POOL_TYPE($pool[6]),
+                       'tsend'       => $pool[9],
+                       'frametester' => FRAMETESTER($pool[8]),
+                       'url'         => COMPILE_CODE($pool[8]),
+                       'stamp'       => MAKE_DATETIME($pool[7], "0"),
+                       'mid'         => $pool[0],
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_email_archiv_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__EMAIL_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_email_archiv");
+}
+ else
+{
+       // No mail orders fond
+       OUTPUT_HTML("<SPAN class=\"admin_failed\">".ADMIN_NO_MAILS_IN_POOL."</SPAN>");
+}
+//
+?>
diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php
new file mode 100644 (file)
index 0000000..6762cc9
--- /dev/null
@@ -0,0 +1,234 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 10/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-email_details.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : See all email details of ordered mails           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Details einer gebuchten Mail ansehen        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ * -------------------------------------------------------------------- *
+ *           Moded What-email_details.php   / also Editet !             *
+ * Auf langsammen Servern (wie mein z.B Dauert das Laden)               *
+ * enorm hoch zu lang. Jetzt werden nur auftraege aufgelistet die       *
+ * NEU sind ( DB NEW) oder ADMIN freischalten muss (DB ADMIN )          *
+ * oder noch als TEMP gespecihert sind                                  *
+ * der rest der schon als SEND sich melden darf wird per                *
+ * what-email_archiv .php aufgerufen                                    *
+ * beste gruesse Robert Niedziela / www.personal-webserver.de           *
+ * oder auch www.mc-p.org                                               *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Normal mails ordered by your members
+//              0     1       2       3       4           5          6          7       8        9          10
+$SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
+FROM "._MYSQL_PREFIX."_pool
+WHERE data_type IN('ADMIN','TEMP','NEW','ACTIVE')
+ORDER BY timestamp DESC";
+
+$WHO = _ALL;
+$SQL2 = "";
+
+if (!empty($_GET['mid']))
+{
+       // Only a specific mail shall be displayed
+       //              0     1       2       3       4           5          6          7       8        9          10
+       $SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
+        FROM "._MYSQL_PREFIX."_pool
+        WHERE id='".bigintval($_GET['mid'])."'
+        LIMIT 1";
+       $WHO = MAIL_ID.": ".$_GET['mid'];
+}
+ elseif (!empty($_GET['u_id']))
+{
+       // All mails by a specific member shall be displayed
+       //              0     1       2       3       4           5          6          7       8        9          10
+       $SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
+        FROM "._MYSQL_PREFIX."_pool
+        WHERE sender='".bigintval($_GET['u_id'])."'
+        ORDER by timestamp DESC";
+       $WHO = USER_ID.": ".$_GET['u_id'];
+}
+
+if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) {
+       // Bonus mails sent by you
+       //               0     1       2        3        4      5       6          7       8      9         10          11        12
+       $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks
+        FROM "._MYSQL_PREFIX."_bonus
+        ORDER BY timestamp DESC";
+
+       // Check for maximum pages
+       $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
+}
+
+// Check for maximum pages
+$result_normal = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+// Set offset an current page to default values
+if (empty($_GET['page']))   $_GET['page']   = "1";
+if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['mails_page'];
+
+// Add limitation to SQL string
+if (empty($_GET['mid']))
+{
+       // Create limitation line
+       $ADD = " LIMIT ".(bigintval($_GET['offset']) * bigintval($_GET['page']) - bigintval($_GET['offset'])).", ".bigintval($_GET['offset']);
+
+       // For normal mails
+       $SQL .= $ADD;
+
+       // For bonus mails
+       if (!empty($SQL2)) $SQL2 .= $ADD;
+}
+
+// Run SQL query for normal mails
+$result_list = SQL_QUERY($SQL, __FILE__, __LINE__);
+if ((!empty($SQL2)) && ($WHO == _ALL)) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
+
+// Calculate pages
+$PAGES = round(SQL_NUMROWS($result_normal) / $_CONFIG['mails_page'] + 0.3);
+SQL_FREERESULT($result_normal);
+
+$MAIL = false;
+if (SQL_NUMROWS($result_list) > 0) {
+       // Init rows
+       $OUT = ""; $content = array();
+
+       // Walk through all entries
+       while ($pool = SQL_FETCHARRAY($result_list)) {
+               // Unconfirmed mails and sent mails
+               $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s LIMIT 1",
+                array(bigintval($pool['id'])), __FILE__, __LINE__);
+               list($pool['sent_email'], $pool['clicks']) = SQL_FETCHROW($result_uncon);
+               SQL_FREERESULT($result_uncon);
+
+               // Unconfirmed mails
+               $pool['unconfirmed'] = $pool['sent_email'] - $pool['clicks'];
+               if ($pool['unconfirmed'] > 0) {
+                       // Add link to list_unconfirmed what-file
+                       $pool['unconfirmed'] = "<STRONG><A href=\"".URL."/modules.php?module=admin&amp;what=list_unconfirmed&amp;mid=".$pool['id']."\">".$pool['unconfirmed']."</A></STRONG>";
+               } elseif ($pool['unconfirmed'] < 0) {
+                       // Sometimes rarely displayed minus values will be "fixed" to zero
+                       $pool['unconfirmed'] = 0;
+               }
+
+               // Prepare content
+               $content = $pool;
+               $content['sender_link'] = ADMIN_USER_PROFILE_LINK($pool['sender']);
+               $content['subject']     = COMPILE_CODE($pool['subject']);
+               $content['text']        = COMPILE_CODE($pool['text']);
+               $content['payment']     = GET_PAYMENT($pool['payment_id']);
+               $content['category']    = GET_CATEGORY($pool['cat_id']);
+               $content['receivers']   = str_replace(";", ", ", $pool['receivers']);
+               $content['type']        = TRANSLATE_POOL_TYPE($pool['data_type']);
+               $content['frametester'] = FRAMETESTER($pool['url']);
+               $content['url']         = COMPILE_CODE($pool['url']);
+               $content['timestamp']   = MAKE_DATETIME($pool['timestamp'], "0");
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_list_emails_row", true, $content);
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result_list);
+
+       // Add navigation (with change box and colspan=3)
+       $content['nav'] = "";
+       if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true);
+
+       // Prepare content
+       $content['rows'] = $OUT;
+       $content['who'] = $WHO;
+
+       // Mail orders are in pool so we can display them
+       LOAD_TEMPLATE("admin_list_emails", false, $content);
+
+       $MAIL = true;
+       if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) {
+               // Check only if bonus extension is active
+               if (SQL_NUMROWS($result_bonus) > 0) OUTPUT_HTML("<br /><br />");
+       }
+}
+
+if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) {
+       // Load bonus mails only when extension is active
+       if (SQL_NUMROWS($result_bonus) > 0) {
+               // Calculate pages
+               $PAGES = round(SQL_NUMROWS($result_bonus) / $_CONFIG['mails_page'] + 0.5);
+
+               // List emails
+               $OUT = ""; $content = array();
+               while ($bonus = SQL_FETCHARRAY($result_bonus)) {
+                       // Calculate unconfirmed emails
+                       $bonus['unconfirmed'] = $bonus['mails_sent'] - $bonus['clicks'];
+
+                       // Add link?
+                       if ($bonus['unconfirmed'] > 0) {
+                               // Add link to list_unconfirmed what-file
+                               $bonus['unconfirmed'] = "<STRONG><A href=\"".URL."/modules.php?module=admin&amp;what=list_unconfirmed&amp;bid=".$bonus['id']."\">".$bonus['unconfirmed']."</A></STRONG>";
+                       } // END - if
+
+                       // Prepare content
+                       $content = $bonus;
+                       $content['time']        = CREATE_FANCY_TIME($content['time']);
+                       $content['category']    = GET_CATEGORY($content['cat_id']);
+                       $content['receivers']   = str_replace(";", ", ", $content['receivers']);
+                       $content['type']        = TRANSLATE_POOL_TYPE($content['data_type']);
+                       $content['frametester'] = FRAMETESTER($content['url']);
+                       $content['timestamp']   = MAKE_DATETIME($content['timestamp'], "0");
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("admin_list_bonus_emails_row", true, $content);
+               }
+
+               // Add navigation (without change box but with colspan=3)
+               $content['nav'] = "";
+               if ($PAGES > 1) $content['nav'] = ADD_EMAIL_NAV($PAGES, $_CONFIG['mails_page'], false, "3", true);
+
+               // Prepare content
+               $content['rows'] = $OUT;
+
+               // Load main template
+               LOAD_TEMPLATE("admin_list_bonus_emails", false, $content);
+               $MAIL = true;
+       }
+}
+
+if (!$MAIL) {
+       // No mail orders fond
+       OUTPUT_HTML("<SPAN class=\"admin_failed\">".ADMIN_NO_MAILS_IN_POOL."</SPAN>");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-email_stats.php b/inc/modules/admin/what-email_stats.php
new file mode 100644 (file)
index 0000000..7adb7a3
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-email_stats.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Check email statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Pruefen der Email-Statistik                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php
new file mode 100644 (file)
index 0000000..9f3a189
--- /dev/null
@@ -0,0 +1,342 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-extentions.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Extension management                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweiterungen-Management                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+global $cacheInstance, $cacheArray, $cacheMode;
+
+// Normally we want the overview of all registered extensions
+$do = "overview";
+$SEL = 0;
+if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
+
+if (!empty($_GET['reg_ext'])) {
+       // We are about to register a new extension
+       $do = "register"; $id = $_GET['reg_ext'];
+       // The ID comes from task management and it is - of course - *not* the extension's name!
+} elseif ((isset($_POST['change'])) && ($SEL > 0) && (!IS_DEMO())) {
+       // De-/activate extensions
+       foreach ($_POST['sel'] as $id => $active) {
+               // Shall we keep the extension always active?
+               if ((isset($cacheArray['active_extensions'][GET_EXT_NAME($id)])) && ($cacheArray['active_extensions'][GET_EXT_NAME($id)] == "Y") && ($active == "N")) {
+                       // Keep this extension active!
+               } else {
+                       // De/activate extension
+                       $ACT = "N"; $EXT_LOAD_MODE = "deactivate";
+                       if ($active == "N") { $ACT = "Y"; $EXT_LOAD_MODE = "activate"; }
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='".$ACT."' WHERE id=%s AND ext_active='%s' LIMIT 1",
+                        array(bigintval($id), $active), __FILE__, __LINE__);
+
+                       // Run embeded SQL commands
+                       EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE);
+               }
+       }
+} elseif (((isset($_POST['edit'])) || (isset($_POST['modify']))) && ($SEL > 0) && (!IS_DEMO())) {
+       // Change settings like CSS file load
+       if (isset($_POST['modify'])) {
+               // Change entries
+               $cache_update = 0;
+               foreach ($_POST['sel'] as $id => $sel) {
+                       // Secure ID
+                       $id = bigintval($id);
+
+                       // Change this extension?
+                       if ($sel == 1) {
+                               // Update extension's record
+                               $active = $_POST['active'][$id];
+                               if (GET_EXT_VERSION("sql_patches") >= "0.0.6")  {
+                                       // Update also CSS column when extensions sql_patches is newer or exact v0.0.6
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='%s', ext_active='%s' WHERE id=%s LIMIT 1",
+                                        array($_POST['css'][$id], $active, $id), __FILE__, __LINE__);
+                               } else {
+                                       // When extension is older than v0.0.6 there is no column for the CSS information
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='%s' WHERE id=%s LIMIT 1",
+                                        array($active, $id), __FILE__, __LINE__);
+                               }
+
+                               // Run SQLs on activation / deactivation
+                               switch ($active) {
+                                       case 'Y': $EXT_LOAD_MODE = "activate";   break;
+                                       case 'N': $EXT_LOAD_MODE = "deactivate"; break;
+                               }
+
+                               // Run embeded SQL commands
+                               EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE);
+                       }
+               }
+
+               // Extensions changed
+               OUTPUT_HTML("<P align=\"center\">");
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXT_CHANGED);
+               OUTPUT_HTML("</P>");
+       } else {
+               // Edit selected entries
+               $SW = "2"; $OUT = "";
+               foreach ($_POST['sel'] as $id => $sel) {
+                       // Edit this extension?
+                       if (($sel == "Y") || ($sel == "N")) {
+                               // Load required data
+                               if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
+                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_has_css, ext_active FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
+                                        array(bigintval($id)), __FILE__, __LINE__);
+                                       list($name, $css, $active) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+                               } else {
+                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_active FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
+                                        array(bigintval($id)), __FILE__, __LINE__);
+                                       list($name, $active) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+                                       $css = "X";
+                               }
+
+                               // Output row
+                               $CSS = "---";
+                               if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $CSS = ADD_SELECTION("yn", $css, "css", $id);
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'     => $SW,
+                                       'id'     => $id,
+                                       'name'   => $name,
+                                       'active' => ADD_SELECTION("yn", $active, "active", $id),
+                                       'css'    => $CSS,
+                               );
+
+                               // Load row template and switch color
+                               $OUT .= LOAD_TEMPLATE("admin_extensions_edit_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+               } // END - foreach
+               define('__EXTENSIONS_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_extensions_edit");
+               $do = "edit";
+       }
+} elseif ((isset($_POST['delete'])) && ($SEL > 0) && (!IS_DEMO())) {
+       // List extensions and when verbose is enabled SQL statements which will be executed
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $sel) {
+               // Init variables
+               $VERBOSE_OUT = ""; $SQLs = array();
+
+               // Secure id number
+               $id = bigintval($id);
+
+               // Get extension name
+               $ext_name = GET_EXT_NAME($id);
+               $ext_ver = GET_EXT_VERSION($ext_name);
+
+               if ($_CONFIG['verbose_sql']) {
+                       // Load SQL commands in remove mode
+                       $EXT_LOAD_MODE = "remove";
+                       $EXT_ALWAYS_ACTIVE = "N";
+                       $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+                       if (FILE_READABLE($file)) {
+                               // Load file
+                               include($file);
+
+                               // Generate extra table with loaded SQL commands
+                               $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs);
+                       }
+               } // END - if
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'       => $SW,
+                       'id'       => $id,
+                       'ext_name' => $ext_name,
+                       'ext_ver'  => $ext_ver,
+                       'verbose'  => $VERBOSE_OUT
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_extensions_delete_row", true, $content);
+               $SW = 3 - $SW;
+       } // END - foreach
+       define('__EXTENSIONS_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_extensions_delete");
+       $do = "delete";
+} elseif ((isset($_POST['remove'])) && ($SEL > 0) && (!IS_DEMO())) {
+       // Remove extensions from DB (you have to delete all files manually!)
+       $cache_update = 0;
+       foreach ($_POST['sel'] as $id => $active) {
+               // Secure ID number
+               $id = bigintval($id);
+
+               // Is this extension selected?
+               if ($active == 1) {
+                       // Run embeded SQL commands
+                       EXTENSION_RUN_SQLS($id, "remove");
+               } // END - if
+       } // END - foreach
+} elseif (!empty($_GET['do']) && (!IS_DEMO())) {
+       // Other things to do
+       $do = SQL_ESCAPE(strip_tags($_GET['do']));
+} elseif (!empty($_GET['do'])) {
+       // Demo mode active!
+       $do = "demo";
+}
+
+// Shall we display active/inactive extensions?
+$where = "";
+if (!empty($_GET['active'])) {
+       $where = sprintf("WHERE ext_active = '%s'", SQL_ESCAPE(strip_tags($_GET['active'])));
+} // END - if
+
+// Case selection
+switch ($do) {
+case "overview": // List all registered extensions
+       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
+               // Load extension data with CSS informations
+               $result = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_active, ext_has_css, ext_version
+               FROM "._MYSQL_PREFIX."_extensions
+               ".$where."
+               ORDER BY ext_name", __FILE__, __LINE__);
+       } else {
+               // Load extension data without CSS informations
+               $result = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_active, id, ext_version
+               FROM "._MYSQL_PREFIX."_extensions
+               ".$where."
+               ORDER BY ext_name", __FILE__, __LINE__);
+       }
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) > 0) {
+               // Extensions are registered
+               $SW = 2; $OUT = "";
+               while (list($id, $name, $lang, $active, $css, $ver) = SQL_FETCHROW($result)) {
+                       $CSS = "---";
+                       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $CSS = TRANSLATE_YESNO($css);
+
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'      => $SW,
+                               'id'      => $id,
+                               'name'    => $name,
+                               'active'  => TRANSLATE_YESNO($active),
+                               'act_val' => $active,
+                               'lang'    => $lang,
+                               'css'     => $CSS,
+                               'ver'     => $ver,
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_extensions_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Remember rows in constant for the template
+               define('__EXT_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_extensions");
+       } else {
+               // No extensions are registered
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_EXTENSION_REGISTERED."</FONT>");
+       }
+       break;
+
+case "register": // Register new extension
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' AND task_type='EXTENSION' LIMIT 1",
+        array(bigintval(GET_ADMIN_ID(get_session('admin_login')))), __FILE__, __LINE__);
+       $task_found = SQL_NUMROWS($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Is the ID number valid and the task was found?
+       if (($id > 0) && ($task_found == 1)) {
+               // ID is valid so begin with registration, we first want to it's real name from task management (subject column)
+               $result = SQL_QUERY_ESC("SELECT subject FROM "._MYSQL_PREFIX."_task_system WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($subj) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Disable cache update by default
+               $cache_update = 0;
+               if (!empty($subj)) {
+                       // Extract extension's name from subject...
+                       $ext_name = trim(substr($subj, 1, strpos($subj, ":") - 1));
+
+                       // ... so we can finally register and load it in registration mode
+                       $status = EXTENSION_REGISTER($ext_name, $id);
+                       if ($status == true) {
+                               // Extension was found and successfully registered
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXTENSION_REGISTERED);
+
+                               // Do we need to update cache file?
+                               if ((EXT_IS_ACTIVE("cache")) && ($cacheMode != "no")) {
+                                       // Remove cache file (will be auto-created again!)
+                                       if ($cacheInstance->cache_file("config"    , true)) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("mod_reg"   , true)) $cacheInstance->cache_destroy();
+                               } // END - if
+                       } elseif (GET_EXT_VERSION($ext_name) != "") {
+                               // Motify the admin that we have a problem here...
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ALREADY);
+                       } else {
+                               // Motify the admin that we have a problem here...
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_404);
+                       }
+               } else {
+                       // Extension was not found in task management
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ID_404);
+               }
+       } elseif ($task_found == "0") {
+               // No longer assigned or old task
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ASSIGED);
+       } else {
+               // ID is invalid
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_INVALID);
+       }
+       break;
+
+case "demo":
+       LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
+       break;
+}
+//
+?>
diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php
new file mode 100644 (file)
index 0000000..1cd194d
--- /dev/null
@@ -0,0 +1,212 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-guest_add.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Add a new guest menu                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einen neuen Gastmenuepunkt einfuegen             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check if the admin has entered title and what-php file name...
+if (((empty($_POST['title'])) || (empty($_POST['menu']))) && (isset($_POST['ok'])))
+{
+       unset($_POST['ok']);
+}
+
+if (!isset($_POST['ok']))
+{
+       // Create arrays
+       $menus = array(); $titles = array(); $below = array();
+
+       // Get all available main menus
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Read menu structure
+               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+               {
+                       // Menu actions
+                       $menus[] = $act;
+
+                       // Menu titles
+                       $titles[] = $title;
+
+                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                       $below[] = $sort + 1;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Remove double eintries
+               $prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
+               foreach ($menus as $key => $value)
+               {
+                       if ($value == $prev)
+                       {
+                               unset($dmy[$key]);
+                               unset($dmy2[$key]);
+                               unset($dmy3[$key]);
+                       }
+                        else
+                       {
+                               $prev = $value;
+                       }
+               }
+               $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+               // Load sub menus :)
+               foreach ($menus as $key_main => $value_main)
+               {
+                       $result = SQL_QUERY_ESC("SELECT what, title, sort
+FROM "._MYSQL_PREFIX."_guest_menu
+WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+ array(bigintval($value_main)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) > 0)
+                       {
+                               // Initialize arrays
+                               $menus[$value_main] = array();
+                               $titles[$value_main] = array();
+                               $below[$value_main] = array();
+
+                               // Read menu structure
+                               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+                               {
+                                       // Menu actions
+                                       $menus[$value_main][] = $act;
+
+                                       // Menu titles
+                                       $titles[$value_main][] = $title;
+
+                                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                                       $below[$value_main][] = $sort + 1;
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Remove double eintries
+                               $prev = ""; $dmy = $menus[$value_main]; $dmy2 = $titles[$value_main]; $dmy3 = $below[$value_main];
+                               foreach ($menus[$value_main] as $key => $value)
+                               {
+                                       if ($value == $prev)
+                                       {
+                                               unset($dmy[$key]);
+                                               unset($dmy2[$key]);
+                                               unset($dmy3[$key]);
+                                       }
+                                        else
+                                       {
+                                               $prev = $value;
+                                       }
+                               }
+                               $menus[$value_main] = $dmy; $titles[$value_main] = $dmy2; $below[$value_main] = $dmy3;
+                       }
+               }
+       }
+
+       $OUT = "    <SELECT class=\"admin_select\" name=\"sort\" size=\"1\">
+      <OPTION value=\"0\">".IS_FIRST_MENU."</OPTION>";
+       foreach ($below as $key => $m)
+       {
+               if (is_array($m))
+               {
+                       foreach ($m as $key2 => $m2)
+                       {
+                               $OUT .= "      <OPTION value=\"".$m2."\">".$titles[$key][$key2];
+                               foreach ($menus as $k => $v)
+                               {
+                                       if (($v == $key) && (!is_array($v)))
+                                       {
+                                               $OUT .= " (".$titles[$k].")";
+                                       }
+                               }
+                               $OUT .= "</OPTION>\n";
+                       }
+               }
+                else
+               {
+                       $OUT .= "      <OPTION value=\"".$m."\">".$titles[$key]."</OPTION>\n";
+               }
+       }
+       $OUT .= "</SELECT>";
+
+       define('__BELOW_SELECTION' , $OUT);
+       define('__WHAT_SELECTION'  , ADMIN_MAKE_MENU_SELECTION("guest", "what", "name"));
+       define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION("guest", "action", "menu"));
+
+       // Display form
+       LOAD_TEMPLATE("admin_guest_add");
+}
+ elseif (!IS_DEMO())
+{
+       // Insert new menu entry
+       if (!empty($_POST['menu']))
+       {
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_guest_menu
+(`action`,`what`,`title`,`sort`,`visible`,`locked`)
+VALUES('%s','%s','%s','%s','%s','%s')",
+ array(
+       $_POST['menu'],
+       $_POST['name'],
+       $_POST['title'],
+       bigintval($_POST['sort']),
+       $_POST['visible'],
+       $_POST['active'],
+), __FILE__, __LINE__);
+       }
+        else
+       {
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_guest_menu
+(action, title, sort, visible, locked)
+VALUES('%s','%s','%s','%s','%s')",
+ array(
+       $_POST['name'],
+       $_POST['title'],
+       bigintval($_POST['sort']),
+       $_POST['visible'],
+       $_POST['active'],
+), __FILE__, __LINE__);
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
+}
+ else
+{
+       // Demo mode!
+       LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php
new file mode 100644 (file)
index 0000000..b7ee2ea
--- /dev/null
@@ -0,0 +1,364 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-guestedit.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit guest's menu                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Menue fuer die Gaeste editieren                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Do we edit/delete/change main menus or sub menus?
+$AND = "what = ''"; $SUB = "";
+
+if (!empty($_GET['sub'])) {
+       $AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub']));
+       $SUB = SQL_ESCAPE($_GET['sub']);
+}
+
+// Get count of (maybe) selected menu points
+$chk = 0;
+if (!empty($_POST['sel'])) $chk = SELECTION_COUNT($_POST['sel']);
+
+// List all menu points and make them editable
+if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
+{
+       // Edit menu entries
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+
+       $cnt = 0; $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $query = SQL_QUERY_ESC("SELECT title, action, what FROM "._MYSQL_PREFIX."_guest_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($query) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu, $act, $wht) = SQL_FETCHROW($query);
+                               SQL_FREERESULT($result);
+                               $DATA = array(
+                                       'cnt'    => $cnt,
+                                       'sel'    => $sel,
+                                       'action' => ADMIN_MAKE_MENU_SELECTION("guest", "action", "sel_action[".$sel."]", $act),
+                                       'what'   => ADMIN_MAKE_MENU_SELECTION("guest", "what", "sel_what[".$sel."]", $wht),
+                                       'menu'   => $menu,
+                                       'sw'     => $SW,
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_gmenu_edit_row", true, $DATA);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_gmenu_edit_form");
+}
+ elseif ((isset($_POST['del'])) && (!IS_DEMO()))
+{
+       // Del menu entries with or without confirmation
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+
+       $cnt = 0; $OUT = ""; $SW = 2;
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $query = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_guest_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($query) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu) = SQL_FETCHROW($query);
+                               SQL_FREERESULT($result);
+                               $DATA = array(
+                                       'cnt'  => $cnt,
+                                       'menu' => $menu,
+                                       'sel'  => $sel,
+                                       'sw'   => $SW,
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_gmenu_delete_row", true, $DATA);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_gmenu_delete");
+}
+ elseif ((isset($_POST['ok'])) && (!IS_DEMO()))
+{
+       // An action is done...
+       switch ($_POST['ok'])
+       {
+       case "edit": // Edit menu
+               foreach ($_POST['sel'] as $sel => $menu)
+               {
+                       // Secure selector
+                       $sel = bigintval($sel);
+
+                       // Update entry
+                       $query = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($menu, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel], $sel),__FILE__, __LINE__);
+               }
+               LOAD_TEMPLATE("admin_data_saved");
+               break;
+
+       case "del": // Delete menu
+               foreach ($_POST['sel'] as $sel => $menu)
+               {
+                       // Delete enty
+                       $query = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+               }
+               LOAD_TEMPLATE("admin_data_saved");
+               break;
+
+       case "status": // Change access levels
+               foreach ($_POST['sel'] as $sel => $menu)
+               {
+                       // Secure selector
+                       $sel = bigintval($sel);
+
+                       // Update entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='%s', locked='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__);
+               }
+               LOAD_TEMPLATE("admin_data_saved");
+               break;
+
+       default: // Unexpected action
+               define('__OK_VALUE', $_POST['ok']);
+               LOAD_TEMPLATE("admin_menu_unknown_okay");
+               break;
+       }
+}
+ elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO()))
+{
+       // Change status (visible / locked)
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+
+       // Load template
+       $SW = 2; $cnt = 0; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM "._MYSQL_PREFIX."_guest_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu, $vis, $locked) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+                               $content = array(
+                                       'cnt'     => $cnt,
+                                       'menu'    => $menu,
+                                       'sel'     => $sel,
+                                       'sw'      => $SW,
+                                       'visible' => ADD_SELECTION("yn", $vis   , "visible", $sel),
+                                       'locked'  => ADD_SELECTION("yn", $locked, "locked" , $sel),
+                               );
+
+                               // Load template
+                               $OUT .= LOAD_TEMPLATE("admin_menu_status_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__CNT_VALUE', $cnt);
+       define('__MENU_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_gmenu_status");
+}
+ else
+{
+       if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid'])))
+       {
+               // Get IDs
+               if (!empty($_GET['w']))
+               {
+                       // Sub menus selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+                else
+               {
+                       // Main menu selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+
+               if ((!empty($tid)) && (!empty($fid)))
+               {
+                       // Sort menu
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__);
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__);
+               }
+       }
+
+       // By default list menus
+       if (empty($SUB))
+       {
+               // List only main menus
+               $query = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
+       }
+        else
+       {
+               // List sub menus
+               $query = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC",
+                array($SUB), __FILE__, __LINE__);
+       }
+
+       // Get number of menu entries
+       $max = SQL_NUMROWS($query);
+       if ($max > 0)
+       {
+               // Some entties does exist!
+               if (!empty($SUB))
+               {
+                       // Set sub value
+                       define('__SUB_VALUE', $SUB);
+               }
+                else
+               {
+                       // No sub menu selected
+                       define('__SUB_VALUE', "");
+               }
+
+               $SW = 2; $cnt = 0; $OUT = "";
+               while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($query))
+               {
+                       $cnt++;
+                       if (($sort == 0) || (($sort == 1) && (!empty($SUB))))
+                       {
+                               // Is highest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=guestedit&amp;sub=".__SUB_VALUE."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+                        elseif ($cnt == $max)
+                       {
+                               // Is lowest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=guestedit&amp;sub=".__SUB_VALUE."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>";
+                       }
+                        elseif ($sort > 0)
+                       {
+                               // Anything else between highest and lowest
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=guestedit&amp;sub=".__SUB_VALUE."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>/<A href=\"".URL."/modules.php?module=admin&amp;what=guestedit&amp;sub=".__SUB_VALUE."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+                       if (empty($act)) $act = "&nbsp;";
+                       if (empty($wht))   $wht   = "&nbsp;";
+                       if (empty($title))  $title  = "&nbsp;";
+                       $content = array(
+                               'sw'     => $SW,
+                               'id'     => $id,
+                               'action' => $act,
+                               'what'   => $wht,
+                               'title'  => $title,
+                               'navi'   => $NAVI,
+                               'mode'   => "guest"
+                       );
+                       $OUT .= LOAD_TEMPLATE("admin_menu_overview_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($query);
+               define('__MENU_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_gmenu_edit");
+       }
+        else
+       {
+               // Menu entries are missing... (???)
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-holiday_list.php b/inc/modules/admin/what-holiday_list.php
new file mode 100644 (file)
index 0000000..8682a2b
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 07/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-holiday_list.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List all holiday requests                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Urlaubsschaltungen auflisten                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-holiday_remove.php b/inc/modules/admin/what-holiday_remove.php
new file mode 100644 (file)
index 0000000..1fa8487
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 07/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-holiday_remove.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Remove holiday requests                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Urlaubsschaltungen entfernen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php
new file mode 100644 (file)
index 0000000..70ccbd5
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/26/2004 *
+ * ================                             Last change: 06/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_autopurge.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Find inactive accounts and just list them        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Inaktive Accounts finden und dann auflisten      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Exclude default referal id if set
+$EXCLUDE_LIST = "";
+if ($_CONFIG['def_refid'] > 0) {
+       $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid']."";
+} // END - if
+
+// Check for more extensions
+if (EXT_IS_ACTIVE("beg"))     $EXCLUDE_LIST .= " AND d.userid != c.beg_uid";
+if (EXT_IS_ACTIVE("bonus"))   $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid";
+if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid";
+
+// Check for all accounts
+$result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified
+FROM "._MYSQL_PREFIX."_user_data AS d
+WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
+".$EXCLUDE_LIST."
+ORDER BY d.userid", array($_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since'], $_CONFIG['ap_inactive_since']), __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // Ok, we have found some inactive accounts
+       $SW = 2; $OUT = "";
+       while(list($uid, $gender, $sname, $fname, $email, $joined, $last, $notified) = SQL_FETCHROW($result))
+       {
+               // Prepare data for the row template
+               $content = array(
+                       'sw'       => $SW,
+                       'uid'      => ADMIN_USER_PROFILE_LINK($uid),
+                       'gender'   => TRANSLATE_GENDER($gender),
+                       'sname'    => $sname,
+                       'fname'    => $fname,
+                       'email'    => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>",
+                       'joined'   => MAKE_DATETIME($joined, "2"),
+                       'last'     => MAKE_DATETIME($last, "2"),
+                       'notified' => MAKE_DATETIME($notified, "2"),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_list_autopurge_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__AUTOPURGE_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_autopurge");
+}
+ else
+{
+       // All members are active or you don't have any registered
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_AUTOPURGE_ALL_ACTIVE);
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php
new file mode 100644 (file)
index 0000000..8fc083f
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_bank_package.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : List packages                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Listet Angebotspakete auf                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check if there is enougth selected
+$show = true;
+if ((isset($_POST['id'])) && (is_array($_POST['id'])) && (count($_POST['id']) > 0)) {
+       // Okay, which button was pressed?
+       if (isset($_POST['change'])) {
+               // Change permissions
+               ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "bank_packages", "package_active");
+       } elseif (isset($_POST['edit'])) {
+               // Delete entries (with confirmation)
+               ADMIN_EDIT_ENTRIES_CONFIRM(
+                       $_POST['id'],
+                       "bank_packages",
+                       array("id", "title", "description", "account_fee", "free_transfers", "transfer_fee", "output_system_mode", "package_active", "free_months_no_fee", "interest_plus", "interest_minus", "first_payment", "free_account_income", "free_account_stuff", "tan_lock"),
+                       array("bigintval", "", "", "TRANSLATE_COMMA", "bigintval", "TRANSLATE_COMMA", "", "", "bigintval", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "", "bigintval"),
+                       array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "")
+               );
+               $show = false;
+       } elseif (isset($_POST['do_edit'])) {
+               // Delete entries (with confirmation)
+               ADMIN_EDIT_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array(), array(), array(), true);
+       } elseif (isset($_POST['delete'])) {
+               // Delete entries (with confirmation)
+               ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array("id", "title", "description", "account_fee"), array("bigintval", "", "", "TRANSLATE_COMMA"), array("", "", "", ""));
+               $show = false;
+       } elseif (isset($_POST['remove'])) {
+               // Delete entries (with confirmation)
+               ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "bank_packages", array(), array(), array(), true);
+       }
+} // END - if
+
+// Skip showing old entries?
+if (!$show) return;
+
+// Load all banking packages from DB
+$result = SQL_QUERY("SELECT id, title, description, account_fee AS 'fee', package_active AS 'active', interest_plus AS 'plus', interest_minus AS 'minus'
+FROM "._MYSQL_PREFIX."_bank_packages
+ORDER BY id", __FILE__, __LINE__);
+
+// Is there at lease one package?
+if (SQL_NUMROWS($result) > 0) {
+       // List all packages
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // "Translate" some data
+               $content['active'] = TRANSLATE_YESNO($content['active']);
+               $content['fee']    = TRANSLATE_COMMA($content['fee']);
+               $content['plus']   = TRANSLATE_COMMA($content['plus']);
+               $content['minus']  = TRANSLATE_COMMA($content['minus']);
+               $content['sw']     = $SW;
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_list_bank_package_row", true, $content);
+               $SW = 3 - $SW;
+       } // END - while
+
+       // Prepare row(s) for output to template
+       define('__BANK_PACKAGE_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_bank_package");
+} else {
+       // No packages found!
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BANK_NO_PACKAGES_FOUND);
+}
+
+// Free the result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php
new file mode 100644 (file)
index 0000000..cc3eba1
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/22/2005 *
+ * ================                             Last change: 10/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_beg.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : List members in begging-rallye                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder in Bettel-Rallye auflisten            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ($_CONFIG['beg_rallye'] == "Y")
+{
+       // Shall I withdraw now?
+       if (isset($_POST['withdraw']))
+       {
+               // Okay, let's prepare...
+               $curr = date("m", time()) - 1;
+               if (strlen($curr) == 1) $curr = "0".$curr;
+               UPDATE_CONFIG("last_month", $curr);
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_WITHDRAW_PREPARED);
+               OUTPUT_HTML("<br />");
+       }
+
+       // Autopurge installed?
+       $LAST = "%s"; $ONLINE = "";
+       if (EXT_IS_ACTIVE("autopurge"))
+       {
+               // Use last online timestamp to keep inactive members away from here
+               $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+               $ONLINE = $_CONFIG['ap_inactive_since'];
+       }
+
+       // Check if at least one is in the active rallye
+       $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online
+FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' AND beg_points > 0".$LAST."
+ORDER BY beg_points DESC, last_online DESC, userid",
+        array($ONLINE), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List users
+               $OUT = "";$SW = 2; $cnt = 1; $total = 0;
+               while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result))
+               {
+                       // Generate array fore the dynamic template
+                       $WIN1 = ""; $WIN2 = "";
+                       if ($cnt <= $_CONFIG['beg_ranks'])
+                       {
+                               // Maybe he can win his active beg?
+                               $WIN1 = "<STRONG>";
+                               $WIN2 = "</STRONG>";
+                       }
+                       $content = array(
+                               'uid'    => $uid,
+                               'email'  => CREATE_EMAIL_LINK($email, "user_data"),
+                               'gender' => TRANSLATE_GENDER($gender),
+                               'sname'  => $sname,
+                               'fname'  => $fname,
+                               'turbo'  => TRANSLATE_COMMA($turbo),
+                               'last'   => MAKE_DATETIME($last, "2"),
+                               'sw'     => $SW,
+                               'win1'   => $WIN1,
+                               'win2'   => $WIN2,
+                               'cnt'    => $cnt,
+                       );
+
+                       // Load template and add it
+                       $OUT .= LOAD_TEMPLATE("admin_list_beg_rows", true, $content);
+                       $SW = 3 - $SW; $cnt++; $total += $turbo;
+               }
+               define('__BEG_ROWS', $OUT);
+               define('__TOTAL', TRANSLATE_COMMA($total));
+
+               // Check if we need to display form or not with manuel withdraw
+               if ($_CONFIG['last_month'] == date("m", time()))
+               {
+                       // Load form
+                       define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true));
+               }
+                else
+               {
+                       // Display message "no manual withdraw possible"
+                       define('__BEG_WITHDRAW_FORM', "<FONT class=\"admin_failed\">".ADMIN_BEG_ALREADY_WITHDRAW."</FONT>");
+               }
+
+               // Prepare constant for timemark
+               if (EXT_IS_ACTIVE("autopurge")) {
+                       define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+               } else {
+                       define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge"));
+               }
+
+               // Load final template
+               LOAD_TEMPLATE("admin_list_beg");
+       }
+        else
+       {
+               // No one has joined the begging rallye...
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_NO_RALLYE);
+       }
+}
+ else
+{
+       // Rallye deactivated
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_RALLYE_DEACTIVATED);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php
new file mode 100644 (file)
index 0000000..6cd69df
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/04/2005 *
+ * ================                             Last change: 11/19/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_bonus.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : List members in active-rallye                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder in Aktiv-Rallye auflisten             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ($_CONFIG['bonus_active'] == "Y") {
+       // Shall I withdraw now?
+       if (isset($_POST['withdraw'])) {
+               // Okay, let's prepare...
+               $curr = date("m", time()) - 1;
+               if (strlen($curr) == 1) $curr = "0".$curr;
+               UPDATE_CONFIG("last_month", $curr);
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_WITHDRAW_PREPARED);
+               OUTPUT_HTML("<br />");
+       }
+
+       if (GET_EXT_VERSION("bonus") >= "0.6.9") {
+               // Add more bonus points here
+               $USE = "(0";
+               if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
+               if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
+               if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
+               if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
+               if ($_CONFIG['bonus_ref_yn']   == "Y") $USE .= " + bonus_ref";
+               $USE .= ")";
+       } else {
+               // Old version ???
+               $USE = "turbo_bonus";
+       }
+
+       // Autopurge installed?
+       $LAST = "%s"; $ONLINE = "";
+       if (EXT_IS_ACTIVE("autopurge")) {
+               // Use last online timestamp to keep inactive members away from here
+               $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+               $ONLINE = $_CONFIG['ap_inactive_since'];
+       }
+
+       // Check if at least one is in the active rallye
+       $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, ".$USE." AS active_bonus, last_online
+FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' AND ".$USE." > 0".$LAST."
+ORDER BY active_bonus DESC, last_online DESC, userid",
+        array($ONLINE), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) > 0) {
+               // List users
+               $OUT = "";$SW = 2; $cnt = 1; $total = 0;
+               while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) {
+                       // Generate array fore the dynamic template
+                       $WIN1 = ""; $WIN2 = "";
+                       if ($cnt <= $_CONFIG['bonus_ranks']) {
+                               // Maybe he can win his active bonus?
+                               $WIN1 = "<STRONG>";
+                               $WIN2 = "</STRONG>";
+                       }
+
+                       // Prepare content
+                       $content = array(
+                               'uid'    => $uid,
+                               'email'  => CREATE_EMAIL_LINK($email, "user_data"),
+                               'gender' => TRANSLATE_GENDER($gender),
+                               'sname'  => $sname,
+                               'fname'  => $fname,
+                               'turbo'  => TRANSLATE_COMMA($turbo),
+                               'last'   => MAKE_DATETIME($last, "2"),
+                               'sw'     => $SW,
+                               'win1'   => $WIN1,
+                               'win2'   => $WIN2,
+                               'cnt'    => $cnt,
+                       );
+
+                       // Load template and add it
+                       $OUT .= LOAD_TEMPLATE("admin_list_bonus_rows", true, $content);
+                       $SW = 3 - $SW; $cnt++; $total += $turbo;
+               }
+               define('__BONUS_ROWS', $OUT);
+               define('__TOTAL', TRANSLATE_COMMA($total));
+
+               // Check if we need to display form or not with manuel withdraw
+               if ($_CONFIG['last_month'] == date("m", time()))
+               {
+                       // Load form
+                       define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true));
+               }
+                else
+               {
+                       // Display message "no manual withdraw possible"
+                       define('__BONUS_WITHDRAW_FORM', "<FONT class=\"admin_failed\">".ADMIN_BONUS_ALREADY_WITHDRAW."</FONT>");
+               }
+
+               // Prepare constant for timemark
+               if (EXT_IS_ACTIVE("autopurge")) {
+                       define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - $_CONFIG['ap_inactive_since'], "2"));
+               } else {
+                       define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge"));
+               }
+
+               // Load final template
+               LOAD_TEMPLATE("admin_list_bonus");
+       }
+        else
+       {
+               // No one has become an "activity bonus"...
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_NO_ACTIVE_RALLYE);
+       }
+}
+ else
+{
+       // Aktive-Rallye not activated
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_RALLYE_DEACTIVATED);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php
new file mode 100644 (file)
index 0000000..863f1f6
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/27/2004 *
+ * ================                             Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_cats.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : List selected categories from users              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausgewaehlte Kategorien eines Mitgliedes         *
+ *                     auflisten                                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['u_id'])) {
+       // Check if the user already exists
+       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Loads surname, family's name and the email address
+               list($sname, $fname, $email) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare constants
+               define('__CATS_BASE'   , "<A href=\"".URL."/modules.php?module=admin&amp;u_id=");
+               define('__UID'         , bigintval($_GET['u_id']));
+               define('__MEMBER_LINKS', MEMBER_ACTION_LINKS(__UID));
+               define('__EMAIL'       , "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</A>");
+
+               // Ok, list categories of this user
+               $result_cats = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats ORDER BY sort", __FILE__, __LINE__);
+
+               if (SQL_NUMROWS($result_cats) > 0) {
+                       // List categories
+                       $cnt = "1"; $SW = 2; $OUT = "";
+                       while (list($cid, $cat) = SQL_FETCHROW($result_cats)) {
+                               // Check user's selection
+                               $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
+                                array(bigintval($_GET['u_id']), bigintval($cid)), __FILE__, __LINE__);
+
+                               // Set selection
+                               $SELECTED = "<FONT color=\"red\">".NO."</FONT>";
+                               if (SQL_NUMROWS($result_user) == 1) $SELECTED = "<FONT color=\"green\">".YES."</FONT>";
+
+                               // Prepare array for the row template
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'cnt' => $cnt,
+                                       'cat' => $cat,
+                                       'sel' => $SELECTED,
+                               );
+
+                               // Load row template and switch colors + count up
+                               $OUT .= LOAD_TEMPLATE("admin_list_cats_row", true, $content);
+                               $SW = 3 - $SW; $cnt++;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+                       define('__CATS_ROWS', $OUT);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_list_cats");
+               } else {
+                       // No categories selected! :-(
+                       LOAD_TEMPLATE("admin_list_cats_404");
+               }
+       } else {
+               // User not found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.__UID.ADMIN_MEMBER_404_2);
+       }
+} else {
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php
new file mode 100644 (file)
index 0000000..5b227d8
--- /dev/null
@@ -0,0 +1,230 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/30/2005 *
+ * ================                             Last change: 04/30/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_country.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Manage country codes                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Country codes verwalten                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Add new code?
+if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'])))
+{
+       // Check if country code does already exist
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_countries WHERE code='%s' LIMIT 1",
+        array(strtoupper($_POST['code'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Save entry
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active)
+ VALUES('%s','%s','%s')",
+ array(strtoupper(substr($_POST['code'], 0, 2)), $_POST['descr'], $_POST['is_active']), __FILE__, __LINE__);
+
+               // Country added
+               $MSG = ADMIN_COUNTRY_ADDED_1.strtoupper($_POST['descr']).ADMIN_COUNTRY_ADDED_2;
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Does already exist
+               $MSG = ADMIN_COUNTRY_ALREADY_1.strtoupper($_POST['code']).ADMIN_COUNTRY_ALREADY_2;
+       }
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+       OUTPUT_HTML("<br />");
+}
+// Change status?
+ elseif ((isset($_POST['change'])) && (!empty($_POST['id'])))
+{
+       // Change all status
+       ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "countries", "is_active");
+}
+// Edit / delete entries?
+ elseif (((isset($_POST['edit'])) || (isset($_POST['delete']))) && (!empty($_POST['id'])))
+{
+       if (count($_POST['id']) > 0)
+       {
+               if (isset($_POST['edit']))
+               {
+                       // Edit template
+                       $row    = "admin_list_country_edit_row";
+                       $post   = "modify";
+                       $class  = "admin_submit";
+                       $submit = ADMIN_COUNTRY_EDIT_NOW;
+                       $title  = ADMIN_COUNTRY_EDIT_TITLE;
+                       $reset  = "<INPUT type=\"reset\" class=\"admin_reset\" value=\"".UNDO_SELECTIONS."\">&nbsp;*\n";
+               }
+                else
+               {
+                       // Delete template
+                       $row    = "admin_list_country_del_row";
+                       $post   = "remove";
+                       $class  = "admin_delete";
+                       $submit = ADMIN_COUNTRY_DELETE_NOW;
+                       $title  = ADMIN_COUNTRY_DELETE_TITLE;
+                       $reset  = "";
+               }
+
+               // Edit all selected country codes
+               $OUT = ""; $SW = 2;
+               foreach ($_POST['id'] as $id => $status)
+               {
+                       // Load data from DB
+                       $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Load data
+                               list($code, $descr) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Prepare data, load row template and switch colors
+                               $content = array(
+                                       'id'    => $id,
+                                       'code'  => $code,
+                                       'descr' => $descr,
+                                       'sw'    => $SW,
+                               );
+                               if ($post == "modify")
+                               {
+                                       // Generate default selection in edit-mode
+                                       $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status);
+                               }
+                                else
+                               {
+                                       // Only display status when in delete-mode
+                                       $content['status'] = TRANSLATE_YESNO($status);
+                               }
+                               $OUT .= LOAD_TEMPLATE($row, true, $content);
+                               $SW = 3 - $SW;
+                       }
+               }
+               define('__COUNTRY_ROWS'  , $OUT);
+               define('__COUNTRY_MODE'  , $post);
+               define('__COUNTRY_CLASS' , $class);
+               define('__COUNTRY_SUBMIT', $submit);
+               define('__COUNTRY_TITLE' , $title);
+               define('__COUNTRY_RESET' , $reset);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_list_country_form");
+       }
+}
+ else
+{
+       // Shall we modify / remove entries now?
+       $MSG = ""; $SQLs = array();
+       if ((isset($_POST['modify'])) && (!empty($_POST['id'])))
+       {
+               // Modify
+               foreach ($_POST['id'] as $id => $sel)
+               {
+                       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_countries SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1";
+               }
+
+               // Create message
+               $MSG = ADMIN_COUNTRIES_MODIFIED;
+       }
+        elseif ((isset($_POST['remove'])) && (!empty($_POST['id'])))
+       {
+               // Remove
+               $IDs = implode(", ", bigintval($_POST['id']));
+               $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_countries WHERE id IN (".$IDs.") LIMIT ".count($_POST['id'])."";
+
+               // Create message
+               $MSG = ADMIN_COUNTRIES_REMOVED;
+       }
+
+       if ((!empty($MSG)) && (count($SQLs) > 0))
+       {
+               // Run SQL commands
+               foreach ($SQLs as $sql)
+               {
+                       $result = SQL_QUERY($sql, __FILE__, __LINE__);
+               }
+
+               // Display message
+               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+               OUTPUT_HTML("<br />");
+       }
+
+       // Load currenty setup country codes to list
+       $result = SQL_QUERY("SELECT id, code, descr, is_active FROM "._MYSQL_PREFIX."_countries ORDER BY code", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List all countries
+               $OUT = ""; $SW = 2;
+               while(list($id, $code, $descr, $active) = SQL_FETCHROW($result))
+               {
+                       // Prepare array for the template
+                       $content = array(
+                               'id'     => $id,
+                               'code'   => $code,
+                               'name'   => $descr,
+                               'active' => TRANSLATE_YESNO($active),
+                               'sw'     => $SW,
+                               'status' => $active,
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_list_country_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default
+               $OUT = LOAD_TEMPLATE("admin_list_country_no_row", true);
+       }
+
+       // Add list to constant for the template
+       define('__COUNTRY_ROWS', $OUT);
+
+       // Include add template
+       define('__ADD_COUNTRY_FORM', LOAD_TEMPLATE("admin_add_country", true));
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_country");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_doubler.php b/inc/modules/admin/what-list_doubler.php
new file mode 100644 (file)
index 0000000..0d49da2
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_doubler.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List doubler entries                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verdoppler-Eintraege auflisten                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (empty($_GET['mode'])) {
+       // Chosse the overview page as default
+       $_GET['mode'] = "overview";
+} else {
+       // Set table title automatically
+       if (empty($_GET['select'])) $_GET['select'] = "all";
+       $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."', ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."_".strtoupper($_GET['select']).");";
+       eval($eval);
+}
+
+// Load data for the template
+switch ($_GET['mode'])
+{
+case "already":  // Already payed out points
+       break;
+
+case "overview": // General overview page
+       $SUM_ALREADY = 0; $SUM_WAITING = 0;
+       // Number of direct already payouts and referral
+       $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__);
+       list($cnt) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if ((empty($cnt)) || ($cnt == "0"))
+       {
+               // Nothing payed out so far
+               define('__DOUBLER_ALREADY_DIRECT_LINK', "0");
+       }
+        else
+       {
+               // Something was payed out
+               $SUM_ALREADY += $cnt;
+               define('__DOUBLER_ALREADY_DIRECT_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=direct\">".$cnt."</A>");
+       }
+       $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__);
+       list($cnt) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if ((empty($cnt)) || ($cnt == "0"))
+       {
+               // Nothing payed out so far
+               define('__DOUBLER_ALREADY_REF_LINK', "0");
+       }
+        else
+       {
+               // Something was payed out
+               $SUM_ALREADY += $cnt;
+               define('__DOUBLER_ALREADY_REF_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=ref\">".$cnt."</A>");
+       }
+       define('__DOUBLER_ALREADY_ALL_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=all\">".$SUM_ALREADY."</A>");
+
+       // And the same for waiting pouts (direct and referral)
+       $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__);
+       list($cnt) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if ((empty($cnt)) || ($cnt == "0"))
+       {
+               // Nothing payed out so far
+               define('__DOUBLER_WAITING_DIRECT_LINK', "0");
+       }
+        else
+       {
+               // Something was payed out
+               $SUM_WAITING += $cnt;
+               define('__DOUBLER_WAITING_DIRECT_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=direct\">".$cnt."</A>");
+       }
+       $result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__);
+       list($cnt) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if ((empty($cnt)) || ($cnt == "0"))
+       {
+               // Nothing payed out so far
+               define('__DOUBLER_WAITING_REF_LINK', "0");
+       }
+        else
+       {
+               // Something was payed out
+               $SUM_WAITING += $cnt;
+               define('__DOUBLER_WAITING_REF_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=ref\">".$cnt."</A>");
+       }
+       define('__DOUBLER_WAITING_ALL_LINK', "<A href=\"".URL."/modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=all\">".$SUM_WAITING."</A>");
+
+       // All data is loaded here...
+       break;
+}
+
+// Load mode template
+LOAD_TEMPLATE("admin_list_doubler_".$_GET['mode']);
+
+//
+?>
diff --git a/inc/modules/admin/what-list_holiday.php b/inc/modules/admin/what-list_holiday.php
new file mode 100644 (file)
index 0000000..6ad367a
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 08/01/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_holiday.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List all holiday requests                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Urlaubsschaltungen auflisten                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Start listing holiday requests
+$result = SQL_QUERY("SELECT h.id, h.userid, h.holiday_start, h.holiday_end, h.comments, d.status, d.last_online FROM "._MYSQL_PREFIX."_user_holidays AS h, "._MYSQL_PREFIX."_user_data AS d WHERE h.userid=d.userid ORDER BY h.userid", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // List all holiday requests
+       $SW = 2; $OUT = "";
+       while (list($id, $uid, $start, $end, $comments, $status, $last) = SQL_FETCHROW($result))
+       {
+               // Add three dashes to comment when it is empty
+               if (empty($comments)) $comments = "---";
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'       => $SW,
+                       'id'       => $id,
+                       'uid'      => ADMIN_USER_PROFILE_LINK($uid),
+                       'start'    => MAKE_DATETIME($start, "3"),
+                       'end'      => MAKE_DATETIME($end, "3"),
+                       'comments' => wordwrap($comments, 15),
+                       'status'   => TRANSLATE_STATUS($status),
+                       'last'     => MAKE_DATETIME($last, "3"),
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_list_holiday_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__HOLIDAY_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_holiday");
+}
+ else
+{
+       // No holiday requests found
+       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_ADMIN_NOTHING_FOUND);
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php
new file mode 100644 (file)
index 0000000..77e5571
--- /dev/null
@@ -0,0 +1,167 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/28/2004 *
+ * ================                             Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_links.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : List unconfirmed mails of a member               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Unbestaetigte Mails eines Mitgliedes auflisten   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("mailid")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (empty($_GET['del'])) $_GET['del'] = "";
+
+if (!empty($_GET['u_id'])) {
+       // Check if the user already exists
+       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+
+        // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Loads surname, family's name and the email address
+               list($sname, $fname, $email) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Grab user's all unconfirmed mails
+               if (EXT_IS_ACTIVE("bonus")) {
+                       // Load bonus ID
+                       $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY id",
+                        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+               } else {
+                       // Load stats ID (2nd will be ignored later! But it is needed for the same fetchrow command)
+                       $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY id",
+                        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+               }
+
+               // Get number of rows from the query
+               $nums = SQL_NUMROWS($result);
+
+               if ($nums > 0) {
+                       // Some unconfirmed mails left
+                       if ($_GET['del'] == "all") {
+                               // Delete all unconfirmed mails by this user
+                               $result_del = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s LIMIT %s",
+                                array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__);
+
+                               // Prepare mail and send it away
+                               $msg = LOAD_EMAIL_TEMPLATE("admin-del_links", $nums, bigintval($_GET['u_id']));
+                               SEND_EMAIL($email, ADMIN_DEL_LINK_SUBJ, $msg);
+
+                               // Display message
+                               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LINKS_DELETED);
+                       } else {
+                               // List all unconfirmed mails
+                               $SW = 2; $OUT = "";
+                               while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
+                                       // Load data from stats table...
+                                       $cat = "";
+                                       switch ($type)
+                                       {
+                                       case "NORMAL":
+                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
+                                                array(bigintval($id)), __FILE__, __LINE__);
+                                               $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
+                                               $LINK = "<A href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&amp;mailid=".$id."\" target=\"_blank\">".$id."</A>";
+                                               break;
+
+                                       case "BONUS":
+                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+                                                array(bigintval($id2)), __FILE__, __LINE__);
+                                               $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
+                                               $LINK = "<A href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&amp;bonusid=".$id2."\" target=\"_blank\">".$id2."</A>";
+                                               break;
+                                       }
+
+                                       if (SQL_NUMROWS($result_data) == 1) {
+                                               // Mail was found!
+                                               list($subject, $timestamp, $cat) = SQL_FETCHROW($result_data);
+                                               SQL_FREERESULT($result_data);
+                                               if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE;
+
+                                               // Prepare data for the row template
+                                               $content = array(
+                                                       'sw'    => $SW,
+                                                       'link'  => $LINK,
+                                                       'subj'  => $subject,
+                                                       'stamp' => MAKE_DATETIME($timestamp, "0"),
+                                                       'cat'   => GET_CATEGORY($cat),
+                                               );
+
+                                               // Load row template
+                                               $OUT .= LOAD_TEMPLATE("admin_list_links_row", true, $content);
+                                       } else {
+                                               // Load template for error
+                                               $OUT .= LOAD_TEMPLATE("admin_list_links_problem",
+                                                       array(
+                                                               'sw'            => $SW,
+                                                               'problem'       => $PROBLEM,
+                                                               'data'          => $DATA
+                                                       )
+                                               );
+                                       }
+                                       $SW = 3 - $SW;
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Remember list in constant for the template
+                               define('__SNAME_VALUE', $sname);
+                               define('__FNAME_VALUE', $fname);
+                               define('__EMAIL_VALUE', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>");
+                               define('__EMAIL_LIST' , $OUT);
+                               define('__NUMS_VALUE' , $nums);
+                               define('__UID_VALUE'  , $_GET['u_id']);
+
+                               // Load final template
+                               LOAD_TEMPLATE("admin_list_links");
+                       }
+               } else {
+                       // No mails left to confirm
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_LINKS_1.$_GET['u_id'].ADMIN_MEMBER_LINKS_2);
+               }
+       } else {
+               // User not found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2);
+       }
+} else {
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_newsletter.php b/inc/modules/admin/what-list_newsletter.php
new file mode 100644 (file)
index 0000000..ae6054f
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/04/2005 *
+ * ===============                              Last change: 03/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_newsletter.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Handle HTML or text newsletter                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verwalten von HTML- oder Text-Newslettern        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if ((!empty($_POST['uid'])) && (!empty($_POST['id'])))
+{
+       // Update database...
+       // First user's account
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_until='".time()."+nl_timespan', nl_receive='N', nl_timespan='0' WHERE userid=%s LIMIT 1",
+        array(bigintval($_POST['uid'])), __FILE__, __LINE__);
+
+       // Next the task system...
+       ADMIN_SOLVE_TASK($_POST['id']);
+
+       // Send mail to user
+       $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_done", true, bigintval($_POST['uid']));
+       SEND_EMAIL(bigintval($_POST['uid']), NL_MEMBER_DONE_SUBJECT, $msg);
+
+       // Output message to admin
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_MEMBER_DONE);
+}
+ else
+{
+       // Currently under construction!
+       LOAD_TEMPLATE("admin_settings_saved", false, UNDER_CONSTRUCTION);
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_norefs.php b/inc/modules/admin/what-list_norefs.php
new file mode 100644 (file)
index 0000000..94b8f90
--- /dev/null
@@ -0,0 +1,190 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/19/2006 *
+ * ================                             Last change: 01/19/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_norefs.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Show all members w/o a referral                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Mitgliederaccounts ohne Werber auflisten    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("user")) || (GET_EXT_VERSION("user") == "")) {
+       // Not active!
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "user"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$MORE = ", userid"; $colspan = "4"; //                 27
+if (EXT_IS_ACTIVE("nickname")) { $MORE = ", nickname"; }
+
+if (empty($_GET['letter'])) { $_GET['letter'] = _ALL2;    }
+if (empty($_GET['sortby'])) { $_GET['sortby'] = "userid"; }
+if (empty($_GET['page']))   { $_GET['page']   = "1";      }
+
+// Set base URL
+$BASE = "[<A href=\"".URL."/modules.php?module=admin";
+
+$whereStatement = " WHERE refid=0";
+if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) {
+       // List only persons w
+       $whereStatement = " WHERE refid=0 AND family LIKE '".$_GET['letter']."%'";
+}
+
+// Fix sorter
+if ($_GET['sortby'] == "family_name") $_GET['sortby'] = "family";
+
+// Construct query
+$SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE."
+FROM "._MYSQL_PREFIX."_user_data
+".$whereStatement."
+ORDER BY ".SQL_ESCAPE($_GET['sortby']);
+
+// Start master query
+$result_master = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+// Calculate page count (0.5 fixes a bug with page count)
+$PAGES = round(SQL_NUMROWS($result_master) / $_CONFIG['user_limit'] + 0.5);
+
+if (empty($_GET['page']))   $_GET['page']   = "1";
+if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['user_limit'];
+
+// Add limitation to SQL string and run him again
+$SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
+$result = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+$result_user = SQL_QUERY("SELECT emails_sent FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED'", __FILE__, __LINE__);
+$user_count = SQL_NUMROWS($result_user);
+SQL_FREERESULT($result_user);
+
+if (SQL_NUMROWS($result_master) > 0)
+{
+       // We have some (new?) registrations!
+       define('__COLSPAN1'  , $colspan);
+       define('__COLSPAN2'  , ($colspan + 2));
+       define('__USER_CNT'  , $user_count);
+       define('__ALPHA_SORT', alpha($_GET['sortby'], $colspan, true));
+       define('__SORT_LINKS', SortLinks($_GET['letter'], $_GET['sortby'], $colspan, true));
+       define('__TITLE'     , ADMIN_LIST_NOREFS_ACCOUNTS);
+
+       if ($PAGES > 1) {
+               // Add navigation
+               define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true));
+       } else {
+               // No page navigation is required
+               define('__PAGE_NAV', "");
+       }
+
+       // Column with nickname when nickname extension is present
+       if (EXT_IS_ACTIVE("nickname")) {
+               // Nickname extension found
+               define('__NICKNAME_TH', "  <TD class=\"admin_title bottom2\" align=\"center\">".NICKNAME."</TD>");
+       } else {
+               // Not found
+               define('__NICKNAME_TH', "");
+       }
+
+       $SW = 2; $OUT = "";
+       while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $status, $emails_sent, $mails_confirmed, $emails_received, $nick) = SQL_FETCHROW($result)) {
+               // Get unconfirmed emails
+               $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", "userid", true);
+
+               // Set link to unconfirmed emails
+               if ($LINKS > 0) {
+                       // Translate value
+                       $LINKS = TRANSLATE_COMMA($LINKS);
+
+                       // Add link
+                       $LINKS = $BASE."&amp;what=list_links&amp;u_id=".$uid."\">".$LINKS."</A>]";
+               } // END - if
+
+               // Add nickname
+               if ((empty($nick)) || ($uid == $nick)) $nick = "---";
+
+               // Sent emails
+               $SENT = $emails_sent;
+               if ($emails_sent > 0) $SENT = $BASE."&amp;what=email_details&amp;u_id=".$uid."\">".TRANSLATE_COMMA($emails_sent)."</A>]";
+
+               // Calculate total points
+               $pointsTotal = GET_TOTAL_DATA($uid, "user_points", "points")  - GET_TOTAL_DATA($uid, "user_data", "used_points");
+
+               // Clickrate
+               $clickRate = 0;
+               if ($emails_received > 0) {
+                       $clickRate = $mails_confirmed / $emails_received * 100;
+               } // END - if
+
+               // Transfer data to array
+               $content = array(
+                       'sw'     => $SW,
+                       'uid'    => ADMIN_USER_PROFILE_LINK($uid),
+                       'gender' => TRANSLATE_GENDER($gender),
+                       'sname'  => $sname,
+                       'fname'  => $fname,
+                       'email'  => "[<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>]",
+                       'addr'   => $IP,
+                       'ref'    => $ref,
+                       'status' => TRANSLATE_STATUS($status),
+                       'links'  => $LINKS,
+                       'alinks' => MEMBER_ACTION_LINKS($uid, $status),
+                       'nick'   => $nick,
+                       'points' => TRANSLATE_COMMA($pointsTotal),
+                       'sent'   => $SENT,
+                       'rate'   => TRANSLATE_COMMA($clickRate),
+                       'locked' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"))
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_list_user_row", true, $content);
+               $SW = 3 - $SW;
+       } // END - while
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       define('__USER_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_user");
+
+       // Free some memory
+       SQL_FREERESULT($result_master);
+} else {
+       // No one as registered so far! :-(
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ACCOUNT_NOREFS_404);
+}
+
+// Free memory
+SQL_FREERESULT($result_master);
+
+//
+?>
diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php
new file mode 100644 (file)
index 0000000..0b29fda
--- /dev/null
@@ -0,0 +1,317 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/08/2004 *
+ * ================                             Last change: 08/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_payouts.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List member's payout requests                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflistung der Auszahlungsanfragen               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['pid']))
+{
+       // First let's get the member's ID
+       $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
+        array($_GET['pid']), __FILE__, __LINE__);
+       list($uid, $tuid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Obtain some data
+       if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0)) {
+               // Get task ID from database
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
+                array(bigintval($uid)), __FILE__, __LINE__);
+               list($task) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+               if (empty($task)) $task = 0;
+       } elseif ((empty($uid)) || ($uid == "0")) {
+               // Cannot obtain member ID!
+               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERID);
+       } else {
+               // Get task ID from URL
+               $task = $_GET['task'];
+       }
+
+       if ((!empty($task)) && (!empty($uid)) && ($uid > 0)) {
+               // Load user's data
+               $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(bigintval($uid)), __FILE__, __LINE__);
+               list($email, $gender, $surname, $family) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Konstante bauen
+               define('PAYOUT_USERDATA_VALUE', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$surname." ".$family."</A>");
+
+               if (($_GET['do'] == "accept") && (!empty($email)))
+               {
+                       // Ok, now we can output the form or execute accepting
+                       if (isset($_POST['ok']))
+                       {
+                               // Obtain payout type and other data
+                               $result = SQL_QUERY_ESC("SELECT payout_id FROM "._MYSQL_PREFIX."_user_payouts WHERE id=%s LIMIT 1",
+                                array(bigintval($_GET['pid'])), __FILE__, __LINE__);
+                               list($ptype) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               if (!empty($ptype))
+                               {
+                                       // Obtain data from payout type
+                                       $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
+                                        array(bigintval($ptype)), __FILE__, __LINE__);
+                                       list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+
+                                       if (!empty($eurl))
+                                       {
+                                               // Ok, run URL...
+                                               $eurl = COMPILE_CODE($eurl);
+                                               switch ($eenc)
+                                               {
+                                               case "md5":
+                                                       $fpass = md5($fpass);
+                                                       $tpass = md5($tpass);
+                                                       break;
+
+                                               case "base64":
+                                                       $fpass = base64_encode($fpass);
+                                                       $tpass = base64_encode($tpass);
+                                                       break;
+                                               }
+
+                                               // Transfer variables...
+                                               $eval = "\$URL = \"".$eurl."\";";
+                                               $reason = urlencode(base64_encode(PAYOUT_REASON_PAYOUT));
+
+                                               // Run code...
+                                               eval($eval);
+
+                                               // Execute transfer
+                                               $ret = @file($URL);
+                                       }
+                                        else
+                                       {
+                                               // No URL to run
+                                               $ret[0] = $eok;
+                                       }
+                                       if ($ret[0] == $eok)
+                                       {
+                                               // Clear task
+                                               if ($task > 0) {
+                                                       ADMIN_SOLVE_TASK($task);
+                                               }
+
+                                               // Clear payout request
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='ACCEPTED' WHERE id=%s LIMIT 1",
+                                                array(bigintval($_GET['pid'])), __FILE__, __LINE__);
+
+                                               // Send out mail
+                                               $msg = LOAD_EMAIL_TEMPLATE("member_payout_accepted", $_POST['text'], $uid);
+
+                                               // Output message
+                                               if ($allow == "Y")
+                                               {
+                                                       // Banner / Textlink request
+                                                       LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_BANNER_ACCEPTED_NOTIFIED);
+                                               }
+                                                else
+                                               {
+                                                       // Normal request
+                                                       LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ACCEPTED_NOTIFIED);
+                                               }
+
+                                               // Finally send mail
+                                               SEND_EMAIL($email, PAYOUT_ACCEPTED_SUBJECT, $msg);
+                                       }
+                                        else
+                                       {
+                                               // Something goes wrong... :-(
+                                               $content = implode("<br />", $ret);
+                                               LOAD_TEMPLATE("admin_payout_failed_transfer", false, $content);
+                                       }
+                               }
+                                else
+                               {
+                                       // Cannot load payout id
+                                       OUTPUT_HTML("<STRONG class=\"admin_failed\">".PAYOUT_FAILED_OBTAIN_PAYOUT_ID."</STRONG>");
+                               }
+                       }
+                        else
+                       {
+                               // Load template
+                               LOAD_TEMPLATE("admin_payout_accept_form", false, $task);
+                       }
+               }
+                elseif (($_GET['do'] == "reject") && (!empty($email)))
+               {
+                       // Ok, now we can output the form or execute rejecting
+                       if (isset($_POST['ok']))
+                       {
+                               if ($task > 0) {
+                                       // Clear task
+                                       ADMIN_SOLVE_TASK($task);
+                               }
+
+                               // Clear payout request
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_payouts SET status='REJECTED' WHERE id=%s LIMIT 1",
+                                array(bigintval($_GET['pid'])), __FILE__, __LINE__);
+
+                               // Send out mail
+                               $msg = LOAD_EMAIL_TEMPLATE("member_payout_rejected", $_POST['text'], $uid);
+
+                               // Output message
+                               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_REJECTED_NOTIFIED);
+
+                               // Finally send mail
+                               SEND_EMAIL($email, PAYOUT_REJECTED_SUBJECT, $msg);
+                       }
+                        else
+                       {
+                               // Load template
+                               LOAD_TEMPLATE("admin_payout_reject_form", false, $task);
+                       }
+               }
+                else
+               {
+                       // Cannot load user data
+                       LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERDATA);
+               }
+       }
+        elseif((empty($task)) || ($task == "0"))
+       {
+               // Failed loading task ID
+               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_TASK_ID);
+       }
+}
+ else
+{
+       if (empty($_GET['do'])) $_GET['do'] = "";
+       if ($_GET['do'] == "delete")
+       {
+               // Delete all requests
+               $result = SQL_QUERY("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_payouts", __FILE__, __LINE__);
+       }
+
+       // Search for payouts
+       $result = SQL_QUERY("SELECT p.id, p.userid AS uid, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text AS alt, p.banner_url AS banner
+FROM "._MYSQL_PREFIX."_user_payouts AS p, "._MYSQL_PREFIX."_payout_types AS t
+WHERE p.payout_id=t.id
+ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List found payouts
+               $OUT = ""; $SW = 2;
+               while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result))
+               {
+                       if ($status == "NEW")
+                       {
+                               // Generate links for direct accepting and rejecting
+                               $status = "<A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts&amp;do=accept&amp;pid=".$pid."\">".PAYOUT_ACCEPT_PAYOUT."</A>&nbsp;|&nbsp;<A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts&amp;do=reject&amp;pid=".$pid."\">".PAYOUT_REJECT_PAYOUT."</A>";
+                       }
+                        else
+                       {
+                               // Translate status
+                               $evl = "\$status = PAYOUT_STATUS_".strtoupper($status).";";
+                               eval($evl);
+                               $status = "<FONT class=\"admin_failed\">".$status."</FONT>";
+                       }
+
+                       // Nothing entered must be secured in member/what-payputs.php !
+                       if ($allow == "Y")
+                       {
+                               // Banner/Textlink views/clicks request
+                               if (!empty($banner))
+                               {
+                                       // Prepare array for the banner
+                                       $content = array(
+                                               'banner' => $banner,
+                                               'alt'    => $alt,
+                                               'url'    => $url,
+                                       );
+
+                                       // Load template for the banner
+                                       $account = LOAD_TEMPLATE("admin_list_payouts_banner", true, $content);
+                               }
+                                else
+                               {
+                                       // Textlink
+                                       $content = array(
+                                               'txt_link' => $alt,
+                                               'txt_url'  => $url,
+                                       );
+                                       $account = LOAD_TEMPLATE("admin_list_payouts_txt", true, $content);
+                               }
+
+                               // Admins can addionally test the URL for framekillers
+                               $bank = "<A href=\"".FRAMETESTER($url)."\" target=\"_blank\">".CLICK_HERE."</A>";
+                       }
+                        else
+                       {
+                               // e-currency payout request
+                               if (empty($account)) $account = "---";
+                               if (empty($bank))    $bank    = "---";
+                       }
+
+                       // Remember data in array for the template
+                       $content = array(
+                               'sw'      => $SW,
+                               'ulink'   => ADMIN_USER_PROFILE_LINK($uid),
+                               'ptype'   => TRANSLATE_COMMA($total)." ".COMPILE_CODE($type),
+                               'account' => $account,
+                               'bank'    => $bank,
+                               'tstamp'  => MAKE_DATETIME($tstamp, "2"),
+                               'status'  => $status,
+                       );
+
+                       // Add row and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_list_payouts_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__PAYOUT_ROWS', $OUT);
+
+               // Load final template
+               LOAD_TEMPLATE("admin_list_payouts");
+       }
+        else
+       {
+               // No payout requests are sent so far
+               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ADMIN_NO_REQUESTS_FOUND);
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_primera.php b/inc/modules/admin/what-list_primera.php
new file mode 100644 (file)
index 0000000..3f7af73
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_primera.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List member's primera requests                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflistung der Wernis-Anfragen                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check for entries
+$result = SQL_QUERY("SELECT id, userid, primera_account, primera_amount, primera_timestamp, primera_type, primera_api_message, primera_api_status FROM "._MYSQL_PREFIX."_user_primera ORDER BY primera_timestamp DESC, id DESC",
+       __FILE__, __LINE__);
+
+// Are there some entries to display?
+if (SQL_NUMROWS($result) > 0) {
+       // List all entries
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Translate some data and add color
+               $content['sw']                                  = $SW;
+               $content['link']                                = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['primera_amount']              = TRANSLATE_COMMA($content['primera_amount']);
+               $content['primera_timestamp']   = MAKE_DATETIME($content['primera_timestamp'], "2");
+               $content['raw_type']                    = strtolower($content['primera_type']);
+               $content['primera_type']                        = PRIMERA_TRANSFER_STATUS($content['primera_type']);
+
+               // Append it and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_list_primera_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_primera_main", false, $OUT);
+} else {
+       // Nothing to display!
+       LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_ADMIN_NO_TRANSFERS);
+}
+
+// Free the result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php
new file mode 100644 (file)
index 0000000..ea81f49
--- /dev/null
@@ -0,0 +1,399 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/29/2004 *
+ * ================                             Last change: 02/11/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_rallyes.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List existing rallyes                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bestehende Rallyes auflisten                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (empty($_GET['sub'])) $_GET['sub'] = "";
+$MSG = "";
+
+// Quick actions on a rallye
+if (isset($_GET['rallye']))
+{
+       // Activate / deactivate
+       $SQL = "";
+       if (isset($_GET['activate']))
+       {
+               switch ($_GET['activate'])
+               {
+               case "1": // Activate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET is_active='Y' WHERE id=%s AND is_active='N' LIMIT 1";
+                       break;
+
+               case "0": // Deactivate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET is_active='N' WHERE id=%s AND is_active='Y' LIMIT 1";
+                       break;
+               }
+       }
+
+       // Automatic notification
+       if (isset($_GET['notify']))
+       {
+               switch ($_GET['notify'])
+               {
+               case "1": // Activate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET send_notify='Y' WHERE id=%s AND send_notify='N' LIMIT 1";
+                       break;
+
+               case "0": // Deactivate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET send_notify='N' WHERE id=%s AND send_notify='Y' LIMIT 1";
+                       break;
+               }
+       }
+
+       // Automatic adding of new members
+       if (isset($_GET['auto']))
+       {
+               switch ($_GET['auto'])
+               {
+               case "1": // Activate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET auto_add_new_user='Y' WHERE id=%s AND auto_add_new_user='N' LIMIT 1";
+                       break;
+
+               case "0": // Deactivate
+                       $SQL = "UPDATE "._MYSQL_PREFIX."_rallye_data SET auto_add_new_user='N' WHERE id=%s AND auto_add_new_user='Y' LIMIT 1";
+                       break;
+               }
+       }
+
+       // Run SQL command
+       if (!empty($SQL))
+       {
+               $result = SQL_QUERY_ESC($SQL, array(bigintval($_GET['rallye'])), __FILE__, __LINE__);
+       }
+}
+ elseif (isset($_POST['remove']))
+{
+       // Delete rallyes
+       $SEL = SELECTION_COUNT($_POST['sel']);
+       if ($SEL > 0)
+       {
+               // Delete selected rallyes and all it's data
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Remove selected rallye entirely...
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s",
+                        array(bigintval($id)), __FILE__, __LINE__);
+               }
+
+               // Output message
+               $MSG = RALLYE_DELETED;
+       }
+        else
+       {
+               // No rallye selected to delete!
+               $MSG = RALLYE_DELETE_NOTHING_SELECTED;
+       }
+}
+ elseif (isset($_POST['change']))
+{
+       // Change rallye
+       $SEL = SELECTION_COUNT($_POST['title']);
+       if ($SEL > 0)
+       {
+               // Change selected rallyes and all it's data
+               foreach ($_POST['title'] as $id => $title)
+               {
+                       // Secure ID number
+                       $id = bigintval($id);
+
+                       // Generate timestamps
+                       $START = mktime($_POST['start_hour'][$id], $_POST['start_min'][$id], $_POST['start_sec'][$id], $_POST['start_month'][$id], $_POST['start_day'][$id], $_POST['start_year'][$id]);
+                       $END   = mktime($_POST['end_hour'][$id]  , $_POST['end_min'][$id]  , $_POST['end_sec'][$id]  , $_POST['end_month'][$id]  , $_POST['end_day'][$id]  , $_POST['end_year'][$id]  );
+
+                       // Update entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET
+title='%s',
+descr='%s',
+template='%s',
+start_time='%s',
+end_time='%s',
+min_users='%s',
+min_prices='%s'
+WHERE id='".$id."' LIMIT 1",
+ array($title, $_POST['descr'][$id], $_POST['templ'][$id], bigintval($START), bigintval($END), bigintval($_POST['min_users'][$id]), bigintval($_POST['min_prices'][$id]), $id),
+ __FILE__, __LINE__);
+               }
+
+               // Output message
+               $MSG = RALLYE_CHANGED;
+       }
+}
+
+if (isset($_POST['edit']))
+{
+       // Check for selections
+       $SEL = SELECTION_COUNT($_POST['sel']);
+       if ($SEL > 0)
+       {
+               // Make all selected and deactivated rallyes editable
+               $SW = 2; $OUT = "";
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Load rallye basic data
+                       $result = SQL_QUERY_ESC("SELECT title, descr, template, start_time, end_time, min_users, min_prices FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       list($title, $descr, $templ, $start, $end, $min_users, $min_prices) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Starting day
+                       $content['s_sec']   = ADD_SELECTION("sec"  , date("s", $start), "start", $id);
+                       $content['s_min']   = ADD_SELECTION("min"  , date("i", $start), "start", $id);
+                       $content['s_hour']  = ADD_SELECTION("hour" , date("G", $start), "start", $id);
+                       $content['s_day']   = ADD_SELECTION("day"  , date("d", $start), "start", $id);
+                       $content['s_month'] = ADD_SELECTION("month", date("m", $start), "start", $id);
+                       $content['s_year']  = ADD_SELECTION("year" , date('Y', $start), "start", $id);
+
+                       // Ending day
+                       $content['e_sec']   = ADD_SELECTION("sec"  , date("s", $end)  , "end"  , $id);
+                       $content['e_min']   = ADD_SELECTION("min"  , date("i", $end)  , "end"  , $id);
+                       $content['e_hour']  = ADD_SELECTION("hour" , date("G", $end)  , "end"  , $id);
+                       $content['e_day']   = ADD_SELECTION("day"  , date("d", $end)  , "end"  , $id);
+                       $content['e_month'] = ADD_SELECTION("month", date("m", $end)  , "end"  , $id);
+                       $content['e_year']  = ADD_SELECTION("year" , date('Y', $end)  , "end"  , $id);
+
+                       // Remember over values
+                       $content['templ']      = RALLYE_TEMPLATE_SELECTION("templ[".$id."]", $templ);
+                       $content['sw']         = $SW;
+                       $content['id']         = $id;
+                       $content['title']      = $title;
+                       $content['descr']      = $descr;
+                       $content['min_users']  = $min_users;
+                       $content['min_prices'] = $min_prices;
+
+                       // Output row
+                       $OUT .= LOAD_TEMPLATE("admin_edit_rallyes_row", true, $content);
+
+                       // Color switching
+                       $SW = 3 - $SW;
+               }
+               // Remember rows in constant
+               define('__RALLYE_ROWS', $OUT);
+
+               // Load final template
+               LOAD_TEMPLATE("admin_edit_rallyes");
+       }
+        else
+       {
+               // Nothing selected to edit
+               LOAD_TEMPLATE("admin_settings_saved", false, LOAD_TEMPLATE("admin_list_rallye_noselect", true));
+       }
+}
+ elseif (($_GET['sub'] == "users") && ($_GET['rallye'] > 0))
+{
+       // List users and their refs before start and current
+       $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s ORDER BY userid",
+        array(bigintval($_GET['rallye'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               $SW = 2; $OUT = "";
+               define('__RALLYE_VALUE', $_GET['rallye']);
+               while (list($uid, $old, $opoints) = SQL_FETCHROW($result))
+               {
+                       // Check for referral count
+                       $cnt = RALLYE_GET_REFCOUNT($uid, $old);
+
+                       // Output row
+                       $Bl = ""; $Br = "";
+                       if (($opoints > 0) && ($cnt > 0)) { $Bl = "<STRONG>"; $Br = "</STRONG>"; }
+                       if (($old > 0) || ($cnt > 0))
+                       {
+                               // Insert link to referral list
+                               //* DEBUG: */ echo "-".$uid."/".$cnt."/".$old."-<br />";
+                               $cnt = ADMIN_USER_PROFILE_LINK($uid, $cnt, "list_refs");
+                               $old = ADMIN_USER_PROFILE_LINK($uid, $old, "list_refs");
+                       }
+                       $content = array(
+                               'sw'      => $SW ,
+                               'uid'     => $uid,
+                               'bold_l'  => $Bl ,
+                               'bold_r'  => $Br ,
+                               'old'     => $old,
+                               'cnt'     => $cnt,
+                               'opoints' => TRANSLATE_COMMA($opoints),
+                       );
+                       $OUT .= LOAD_TEMPLATE("admin_list_rallye_usr_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__RALLYE_USER_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_list_rallye_usr");
+       }
+        else
+       {
+               // No entries found?
+               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_ADMIN_USERS_404);
+       }
+}
+ else
+{
+       // Start listing rallyes
+       $result = SQL_QUERY("SELECT id, admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify, notified, min_users, min_prices
+FROM "._MYSQL_PREFIX."_rallye_data
+ORDER BY start_time DESC",
+ __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // List found rallyes
+               $SW = 2; $OUT = "";
+               while (list($id, $aid, $title, $descr, $templ, $start, $end, $auto_add, $active, $notify, $notified, $min_users, $min_prices) = SQL_FETCHROW($result))
+               {
+                       // Load admin login
+                       $alogin = GET_ADMIN_LOGIN($aid);
+
+                       // Count assigned prices
+                       $result_prices = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s",
+                        array(bigintval($id)), __FILE__, __LINE__);
+
+                       // Count joined userids
+                       $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s",
+                        array($id), __FILE__, __LINE__);
+                       $joined = SQL_NUMROWS($result_user);
+
+                       // Did some users joined this rallye?
+                       if ($joined > 0)
+                       {
+                               // List joined users
+                               $joined = "<A href=\"".URL."/modules.php?module=admin&amp;what=list_rallyes&amp;sub=users&amp;rallye=".$id."\" title=\"".RALLYE_LIST_USERS."\">".$joined."</A>";
+                       }
+
+                       // Alter some variables
+                       if (empty($alogin)) $alogin = "???";
+                       if (empty($templ))  $templ  = "---";
+                       if (empty($descr))  $descr  = "---";
+
+                       // Transfer data into array for the template
+                       $content = array(
+                               'select'     => "<INPUT type=\"checkbox\" name=\"sel[".$id."]\" class=\"admin_normal\" value=\"1\">",
+                               'aid'        => $aid,
+                               'email_link' => CREATE_EMAIL_LINK($aid),
+                               'alogin'     => $alogin,
+                               'id'         => $id,
+                               'sw'         => $SW,
+                               'title'      => $title,
+                               'template'   => $templ,
+                               'joined'     => $joined,
+                               'start_date' => MAKE_DATETIME($start, "2"),
+                               'end_date'   => MAKE_DATETIME($end  , "2"),
+                               'active_lnk' => TRANSLATE_YESNO($active),
+                               'notify_lnk' => TRANSLATE_YESNO($notify),
+                               'auto_lnk'   => TRANSLATE_YESNO($auto_add),
+                               'notified'   => TRANSLATE_YESNO($notified),
+                               'prices_cnt' => SQL_NUMROWS($result_prices),
+                               'descr'      => COMPILE_CODE($descr),
+                               'min_users'  => $min_users,
+                               'min_prices' => $min_prices,
+                       );
+
+                       // Free memory
+                       SQL_FREERESULT($result_prices);
+                       SQL_FREERESULT($result_user);
+
+                       // Is the rallye active or not?
+                       switch ($active)
+                       {
+                       case 'Y':
+                               // Rallye is active so do not edit it!
+                               $content['select'] = "<STRONG class=\"big\">".$id."</STRONG>";
+                               $content['active_title'] = RALLYE_DEACTIVATE_NOW;
+                               $content['active'] = 0;
+                               break;
+
+                       case 'N':
+                               $content['active_title'] = RALLYE_ACTIVATE_NOW;
+                               $content['active'] = "1";
+                               break;
+                       }
+
+                       // Notification to members?
+                       switch ($notify)
+                       {
+                       case 'Y':
+                               $content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
+                               $content['notify'] = 0;
+                               break;
+
+                       case 'N':
+                               $content['notify_title'] = RALLYE_START_NOTIFY_NOW;
+                               $content['notify'] = "1";
+                               break;
+                       }
+
+                       // Auto-add of new joined members?
+                       switch ($auto_add)
+                       {
+                       case 'Y':
+                               $content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
+                               $content['auto'] = 0;
+                               break;
+
+                       case 'N':
+                               $content['auto_title'] = RALLYE_START_AUTO_ADD_NOW;
+                               $content['auto'] = "1";
+                               break;
+                       }
+
+                       // Output row
+                       $OUT .= LOAD_TEMPLATE("admin_list_rallyes_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__RALLYE_ROWS', $OUT);
+
+               // Load template
+               LOAD_TEMPLATE("admin_list_rallyes");
+       }
+        else
+       {
+               // No rallyes setup so far
+               LOAD_TEMPLATE("admin_settings_saved", false, RALLYE_NO_RALLYES_SETUP);
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php
new file mode 100644 (file)
index 0000000..83b1760
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/28/2004 *
+ * ================                             Last change: 06/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_refs.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Show all referrals made by a member              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle generierten Refs eines Mitgliedes anzeigen  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ *    Mod created by : Lars Moehlenbruch ( http://www.surfo.net )       *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ *                 Highly modified by Roland Haeder                     *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['u_id'])) {
+       // Check if the user already exists
+       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Load all referal levels
+               $result_levels = SQL_QUERY_ESC("SELECT d.level, d.percents, r.counter
+FROM "._MYSQL_PREFIX."_refdepths AS d
+LEFT JOIN "._MYSQL_PREFIX."_refsystem AS r
+ON d.level=r.level
+WHERE r.userid=%s
+ORDER BY d.level ASC",
+                       array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+
+               // Are there some levels (VERY BAD IF NONE!)
+               if (SQL_NUMROWS($result_levels) > 0) {
+                       // List all ref levels
+                       $OUT = ""; $SW = 2;
+                       while ($levels = SQL_FETCHARRAY($result_levels)) {
+                               // Insert more data
+                               $levels['sw']    = $SW;
+                               $levels['level'] = ($levels['level'] + 1);
+
+                               // Load all refs of this user
+                               //$result_refs = SQL_QUERY_ESC("SELECT 
+                               // Load level template
+                               $OUT .= LOAD_TEMPLATE("admin_list_refs_level", true, $levels);
+
+                               // Switch colors
+                               $SW = 3 - $SW;
+                       } // END - if
+
+                       // Prepare content
+                       $content = array(
+                               'rows' => $OUT,
+                               'uid'  => ADMIN_USER_PROFILE_LINK($_GET['u_id'])
+                       );
+
+                       // Load mein template
+                       LOAD_TEMPLATE("admin_list_refs", false, $content);
+               } else {
+                       // No levels found, very bad!
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_REF_LEVELS);
+               }
+
+               // Free result
+               SQL_FREERESULT($result_levels);
+       } else {
+               // User not found
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_MEMBER_404, $_GET['u_id']));
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+} else {
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php
new file mode 100644 (file)
index 0000000..5671077
--- /dev/null
@@ -0,0 +1,180 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/25/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_sponsor.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : List all sponsors and their details              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Sponsoren und deren Details auflisten       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['id'])) {
+       // Show detailed informations to a sponsor
+       $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, status, sponsor_created, last_online, last_change, receive_warnings, points_amount, points_used, remote_addr, warning_interval, refid, ref_count
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' LIMIT 1",
+ array(bigintval($_GET['id'])), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) == 1) {
+               // Load sponsor details
+               $DATA = SQL_FETCHARRAY($result);
+               SQL_FREERESULT($result);
+
+               // Check if an entry is empty
+               foreach ($DATA as $k => $v) {
+                       if (empty($v)) $DATA[$k] = "---";
+               }
+
+               // Check for sponsor's orders (only count)
+               $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_sponsor_orders WHERE sponsorid='%s'",
+                array(bigintval($_GET['id'])), __FILE__, __LINE__);
+               list($orders) = SQL_FETCHROW($result_orders);
+               SQL_FREERESULT($result_orders);
+               if (empty($orders)) $orders = 0;
+
+               // Prepare all data for the template
+               //  Sponsor's ID
+               define('__SPONSOR_ID'         , $_GET['id']);
+               //  Company's data
+               define('__SPONSOR_COMPANY'    , $DATA['company']);
+               define('__SPONSOR_POSITION'   , $DATA['position']);
+               define('__SPONSOR_TAX_IDENT'  , $DATA['tax_ident']);
+               //  Personal data
+               define('__SPONSOR_GENDER'      , TRANSLATE_GENDER($DATA['gender']));
+               define('__SPONSOR_SURNAME'    , $DATA['surname']);
+               define('__SPONSOR_FAMILY'     , $DATA['family']);
+               define('__SPONSOR_STREET1'    , $DATA['street_nr1']);
+               define('__SPONSOR_STREET2'    , $DATA['street_nr2']);
+               define('__SPONSOR_ZIP'        , $DATA['zip']);
+               define('__SPONSOR_CITY'       , $DATA['city']);
+               define('__SPONSOR_COUNTRY'    , $DATA['country']);
+               //  Contact data
+               define('__SPONSOR_PHONE'      , $DATA['phone']);
+               define('__SPONSOR_FAX'        , $DATA['fax']);
+               define('__SPONSOR_CELL'       , $DATA['cell']);
+               define('__SPONSOR_EMAIL'      , "mailto:".$DATA['email']);
+               define('__SPONSOR_EMAIL_VALUE', $DATA['email']);
+               define('__SPONSOR_URL'        , DEREFERER($DATA['url']));
+               //  Timestamps
+               define('__SPONSOR_CREATED'    , MAKE_DATETIME($DATA['sponsor_created'], "2"));
+               define('__SPONSOR_LAST_ONLINE', MAKE_DATETIME($DATA['last_online'], "2"));
+               define('__SPONSOR_LAST_CHANGE', MAKE_DATETIME($DATA['last_change'], "2"));
+               //  Sponsor points
+               define('__SPONSOR_AMOUNT'     , TRANSLATE_COMMA($DATA['points_amount']));
+               define('__SPONSOR_USED'       , TRANSLATE_COMMA($DATA['points_used']));
+               //  Warning because low points
+               define('__SPONSOR_REC_WARNING', TRANSLATE_YESNO($DATA['receive_warnings']));
+               define('__SPONSOR_INTERVAL'   , CREATE_FANCY_TIME($DATA['warning_interval']));
+               //  Orders total
+               define('__SPONSOR_ORDERS'     , $orders);
+               //  Other data
+               define('__SPONSOR_STATUS'     , SPONSOR_TRANSLATE_STATUS($DATA['status']));
+               define('__SPONSOR_REFID'      , $DATA['refid']);
+               define('__SPONSOR_REMOTE_ADR' , $DATA['remote_addr']);
+               define('__SPONSOR_REFS'       , $DATA['ref_count']);
+
+               // Load template
+               LOAD_TEMPLATE("admin_list_sponsor_details");
+       } else {
+               // Sponsor not found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.$_GET['id'].ADMIN_SPONSOR_404_2);
+       }
+} elseif (!empty($_GET['rid'])) {
+       // Search for sponsor
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+        array(bigintval($_GET['rid'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Sponsor found so let's list all his referrals
+               $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr, ref_count
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE refid='%s' ORDER BY id",
+ array(bigintval($_GET['rid'])), __FILE__, __LINE__);
+
+               if (SQL_NUMROWS($result) > 0) {
+                       // List refs now
+                       // Free memory
+                       SQL_FREERESULT($result);
+               } else {
+                       // No refs made so far
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."<A href=\"".URL."/modules.php?module=admin&amp;what=list_sponsor&amp;id=".bigintval($_GET['rid'])."\">".bigintval($_GET['rid'])."</A>".ADMIN_SPONSOR_REFS_404_2);
+               }
+       } else {
+               // Sponsor not found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.bigintval($_GET['rid']).ADMIN_SPONSOR_404_2);
+       }
+} else {
+       // List all sponsors
+       $result_main = SQL_QUERY("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr
+FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) > 0) {
+               // At least one sponsor found!
+               $OUT = ""; $SW = 2;
+               while(list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) {
+                       // Transfer data to array
+                       $content = array(
+                               'id'      => $id,
+                               'sw'      => $SW,
+                               'gender'   => TRANSLATE_GENDER($gender),
+                               'sname'   => $sname,
+                               'fname'   => $fname,
+                               'email'   => "mailto:".$email,
+                               'status'  => SPONSOR_TRANSLATE_STATUS($status),
+                               'created' => MAKE_DATETIME($created, "2"),
+                               'last'    => MAKE_DATETIME($last, "2"),
+                               'points'  => TRANSLATE_COMMA($amount - $used),
+                               'ip'      => $ip,
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("admin_list_sponsor_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_main);
+               define('__SPONSOR_ROWS', $OUT);
+
+               // Load final template
+               LOAD_TEMPLATE("admin_list_sponsor");
+       } else {
+               // No sponsors registered so far
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_REGISTERED);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php
new file mode 100644 (file)
index 0000000..9f49ed6
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 06/10/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_sponsor_pay.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description : List/edit/delete all payments and add new        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflisten/Aendern/Loeschen aller Buchungspakete  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+$MSG = "";
+
+if (isset($_POST['add'])) {
+       // Check input variables
+       if (empty($_POST['pay_name'])) unset($_POST['add']);
+       if ((round($_POST['pay_rate']) == 0) || (empty($_POST['pay_rate']))) unset($_POST['add']);
+       $_POST['pay_min_count'] = bigintval($_POST['pay_min_count']);
+       if (($_POST['pay_min_count'] == 0) || (empty($_POST['pay_min_count']))) unset($_POST['add']);
+       if (empty($_POST['pay_currency'])) unset($_POST['add']);
+} elseif ((isset($_POST['edit'])) || (isset($_POST['del'])) || (isset($_POST['change'])) || (isset($_POST['remove']))) {
+       // Check if at least one entry was selected
+       if (empty($_POST['id'])) {
+               // Nothing selected for editing / deleting???
+               unset($_POST['edit']);
+               unset($_POST['del']);
+               unset($_POST['change']);
+               unset($_POST['remove']);
+       } elseif (isset($_POST['change'])) {
+               // Change entries here...
+               foreach ($_POST['id'] as $id => $sel) {
+                       // Secure ID
+                       $id = bigintval($id);
+
+                       // Save entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_paytypes
+SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id='%s' LIMIT 1",
+ array($_POST['name'][$id], $_POST['rate'][$id], bigintval($_POST['min'][$id]), $_POST['curr'][$id], $id),
+ __FILE__, __LINE__);
+               }
+
+               // Generate message
+               $MSG = SPONSOR_PAY_ENTRIES_CHANGED;
+       } elseif (isset($_POST['remove'])) {
+               // Remove entries here...
+               foreach ($_POST['id'] as $id => $sel) {
+                       // Remove entry
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
+               }
+
+               // Generate message
+               $MSG = SPONSOR_PAY_ENTRIES_REMOVED;
+       }
+
+       if (!empty($MSG)) {
+               // Output message
+               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+               OUTPUT_HTML("<br />");
+       }
+}
+
+if (isset($_POST['add'])) {
+       // Check if entry with same name does exists
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE pay_name='%s' LIMIT 1",
+        array($_POST['pay_name']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // No entry found so add this line
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_rate, pay_min_count, pay_currency)
+ VALUES ('%s','%s','%s','%s')",
+ array(htmlspecialchars($_POST['pay_name']), str_replace(",", ".", $_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
+ __FILE__, __LINE__);
+
+               // Payment type added!
+               $MSG = SPONSOR_ADMIN_PAYTYPE_ADDED_1.$_POST['pay_name'].SPONSOR_ADMIN_PAYTYPE_ADDED_2;
+       } else {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Entry does already exists
+               $MSG = SPONSOR_ADMIN_PAYTYPE_ALREADY_1.$_POST['pay_name'].SPONSOR_ADMIN_PAYTYPE_ALREADY_2;
+       }
+
+       // Output message
+       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+       OUTPUT_HTML("<br />");
+} elseif ((isset($_POST['edit'])) || (isset($_POST['del']))) {
+       // Load all data
+       $OUT = ""; $SW = 2;
+       foreach ($_POST['id'] as $id => $sel) {
+               // Load entry
+               $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load data
+                       list($name, $rate, $min, $curr) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Transfer data to array
+                       $content = array(
+                               'id'   => bigintval($id),
+                               'sw'   => bigintval($SW),
+                               'name' => htmlspecialchars($name),
+                               'rate' => TRANSLATE_COMMA($rate),
+                               'min'  => bigintval($min),
+                               'curr' => htmlspecialchars($curr)
+                       );
+
+                       if (isset($_POST['edit'])) {
+                               // Edit entry
+                               $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_edit_row", true, $content);
+                       } else {
+                               // Delete entry
+                               $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_del_row", true, $content);
+                       }
+               } else {
+                       // Entry invalid
+                       $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_404", true, $id);
+               }
+
+               // Switch colors
+               $SW = 3 - $SW;
+       }
+
+       // Remember content in constant
+       define('__SPONSOR_ROWS', $OUT);
+
+       // Load main template depending on mode (edit/delete)
+       if (isset($_POST['edit'])) {
+               // Load main edit template
+               LOAD_TEMPLATE("admin_list_sponsor_pay_edit");
+       } else {
+               // Load main delete template
+               LOAD_TEMPLATE("admin_list_sponsor_pay_del");
+       }
+} else {
+       // Load all payment types
+       $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name",
+        __FILE__, __LINE__);
+
+       // Do we have some paytypes setup?
+       if (SQL_NUMROWS($result) > 0) {
+               // Prepare variables for listing
+               $SW = 2; $OUT = "";
+
+               // List alle found payment types
+               while(list($id, $name, $rate, $min, $currency) = SQL_FETCHROW($result)) {
+                       // Remember data in array
+                       $content = array(
+                               'sw'       => $SW,
+                               'id'       => $id,
+                               'name'     => $name,
+                               'rate'     => TRANSLATE_COMMA($rate),
+                               'min'      => $min,
+                               'currency' => $currency
+                       );
+
+                       // Add row
+                       $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_row", true, $content);
+
+                       // Switch colors
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Remember rows in constant for the template
+               define('__LIST_ROWS', $OUT);
+
+               // Load list template
+               define('__LIST_CONTENT', LOAD_TEMPLATE("admin_list_sponsor_pay", true));
+       } else {
+               // Noting setup so far!
+               define('__LIST_CONTENT', LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ADMIN_NO_PAYTYPES));
+       }
+
+       // Add new payment types here
+       define('__ADD_CONTENT', LOAD_TEMPLATE("admin_add_sponsor_paytype", true));
+
+       // Load final template
+       LOAD_TEMPLATE("admin_sponsor_paytypes");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_sponsor_pays.php b/inc/modules/admin/what-list_sponsor_pays.php
new file mode 100644 (file)
index 0000000..b696ee5
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/24/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_sponsor_pays.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit sponsor account                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenaccount aendern                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['id'])) {
+       // Check for selected sponsor
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // ...
+               // Free memory
+               SQL_FREERESULT($result);
+       } else {
+               // Sponsor not found!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_404_1.bigintval($_GET['id']).ADMIN_SPONSOR_404_2);
+       }
+} else {
+       // Not called by what-list_sponsor.php
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php
new file mode 100644 (file)
index 0000000..b1c9f5a
--- /dev/null
@@ -0,0 +1,165 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/31/2008 *
+ * ================                             Last change: 08/31/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_surfbar_urls.php                       *
+ * -------------------------------------------------------------------- *
+ * Short description : List all URLs in surfbar and sync from mail pool *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle URLs in Surfbar auflisten und syncen        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// By default show the list...
+$show = true;
+
+// Edit or delete button hit?
+if (isset($_POST['edit'])) {
+       // Show entries for editing
+       ADMIN_EDIT_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "reward", "costs"),
+               array("bigintval", "ADD_MEMBER_SELECTION_BOX", "", "TRANSLATE_COMMA", "TRANSLATE_COMMA"),
+               array("", array(false, true, true), "", "", "")
+       );
+       $show = false;
+} elseif (isset($_POST['do_edit'])) {
+       // Change data of entries
+       ADMIN_EDIT_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array(),
+               array(),
+               array(),
+               true
+       );
+} elseif (isset($_POST['delete'])) {
+       // Show entries for deletion
+       ADMIN_DELETE_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "registered"),
+               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME"),
+               array("", "", "", "2")
+       );
+       $show = false;
+} elseif (isset($_POST['do_delete'])) {
+       // Remove entries from database
+       ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "surfbar_urls", array(), array(), array(), true);
+} elseif (isset($_POST['lock'])) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       ADMIN_LOCK_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "registered", "status"),
+               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME", "SURFBAR_TRANSLATE_STATUS"),
+               array("", "", "", "2", "")
+       );
+       $show = false;
+} elseif (isset($_POST['do_lock'])) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       ADMIN_LOCK_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array(),
+               array(),
+               array(),
+               array("status" => array("ACTIVE" => "LOCKED", "LOCKED" => "ACTIVE")),
+               true
+       );
+} elseif (isset($_POST['undelete'])) {
+       // Undelete selected URLs. This does only work for deleted URLs... ;-)
+       ADMIN_UNDELETE_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "registered", "status"),
+               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME", "SURFBAR_TRANSLATE_STATUS"),
+               array("", "", "", "2", "")
+       );
+       $show = false;
+} elseif (isset($_POST['do_undelete'])) {
+       // Undelete selected URLs. This does only work for deleted URLs... ;-)
+       ADMIN_UNDELETE_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array(),
+               array(),
+               array(),
+               array("status" => array("DELETED" => "ACTIVE")),
+               true
+       );
+}
+
+// Show entries?
+if (!$show) return false;
+
+// List all URLs
+$result = SQL_QUERY("SELECT id, userid, url, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason
+FROM "._MYSQL_PREFIX."_surfbar_urls
+ORDER BY id ASC", __FILE__, __LINE__);
+
+// Do we have some URLs left?
+if (SQL_NUMROWS($result) > 0) {
+       // List all URLs
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // "Translate"/add content
+               $content['sw']          = $SW;
+               $content['userid']      = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['url']         = FRAMETESTER($content['url']);
+               $content['views_total'] = TRANSLATE_COMMA($content['views_total']);
+               $content['status']      = SURFBAR_TRANSLATE_STATUS($content['status']);
+               $content['registered']  = MAKE_DATETIME($content['registered'], 2);
+               $content['last_locked'] = MAKE_DATETIME($content['last_locked'], 2);
+               if (empty($content['lock_reason'])) $content['lock_reason'] = "---";
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_list_surfbar_urls_row", true, $content);
+
+               // Switch color
+               $SW = 3 - $SW;
+       } // END - while
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_surfbar_urls", false, $OUT);
+} else {
+       // No URLs in surfbar
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_URLS_FOUND);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php
new file mode 100644 (file)
index 0000000..9eb9833
--- /dev/null
@@ -0,0 +1,202 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/03/2004 *
+ * ================                             Last change: 08/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_task.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : List all tasks                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Aufgaben auflisten                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("task")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$whereStatement = "";
+if (empty($_GET['type'])) $_GET['type'] = "your";
+
+switch ($_GET['type'])
+{
+case "your": // List only your own open (new) tasks
+       $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='NEW' AND task_type != 'EXTENSION_UPDATE'";
+       break;
+
+case "updates": // List only updates assigned to you
+       $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='NEW' AND task_type = 'EXTENSION_UPDATE'";
+       break;
+
+case "solved": // List only solved tasks assigned to you
+       $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='SOLVED'";
+       break;
+
+case "unassigned": // List unassigned (but not deleted) tasks
+       $whereStatement = "assigned_admin='0' AND status != 'DELETED'";
+       break;
+
+case "deleted": // List all deleted
+       $whereStatement = "status='DELETED'";
+       break;
+
+case "closed": // List all closed
+       $whereStatement = "assigned_admin='".GET_ADMIN_ID(get_session('admin_login'))."' AND status='CLOSED'";
+       break;
+
+default: // Unknown type
+       LOAD_TEMPLATE("admin_settings_saved", false, TASK_ADMIN_UNKNOWN_MODE_1.$_GET['type'].TASK_ADMIN_UNKNOWN_MODE_2);
+       break;
+}
+
+if (!empty($whereStatement))
+{
+       $SEL = 0;
+       if (isset($_POST['task'])) $SEL = SELECTION_COUNT($_POST['task']);
+       if ((isset($_POST['assign'])) && ($SEL > 0)) {
+               // Assign / do tasks
+               require_once(PATH."inc/modules/admin/overview-inc.php");
+               if (empty($dmy)) $dmy = "";
+               OUTPUT_SELECTED_TASKS($_POST, $dmy);
+       } else {
+               // Start listing tasks matching selected filter
+               $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
+FROM "._MYSQL_PREFIX."_task_system
+WHERE ".$whereStatement."
+ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __LINE__);
+               if (($SEL > 0) && (!IS_DEMO())) {
+                       // Only unassign / delete tasks when there are selected tasks posted
+                       if (isset($_POST['unassign'])) {
+                               // Unassign from tasks
+                               foreach ($_POST['task'] as $id => $sel) {
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1",
+                                        array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__);
+                               }
+                       } elseif (isset($_POST['del'])) {
+                               // Delete tasks
+                               foreach ($_POST['task'] as $id => $sel) {
+                                       if ($_GET['type'] == "deleted") {
+                                               // Delete task immediately
+                                               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE id=%s LIMIT 1",
+                                                array(bigintval($id)),__FILE__, __LINE__);
+                                       } else {
+                                               // Mark task as to be deleted (purged by autppurge extension)
+                                               ADMIN_DELETE_TASK($id);
+                                       }
+                               }
+                       }
+
+                       // Update query
+                       $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM "._MYSQL_PREFIX."_task_system WHERE ".$whereStatement." ORDER BY subject, task_created DESC", __FILE__, __LINE__);
+               }
+
+               // There are uncompleted jobs!
+               $eval = "\$type = ADMIN_OVERVIEW_TASK_".strtoupper($_GET['type'])."_TYPE;";
+               eval($eval);
+               LOAD_TEMPLATE("admin_overview_header_task", false, array(
+                       'message' => $type,
+                       'type'    => $_GET['type']
+               ));
+               $SW = 2;
+               while (list($id, $admin, $uid, $type, $subj, $text, $created) = SQL_FETCHROW($result_tasks))
+               {
+                       $infos = "---";
+                       if ($admin == "0")
+                       {
+                               // No admin currently is assigned
+                               $admin = "<FONT class=\"admin_note\">".ADMIN_NO_ADMIN_ASSIGNED."</FONT>";
+                       }
+                        else
+                       {
+                               // Load admin's data
+                               $login = GET_ADMIN_LOGIN($admin);
+                               if ($login != "***")
+                               {
+                                       // Admin found
+                                       $admin = "<A href=\"".URL."/modules.php?module=admin&amp;what=admins_contct&amp;admin=".$admin."\">".$login."</A>";
+                               }
+                                else
+                               {
+                                       // Maybe deleted?
+                                       $admin = "<FONT class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</FONT>";
+                               }
+                       }
+                       $evl = "\$type_out = ADMIN_TASK_IS_".strtoupper($type).";";
+                       eval($evl);
+                       $type2 = substr($text, 0, strpos($text, ":"));
+                       // Generate infos
+                       switch ($type)
+                       {
+                       case "EXTENSION":
+                       case "EXTENSION_UPDATE":
+                               $infos = substr($subj, 1, strpos($subj, ":") - 1);
+                               break;
+                       }
+                       if ($uid > 0)
+                       {
+                               // Member found otherwise it's a system task
+                               $uid = ADMIN_USER_PROFILE_LINK($uid);
+                       }
+                        else
+                       {
+                               $uid = "<I>".ADMIN_IS_SYSTEM_TASK."</I>";
+                       }
+                       $content = array(
+                               'sw'      => $SW,
+                               'id'      => $id,
+                               'admin'   => $admin,
+                               'infos'   => $infos,
+                               'uid'     => $uid,
+                               'type'    => $type_out,
+                               'created' => MAKE_DATETIME($created, "2")
+                       );
+                       LOAD_TEMPLATE("admin_list_task_rows", false, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_tasks);
+
+               // Load footer template
+               if ($_GET['type'] == "deleted")
+               {
+                       // Delete now button
+                       LOAD_TEMPLATE("admin_overview_footer_task");
+               }
+                else
+               {
+                       // Normal footer
+                       LOAD_TEMPLATE("admin_overview_footer");
+               }
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_transfer.php b/inc/modules/admin/what-list_transfer.php
new file mode 100644 (file)
index 0000000..64b6474
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/07/2004 *
+ * ================                             Last change: 10/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_transfer.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Point transfers                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punktetransfers                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']) || (!IS_ADMIN()))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// We only need outgoing transfers
+$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
+$total = 0;
+if (SQL_NUMROWS($result) > 0)
+{
+       // Output rows
+       $OUT = ""; $SW = 2;
+       while(list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result))
+       {
+               // Prepare data for the row template
+               $content = array(
+                       'sw'        => $SW,
+                       'idx'       => $idx,
+                       'stamp'     => MAKE_DATETIME($stamp, "3"),
+                       'from_link' => ADMIN_USER_PROFILE_LINK($uid1),
+                       'to_link'   => ADMIN_USER_PROFILE_LINK($uid2),
+                       'reason'    => wordwrap($reason, 15),
+                       'points'    => TRANSLATE_COMMA($points),
+               );
+
+               // Load row template add points and switch color
+               $OUT .= LOAD_TEMPLATE("admin_list_transfer_row", true, $content);
+               $total += $points; $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+ else
+{
+       // Nothing for in and out
+       $OUT = "<TR>
+  <TD colspan=\"6\" align=\"center\" class=\"bottom2\" height=\"70\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, TRANSFER_NO_INOUT_TRANSFERS)."
+  </TD>
+</TR>";
+}
+
+// ... and add them to a constant for the template
+define('__TRANSFER_ROWS', $OUT);
+
+// Remeber total amount
+define('__TRANSFER_TOTAL_VALUE', TRANSLATE_COMMA($total));
+
+// Set title
+define('__TRANSFER_TITLE', TRANSFER_LIST_ALL);
+
+// Set "balance" word
+define('__TRANSFER_SUM', TRANSFER_TOTAL_BALANCE);
+
+// Don't show a delete button
+define('__TRANSFER_DELETE', "&nbsp;");
+
+// Load final template
+LOAD_TEMPLATE("admin_list_transfer");
+
+//
+?>
diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php
new file mode 100644 (file)
index 0000000..5b7b11d
--- /dev/null
@@ -0,0 +1,192 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/09/2004 *
+ * ================                             Last change: 10/31/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_unconfirmed.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description : List unconfirmed mail links                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Unbest. Mail-Links auflisten                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("mailid")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Don't load the admin_list_unconfirmed template by default
+$listed = false;
+
+if (!empty($_GET['mid']))
+{
+       // List confirmation links from your member's mail orders
+       define('__LIST_UNCON_TITLE', LIST_UNCONFIRMED_MEMBER_LINKS);
+
+       // SQL query for mail data
+       $SQL = "SELECT DISTINCT s.id, p.sender, p.subject, p.text, p.url, p.timestamp, s.max_rec  FROM "._MYSQL_PREFIX."_pool AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_stats AS s
+ON p.id=s.pool_id
+WHERE p.id='".$_GET['mid']."' LIMIT 1";
+
+       // Column, type and ID for member's mail
+       $col = "stats_id"; $type = "NORMAL"; $ID = "-1";
+
+       // Load admin_list_unconfirmed template
+       $listed = true; $DATA = $_GET['mid']; $LINK = "mailid";
+}
+ elseif ((!empty($_GET['bid'])) && (EXT_IS_ACTIVE("bonus")))
+{
+       // List confirmation links from bonus mails
+       define('__LIST_UNCON_TITLE', LIST_UNCONFIRMED_BONUS_LINKS);
+
+       // SQL query for mail data (both ids are required for compatiblity to above normal mail
+       $SQL = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM "._MYSQL_PREFIX."_bonus WHERE id='".$_GET['bid']."' LIMIT 1";
+
+       // Column, type and ID for member's mail
+       $col = "bonus_id"; $type = "BONUS"; $ID = $_GET['bid'];
+
+       // Load admin_list_unconfirmed template
+       $listed = true; $DATA = $ID; $LINK = "bonusid";
+}
+ else
+{
+       // "Please do not call me directly."
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY);
+}
+
+// Shall I display links or not?
+if ($listed)
+{
+       // Load mail data
+       $result = SQL_QUERY($SQL, __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Mail order / bonus mail found!
+               list($stats_id, $sender, $subj, $text, $url, $stamp, $max) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Transfer data to constants for the template
+               if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
+               if ($col == "bonus_id") $sender = 0;
+               define('__LIST_UNCON_SENDER' , $sender);
+               define('__LIST_UNCON_SUBJECT', COMPILE_CODE($subj));
+               define('__LIST_UNCON_TEXT'   , COMPILE_CODE($text));
+               define('__LIST_UNCON_URL'    , urlencode(base64_encode($url)));
+               define('__LIST_UNCON_STAMP'  , MAKE_DATETIME($stamp, "2"));
+
+               // Load unconfirmed mail links. Hmmm, this select query is pretty cool
+               // but it does only show unconfirmed mail links from existing user
+               // accounts. So if you have delete one you did not see those links
+               //
+               $result = SQL_QUERY_ESC("SELECT DISTINCT l.userid, u.status, u.surname, u.family, u.gender, u.email
+FROM "._MYSQL_PREFIX."_user_links AS l
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS u
+ON l.userid=u.userid
+WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
+ array($col, $ID, bigintval($max)),__FILE__, __LINE__);
+               $unconfirmed = SQL_NUMROWS($result);
+               define('__LIST_UNCO_UNCONFIRMED', $unconfirmed);
+
+               if ($unconfirmed > 0)
+               {
+                       // At least one link left to confirm
+                       $OUT = LOAD_TEMPLATE("admin_list_unconfirmed_header", true);
+                       $SW = 2;
+                       while(list($uid, $status, $sname, $fname, $gender, $email) = SQL_FETCHROW($result))
+                       {
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'     => $SW,
+                                       'u_link' => ADMIN_USER_PROFILE_LINK($uid),
+                                       'uid'    => $uid,
+                                       'link'   => $LINK,
+                                       'id'     => $ID,
+                                       'email'  => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</A>",
+                                       'status' => TRANSLATE_STATUS($status),
+                               );
+
+                               // Load row template and switch colors
+                               $OUT .= LOAD_TEMPLATE("admin_list_unconfirmed_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+                       $OUT .= "</TABLE>\n";
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+
+                       // Store table rows in a constant
+                       define('__LIST_UNCON_LISTING', $OUT);
+               }
+                else
+               {
+                       // All links are confirmed... strange, you shall normally not get a link to this place in this scenario... hmmm.
+                       define('__LIST_UNCON_LISTING', LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_UNCONFIRMED_NO_LINK_LEFT));
+               }
+
+               // Load final template
+               LOAD_TEMPLATE("admin_list_unconfirmed");
+       }
+        elseif ($_GET['mid'] > 0)
+       {
+               // Data in pool or in user_stats not found, so let's find out where data is missing
+               $result1 = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                array(bigintval($ID)), __FILE__, __LINE__);
+               $result2 = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s LIMIT 1",
+                array(bigintval($ID)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result1) == 1)
+               {
+                       // pool table
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_POOL_MISSING_1.$ID.ADMIN_UNCONFIRMED_POOL_MISSING_2);
+               }
+                elseif (SQL_NUMROWS($result2) == 1)
+               {
+                       // user_stats table
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_STATS_MISSING_1.$ID.ADMIN_UNCONFIRMED_STATS_MISSING_2);
+               }
+                else
+               {
+                       // both or link is invalid
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_INVALID_LINK);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result1);
+               SQL_FREERESULT($result2);
+       }
+        elseif (!empty($_GET['bid']))
+       {
+               // Data in bonus table not found
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_INVALID_LINK);
+       }
+}
+//
+?>
diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php
new file mode 100644 (file)
index 0000000..6bf976a
--- /dev/null
@@ -0,0 +1,264 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 08/18/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_user.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : List all or partial members                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle oder nur bestimmte Mitglieder auflisten     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("user")) || (GET_EXT_VERSION("user") == "")) {
+       // Missing extension!
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "user"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Init title with "all accounts"
+$listHeader = ADMIN_ALL_ACCOUNTS;
+if (!empty($_GET['mode'])) {
+       // Set title according to the "mode"
+       $eval = sprintf("\$listHeader = ADMIN_LIST_%s_ACCOUNTS;", strtoupper(SQL_ESCAPE($_GET['mode'])));
+       eval($eval);
+} // END - if
+
+// Remember it
+define('__TITLE', $listHeader);
+
+$MORE = ", userid"; $colspan = "4"; //                 27
+if (EXT_IS_ACTIVE("nickname")) { $MORE = ", nickname"; }
+
+if (empty($_GET['letter'])) { $_GET['letter'] = _ALL2;    }
+if (empty($_GET['sortby'])) { $_GET['sortby'] = "userid"; }
+if (empty($_GET['page']))   { $_GET['page']   = "1";      }
+
+// Set base URL
+$BASE = "[<A href=\"".URL."/modules.php?module=admin";
+
+if (!empty($_GET['u_id'])) {
+       // Secure the user ID
+       $uid = bigintval($_GET['u_id']);
+
+       // Does the account exists?        0      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
+       $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails, receive_mails, refid, status, REMOTE_ADDR, last_online, last_module, ref_clicks, total_logins, used_points, emails_sent, joined, last_update, last_profile_sent, notified, ref_payout".$MORE."
+FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s LIMIT 1",
+        array($uid), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Account found!
+               $DATA  = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               $REFS  = GET_TOTAL_DATA($uid, "refsystem", "counter");
+               $CATS  = GET_TOTAL_DATA($uid, "user_cats", "id", "userid", true);
+               $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", "userid", true);
+
+               if ($LINKS > 0) $LINKS = $BASE."&amp;what=list_links&amp;u_id=".$uid."\">".$LINKS."</A>]";
+               if ($DATA[13] > 0) $DATA[13] = str_replace(("u_id=".$uid), ("u_id=".$DATA[13]), $BASE."&amp;what=list_user\">".$DATA[13]."</A>]");
+               if (empty($DATA[17])) $DATA[17] = "---";
+               if ($REFS > 0) $REFS = $BASE."&amp;what=list_refs&amp;u_id=".$uid."\">".$REFS."</A>]";
+               if ($CATS > 0) $CATS = $BASE."&amp;what=list_cats&amp;u_id=".$uid."\">".$CATS."</A>]";
+
+               // Prepare data for template
+               define('_BIRTHDAY', MAKE_DATETIME(mktime(0, 0, 0, $DATA[9], $DATA[8], $DATA[10]), "3"));
+               define('_REFS' , $REFS);
+               define('_CATS' , $CATS);
+               define('_LINKS', $LINKS);
+               define('_ADMIN_LINKS', MEMBER_ACTION_LINKS($uid, $DATA[14]));
+               $DATA[0]      = TRANSLATE_GENDER($DATA[0]);
+               $DATA[28]     = CREATE_EMAIL_LINK($DATA[7], "user_data");
+               $DATA[14]     = TRANSLATE_STATUS($DATA[14]);
+               $DATA[16]     = MAKE_DATETIME($DATA[16], "0");
+               $DATA[20]     = TRANSLATE_COMMA($DATA[20]);
+               if ($DATA[21] > 0) $DATA[21] = $BASE."&amp;what=email_details&amp;u_id=".$uid."\">".TRANSLATE_COMMA($DATA[21])."</A>]";
+               $DATA[22]     = MAKE_DATETIME($DATA[22], "0");
+               $DATA[23]     = MAKE_DATETIME($DATA[23], "0");
+               $DATA[24]     = MAKE_DATETIME($DATA[24], "0");
+               if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
+               $DATA['total']  = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points"));
+               $DATA['locked'] = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
+
+               if (EXT_IS_ACTIVE("nickname")) {
+                       if ((empty($DATA[27])) || ($DATA[27] == $uid)) $DATA[27] = "---";
+               } else {
+                       $DATA[27] = EXT_NICKNAME_404;
+               }
+
+               // Template laden
+               LOAD_TEMPLATE("admin_user_details", false, $uid);
+       } else {
+               // Account does not exists!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MEMBER_404_1.$uid.ADMIN_MEMBER_404_2);
+       }
+} else {
+       $whereStatement = "";
+       if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) {
+               // List only persons w
+               $whereStatement = " WHERE family LIKE '".$_GET['letter']."%'";
+       } // END - if
+       if ($_GET['sortby'] == "family_name") $_GET['sortby'] = "family";
+
+       // Parse the mode parameter
+       if (isset($_GET['mode'])) {
+               // Is a WHERE statement already there?
+               if (!empty($whereStatement)) {
+                       // Then append the status column
+                       $whereStatement .= sprintf(" AND status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode']))));
+               } else {
+                       // Start a new one
+                       $whereStatement = sprintf(" WHERE status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode']))));
+               }
+       } // END - if
+
+       $SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM "._MYSQL_PREFIX."_user_data".$whereStatement." ORDER BY ".$_GET['sortby'];
+       $result_master = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+       // Calculate page count (0.5 fixes a bug with page count)
+       if ($_CONFIG['user_limit'] == 0) {
+               $_CONFIG['user_limit'] = 100;
+               LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT);
+       } // END - if
+
+       // Activate the extension please!
+       $PAGES = round(SQL_NUMROWS($result_master) / $_CONFIG['user_limit'] + 0.5);
+
+       if (empty($_GET['page']))   $_GET['page']   = "1";
+       if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['user_limit'];
+
+       // Add limitation to SQL string and run him again
+       $SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
+       $result = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+       $result_user = SQL_QUERY("SELECT emails_sent FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED'", __FILE__, __LINE__);
+       $user_count = SQL_NUMROWS($result_user);
+       SQL_FREERESULT($result_user);
+
+       if (SQL_NUMROWS($result_master) > 0) {
+               // Free memory
+               SQL_FREERESULT($result_master);
+
+               // We have some (new?) registrations!
+               define('__COLSPAN1'  , $colspan);
+               define('__COLSPAN2'  , ($colspan + 2));
+               define('__USER_CNT'  , $user_count);
+
+               if ((function_exists('alpha')) && (function_exists('SortLinks'))) {
+                       define('__ALPHA_SORT', alpha($_GET['sortby'], $colspan, true));
+                       define('__SORT_LINKS', SortLinks($_GET['letter'], $_GET['sortby'], $colspan, true));
+               } else {
+                       define('__ALPHA_SORT', "");
+                       define('__SORT_LINKS', "");
+               }
+
+               if ($PAGES > 1) {
+                       define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true));
+               } else {
+                       // No page navigation is required
+                       define('__PAGE_NAV', "");
+               }
+
+               // Column with nickname when nickname extension is present
+               if (EXT_IS_ACTIVE("nickname"))
+               {
+                       // Nickname extension found
+                       define('__NICKNAME_TH', "  <TD class=\"admin_title bottom2\" align=\"center\">".NICKNAME."</TD>");
+               }
+                else
+               {
+                       // Not found
+                       define('__NICKNAME_TH', "");
+               }
+
+               $SW = 2; $OUT = "";
+               while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $status, $emails_sent, $mails_confirmed, $emails_received, $nick) = SQL_FETCHROW($result)) {
+                       if ($ref > 0) $ref = ADMIN_USER_PROFILE_LINK($ref);
+                       $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", "userid", true);
+                       $SENT = $emails_sent;
+                       if ($emails_sent > 0) $SENT = $BASE."&amp;what=email_details&amp;u_id=".$uid."\">".TRANSLATE_COMMA($emails_sent)."</A>]";
+                       if ($LINKS > 0) $LINKS = $BASE."&amp;what=list_links&amp;u_id=".$uid."\">".TRANSLATE_COMMA($LINKS)."</A>]";
+
+                       // Add nickname
+                       if (empty($nick) || $nick == $uid) $nick = "---";
+
+                       // Calculate total points
+                       $pointsTotal = GET_TOTAL_DATA($uid, "user_points", "points")  - GET_TOTAL_DATA($uid, "user_data", "used_points");
+
+                       // Clickrate
+                       $clickRate = 0;
+                       if ($emails_received > 0) {
+                               $clickRate = $mails_confirmed / $emails_received * 100;
+                       } // END - if
+
+                       // Transfer data to array
+                       $content = array(
+                               'sw'     => $SW,
+                               'uid'    => ADMIN_USER_PROFILE_LINK($uid),
+                               'gender' => TRANSLATE_GENDER($gender),
+                               'sname'  => $sname,
+                               'fname'  => $fname,
+                               'email'  => "[<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>]",
+                               'addr'   => $IP,
+                               'ref'    => $ref,
+                               'status' => TRANSLATE_STATUS($status),
+                               'links'  => $LINKS,
+                               'nick'   => $nick,
+                               'alinks' => MEMBER_ACTION_LINKS($uid, $status),
+                               'points' => TRANSLATE_COMMA($pointsTotal),
+                               'sent'   => $SENT,
+                               'rate'   => TRANSLATE_COMMA($clickRate),
+                               'locked' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"))
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_list_user_row", true, $content);
+                       $SW = 3 - $SW;
+               } // END - while
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               define('__USER_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_list_user");
+
+               // Free some memory
+               SQL_FREERESULT($result_master);
+       } else {
+               // No one as registered so far! :-(
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_NONE_REGISTERED);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-list_wernis.php b/inc/modules/admin/what-list_wernis.php
new file mode 100644 (file)
index 0000000..ac0f53b
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 26/12/2007 *
+ * ================                             Last change: 26/12/2007 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_wernis.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : List member's wernis requests                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflistung der Wernis-Anfragen                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check for entries
+$result = SQL_QUERY("SELECT id, userid, wernis_account, wernis_amount, wernis_timestamp, wernis_type, wernis_api_message, wernis_api_status FROM "._MYSQL_PREFIX."_user_wernis ORDER BY wernis_timestamp DESC, id DESC",
+       __FILE__, __LINE__);
+
+// Are there some entries to display?
+if (SQL_NUMROWS($result) > 0) {
+       // List all entries
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Translate some data and add color
+               $content['sw']                                  = $SW;
+               $content['link']                                = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['wernis_amount']               = TRANSLATE_COMMA($content['wernis_amount']);
+               $content['wernis_timestamp']    = MAKE_DATETIME($content['wernis_timestamp'], "2");
+               $content['raw_type']                    = strtolower($content['wernis_type']);
+               $content['wernis_type']                 = WERNIS_TRANSFER_STATUS($content['wernis_type']);
+
+               // Append it and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_list_wernis_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_wernis_main", false, $OUT);
+} else {
+       // Nothing to display!
+       LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_ADMIN_NO_TRANSFERS);
+}
+
+// Free the result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-lock_sponsor.php b/inc/modules/admin/what-lock_sponsor.php
new file mode 100644 (file)
index 0000000..c1aa1cb
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/24/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-lock_sponsor.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit sponsor account                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenaccount aendern                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+$MSG = "";
+
+if (!empty($_GET['id'])) {
+       // Check for selected sponsor
+       $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Get sponsor's current status and let only confirmed and locked status pass
+               list($gender, $sname, $fname, $email, $status) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               if (($status == "CONFIRMED") || ($status == "LOCKED")) {
+                       // Transfer data to constants
+                       define('__GENDER'  , TRANSLATE_GENDER($gender));
+                       define('__SURNAME', $sname);
+                       define('__FAMILY' , $fname);
+                       define('__ID'     , bigintval($_GET['id']));
+
+                       if (isset($_POST['ok'])) {
+                               // Create messages
+                               if ($status == "CONFIRMED") {
+                                       // Message when sponsor's account got lock
+                                       define('__EMAIL_MSG', SPONSOR_ACCOUNT_LOCKED);
+                                       $subject = SPONSOR_SUBJECT_LOCKED;
+                                       $status = "LOCKED";
+                               } else {
+                                       // Message when sponsor's account got unlock
+                                       define('__EMAIL_MSG', SPONSOR_ACCOUNT_UNLOCKED);
+                                       $subject = SPONSOR_SUBJECT_UNLOCKED;
+                                       $status = "CONFIRMED";
+                               }
+
+                               // Load email message
+                               $msg = LOAD_EMAIL_TEMPLATE("lock_sponsor", $_POST['reason'], bigintval($_GET['id']));
+
+                               // And send it away
+                               SEND_EMAIL($email, $subject, $msg);
+
+                               // Update sponsor's account
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='".$status."' WHERE id='%s' LIMIT 1",
+                                array(bigintval($_GET['id'])), __FILE__, __LINE__);
+                       } elseif (!empty($_POST['no'])) {
+                               // No don't lock / unlock now!
+                               LOAD_URL(URL."/modules.php?module=admin&what=list_sponsor&id=".bigintval($_GET['id']));
+                       } else {
+                               // Create header and text messages
+                               if ($status == "CONFIRMED") {
+                                       // Messages when sponsor's account is confirmed
+                                       define('__HEADER_MESSAGE', SPONSOR_LOCK_SPONSOR_HEADER);
+                                       define('__TEXT_MESSAGE'  , SPONSOR_LOCK_SPONSOR_TEXT);
+                               } else {
+                                       // Messages when sponsor's account is locked
+                                       define('__HEADER_MESSAGE', SPONSOR_UNLOCK_SPONSOR_HEADER);
+                                       define('__TEXT_MESSAGE'  , SPONSOR_UNLOCK_SPONSOR_TEXT);
+                               }
+
+                               // Create email link
+                               define('__EMAIL_LINK', "<A href=\"mailto:".$email."\">".__GENDER." ".__SURNAME." ".__FAMILY."</A>");
+
+                               // Display form
+                               LOAD_TEMPLATE("admin_lock_sponsor");
+                       }
+               } else {
+                       // Cannot change status on unconfirmed or pending accounts!
+                       $MSG = ADMIN_SPONSPOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS;
+               }
+       } else {
+               // Sponsor not found!
+               $MSG = ADMIN_SPONSOR_404_1.bigintval($_GET['id']).ADMIN_SPONSOR_404_2;
+       }
+} else {
+       // Not called by what-list_sponsor.php
+       $MSG = ADMIN_CALL_NOT_DIRECTLY;
+}
+
+if (!empty($MSG)) {
+       // Output message
+       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+}
+//
+?>
diff --git a/inc/modules/admin/what-lock_user.php b/inc/modules/admin/what-lock_user.php
new file mode 100644 (file)
index 0000000..6ad2703
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 06/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-lock_user.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Lock members                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder sperren                               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['u_id']))
+{
+       $result_user = SQL_QUERY_ESC("SELECT status, gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+       $ACT = false;
+       if (SQL_NUMROWS($result_user) == 1)
+       {
+               // User found
+               list($status, $gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
+               SQL_FREERESULT($result_user);
+               if (empty($_GET['u_id']))
+               {
+                       // Output selection form with all confirmed user accounts listed
+                       ADD_MEMBER_SELECTION_BOX();
+               } elseif (!empty($_POST['lock'])) {
+                       // Ok, lock the account!
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET status='LOCKED' WHERE userid=%s LIMIT 1",
+                        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+                       if (SQL_AFFECTEDROWS() == 1)
+                       {
+                               // Send an email to the user! In later version you can optionally switch this feature off
+                               $msg = LOAD_EMAIL_TEMPLATE("lock-user", array('text' => $_POST['reason']), bigintval($_GET['u_id']));
+
+                               // Send away...
+                               SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_LOCKED_SUBJ, $msg);
+                       }
+
+                       // Prepare message
+                       $MSG = USER_ACCOUNT_LOCKED_1.$_GET['u_id'].USER_ACCOUNT_LOCKED_2;
+                       $ACT = true;
+               } elseif (!empty($_POST['unlock'])) {
+                       // Ok, unlock the account!
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET status='CONFIRMED' WHERE userid=%s LIMIT 1",
+                        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+                       if (SQL_AFFECTEDROWS() == 1)
+                       {
+                               // Send an email to the user! In later version you can optionally switch this feature off
+                               $msg = LOAD_EMAIL_TEMPLATE("unlock-user", array('text' => $_POST['reason']), bigintval($_GET['u_id']));
+
+                               // Send away...
+                               SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_UNLOCKED_SUBJ, $msg);
+                               if (EXT_IS_ACTIVE("rallye"))
+                               {
+                                       RALLYE_AUTOADD_USER($_GET['u_id']);
+                               }
+                       }
+
+                       // Prepare message
+                       $MSG = USER_ACCOUNT_UNLOCKED_1.$_GET['u_id'].USER_ACCOUNT_UNLOCKED_2;
+                       $ACT = true;
+               }
+                elseif (isset($_POST['del']))
+               {
+                       // Delete the account
+                       $ACT = true;
+                       require_once(PATH."inc/modules/admin/what-del_user.php");
+               }
+                elseif (!empty($_POST['no']))
+               {
+                       // Do not lock him...
+                       $URL = URL."/modules.php?module=admin&amp;what=list_user&amp;u_id=".$_GET['u_id'];
+               }
+                else
+               {
+                       $result = SQL_QUERY_ESC("SELECT email, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                        array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Load data
+                               list ($email, $sname, $fname) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Transfer data to constants for the template
+                               define('__EMAIL', CREATE_EMAIL_LINK($email, "user_data"));
+                               define('__SNAME', $sname);
+                               define('__FNAME', $fname);
+                               define('__UID'  , $_GET['u_id']);
+
+                               // Transfer data to constants for the template
+                               define('__UID_VALUE', $_GET['u_id']);
+
+                               // Realy want to lock?
+                               switch ($status)
+                               {
+                               case "CONFIRMED": // Yes, lock him down... ;-)
+                                       define('__OK_VALUE'    , "lock");
+                                       define('__HEADER_VALUE', ADMIN_HEADER_LOCK_ACCOUNT_1.__UID_VALUE.ADMIN_HEADER_LOCK_ACCOUNT_2);
+                                       define('__TEXT_VALUE'  , ADMIN_TEXT_LOCK_ACCOUNT_1.__UID_VALUE.ADMIN_TEXT_LOCK_ACCOUNT_2);
+                                       break;
+
+                               case "LOCKED": // Unlock the user
+                                       define('__OK_VALUE'    , "unlock");
+                                       define('__HEADER_VALUE', ADMIN_HEADER_UNLOCK_ACCOUNT_1.__UID_VALUE.ADMIN_HEADER_UNLOCK_ACCOUNT_2);
+                                       define('__TEXT_VALUE'  , ADMIN_TEXT_UNLOCK_ACCOUNT_1.__UID_VALUE.ADMIN_TEXT_UNLOCK_ACCOUNT_2);
+                                       break;
+
+                               case "UNCONFIRMED": // Unconfirmed accounts cannot be unlocked!
+                                       define('__OK_VALUE'    , "del");
+                                       define('__HEADER_VALUE', ADMIN_HEADER_DEL_ACCOUNT_1.__UID_VALUE.ADMIN_HEADER_DEL_ACCOUNT_2);
+                                       define('__TEXT_VALUE'  , ADMIN_TEXT_DEL_ACCOUNT_1.__UID_VALUE.ADMIN_TEXT_DEL_ACCOUNT_2);
+                                       break;
+                               }
+
+                               // Output form
+                               LOAD_TEMPLATE("admin_lock_user");
+                       }
+                        else
+                       {
+                               // Account does not exists!
+                               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+                       }
+               }
+               if (!empty($URL))
+               {
+                       // Reload and die...
+                       LOAD_URL($URL);
+               }
+                elseif ($ACT)
+               {
+                       // An action was performed...
+                       if (!empty($MSG))
+                       {
+                               LOAD_TEMPLATE("admin_settings_saved", false, "<STRONG class=\"admin_green\">".$MSG."</STRONG>");
+                       }
+                        else
+                       {
+                               LOAD_TEMPLATE("admin_settings_saved", false, "<STRONG class=\"admin_green\">".ADMIN_USER_UPDATED."</STRONG>");
+                       }
+               }
+       }
+        else
+       {
+               // Account does not exists!
+               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+       }
+} else {
+       // List all users
+       ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php
new file mode 100644 (file)
index 0000000..ff9c943
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/15/2003 *
+ * ===============                              Last change: 04/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-logs.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Management for access log files                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Management fuer Zugriffslogbuecher               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (!empty($_GET['access'])) {
+       // Secure input and construct FQFN
+       $access = SQL_ESCAPE(strip_tags($_GET['access']));
+       $target = sprintf("%slogs/%s", PATH, $access);
+
+       // Is the file valid and readable?
+       if (FILE_READABLE($target)) {
+               // Load it directly
+               $content = implode("", file($target));
+
+               // Set header
+               if (substr($access, -3, 3) == "log") {
+                       header("Content-Type: text/plain");
+               } elseif (substr($access, -3, 3) == ".gz") {
+                       header("Content-Type: text/plain");
+               } else {
+                       LOAD_TEMPLATE("admin_settings_saved", false, UNKNOWN_LOGFILE_FORMAT_1.$access.UNKNOWN_LOGFILE_FORMAT_2);
+                       return;
+               }
+
+               // Clean content
+               ob_end_clean();
+
+               // Output the logfile's content and exit
+               print($content);
+               exit;
+       } else {
+               // Not readable!
+               LOAD_TEMPLATE("admin_settings_saved", false, LOGFILE_NOT_READABLE_1.$access.LOGFILE_NOT_READABLE_2);
+       }
+} else {
+       // List access logfiles
+       $dir = PATH.LOGS_BASE."/";
+       if (is_dir($dir)) {
+               // logs directory does exist
+               OUTPUT_HTML("<OL>");
+               $handle = @opendir($dir) or mxchange_die("Cannot open directory ".LOGS_BASE."!");
+               while($file = @readdir($handle)) {
+                       // We currenly only like files with "access" as prefix, should be more flexible!
+                       if (substr($file, 0, 6) == "access") {
+                               // Okay, let us print it out
+                               OUTPUT_HTML("<LI><A href=\"".URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&access=".urlencode($file)."\">".$file."</A></LI>");
+                       }
+               }
+               @closedir($handle);
+               OUTPUT_HTML("</OL>");
+       }
+        else
+       {
+               // logs directory does not exist
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LOGS_DIR_404_1.LOGS_BASE.ADMIN_LOGS_DIR_404_2);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php
new file mode 100644 (file)
index 0000000..30477e2
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/06/2004 *
+ * ================                             Last change: 05/06/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-maintenance.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : De/activate maintenance mode                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wartungsmodus de/aktivieren                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       // De- or activate maintenance mode
+       switch ($_CONFIG['maintenance'])
+       {
+       case 'Y':
+               $target_mode = "N";
+               $out = ADMIN_MAINTENANCE_DEACTIVATED;
+               break;
+
+       case 'N':
+               $target_mode = "Y";
+               $out = ADMIN_MAINTENANCE_ACTIVATED;
+               break;
+       }
+
+       // Update config
+       UPDATE_CONFIG("maintenance", $target_mode);
+
+       // Load template
+       LOAD_TEMPLATE("admin_settings_saved", false, $out);
+} else {
+       switch ($_CONFIG['maintenance'])
+       {
+       case 'Y': // Maintenance mode is active
+               define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_ACTIVE);
+               break;
+
+       case 'N': // Maintenance mode is inactive
+               define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_INACTIVE);
+               break;
+       }
+       // Display form
+       LOAD_TEMPLATE("admin_maintenance_form");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php
new file mode 100644 (file)
index 0000000..60ff929
--- /dev/null
@@ -0,0 +1,212 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-mem_add.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short desciption : Add new menu for your members                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Fuegen Sie einen weiteren Menuepunkt zum Mit-    *
+ *                     Mitgliedsmenue hinzu                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add desciption as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check if the admin has entered title and what-php file name...
+if ((empty($_POST['title'])) && (isset($_POST['ok'])))
+{
+       unset($_POST['ok']);
+}
+
+if (!isset($_POST['ok']))
+{
+       // Create arrays
+       $menus = array(); $titles = array(); $below = array();
+
+       // Get all available main menus
+       $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Read menu structure
+               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+               {
+                       // Menu actions
+                       $menus[] = $act;
+
+                       // Menu titles
+                       $titles[] = $title;
+
+                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                       $below[] = $sort + 1;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Remove double eintries
+               $prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
+               foreach ($menus as $key => $value)
+               {
+                       if ($value == $prev)
+                       {
+                               // Remove entries
+                               unset($dmy[$key]);
+                               unset($dmy2[$key]);
+                               unset($dmy3[$key]);
+                       }
+                        else
+                       {
+                               $prev = $value;
+                       }
+               }
+               $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+               // Load sub menus :)
+               foreach ($menus as $key_main => $value_main)
+               {
+                       $result = SQL_QUERY_ESC("SELECT what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE action='%s' AND what != '' ORDER BY sort",
+                        array($value_main), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) > 0)
+                       {
+                               // Initialize arrays
+                               $menus[$value_main] = array();
+                               $titles[$value_main] = array();
+                               $below[$value_main] = array();
+
+                               // Read menu structure
+                               while (list($act, $title, $sort) = SQL_FETCHROW($result))
+                               {
+                                       // Menu actions
+                                       $menus[$value_main][] = $act;
+
+                                       // Menu titles
+                                       $titles[$value_main][] = $title;
+
+                                       // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
+                                       $below[$value_main][] = $sort + 1;
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Remove double eintries
+                               $prev = ""; $dmy = $menus[$value_main]; $dmy2 = $titles[$value_main]; $dmy3 = $below[$value_main];
+                               foreach ($menus[$value_main] as $key => $value)
+                               {
+                                       if ($value == $prev)
+                                       {
+                                               unset($dmy[$key]);
+                                               unset($dmy2[$key]);
+                                               unset($dmy3[$key]);
+                                       }
+                                        else
+                                       {
+                                               $prev = $value;
+                                       }
+                               }
+                               $menus[$value_main] = $dmy; $titles[$value_main] = $dmy2; $below[$value_main] = $dmy3;
+                       }
+               }
+       }
+
+       $OUT = "<SELECT class=\"admin_select\" name=\"sort\" size=\"1\">
+      <OPTION value=\"\">".IS_FIRST_MENU."</OPTION>";
+       foreach ($below as $key => $m)
+       {
+               if (is_array($m))
+               {
+                       foreach ($m as $key2 => $m2)
+                       {
+                               $OUT .= "      <OPTION value=\"".$m2."\">".$titles[$key][$key2];
+                               foreach ($menus as $k => $v)
+                               {
+                                       if (($v == $key) && (!is_array($v)))
+                                       {
+                                               $OUT .= " (".$titles[$k].")";
+                                       }
+                               }
+                               $OUT .= "</OPTION>\n";
+                       }
+               }
+                else
+               {
+                       $OUT .= "      <OPTION value=\"".$m."\">".$titles[$key]."</OPTION>\n";
+               }
+       }
+       $OUT .= "</SELECT>";
+
+       define('__BELOW_SELECTION' , $OUT);
+       define('__WHAT_SELECTION'  , ADMIN_MAKE_MENU_SELECTION("member", "what", "name"));
+       define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION("member", "action", "menu"));
+
+       // Display form
+       LOAD_TEMPLATE("admin_member_add");
+}
+ elseif (!IS_DEMO())
+{
+       // Insert new menu entry
+       if (!empty($_POST['menu']))
+       {
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_member_menu
+(`action`,`what`,`title`,`visible`,`locked`,`sort`)
+VALUES('%s','%s','%s','%s','%s','%s')",
+ array(
+       $_POST['menu'],
+       $_POST['name'],
+       $_POST['title'],
+       $_POST['visible'],
+       $_POST['active'],
+       bigintval($_POST['sort']),
+), __FILE__, __LINE__);
+       }
+        else
+       {
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_member_menu
+(`action`,`title`,`visible`,`locked`,`sort`)
+VALUES('%s','%s','%s','%s','%s')",
+ array(
+       $_POST['name'],
+       $_POST['title'],
+       $_POST['visible'],
+       $_POST['active'],
+       bigintval($_POST['sort']),
+), __FILE__, __LINE__);
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
+}
+ else
+{
+       // Demo mode!
+       LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php
new file mode 100644 (file)
index 0000000..cfd4b3b
--- /dev/null
@@ -0,0 +1,326 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 05/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-memedit.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Edit member's menu                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Editieren Sie das Menue fuer Ihre Mitglieder     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Do we edit/delete/change main menus or sub menus?
+$AND = "what = ''"; $SUB = "";
+
+if (!empty($_GET['sub']))
+{
+       $AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub']));
+       $SUB = SQL_ESCAPE($_GET['sub']);
+}
+
+// Get count of (maybe) selected menu points
+$chk = 0;
+if (!empty($_POST['sel'])) $chk = SELECTION_COUNT($_POST['sel']);
+
+// List all menu points and make them editable
+if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
+{
+       // Edit menu entries
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+       $SW = 2; $cnt = 0; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title, action, what FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu, $act, $wht, $descr) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+                               $content = array(
+                                       'cnt'    => $cnt,
+                                       'sel'    => $sel,
+                                       'menu'   => $menu,
+                                       'sw'     => $SW,
+                                       'act' => ADMIN_MAKE_MENU_SELECTION("member", "act", "sel_act[".$sel."]", $act),
+                                       'what'   => ADMIN_MAKE_MENU_SELECTION("member", "what", "sel_what[".$sel."]", $wht),
+                               );
+                               // Load template
+                               $OUT .= LOAD_TEMPLATE("admin_mmenu_edit_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_mmenu_edit");
+}
+ elseif ((isset($_POST['del'])) && ($chk > 0) && (!IS_DEMO()))
+{
+       // Del menu entries with or without confirmation
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+       $SW = 2; $cnt = 0; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($title) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+                               $content = array(
+                                       'cnt'   => $cnt,
+                                       'sel'   => $sel,
+                                       'title' => $title
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_mmenu_delete_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+
+       // Load template
+       LOAD_TEMPLATE("admin_mmenu_delete");
+}
+ elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO()))
+{
+       // Change status (visible / locked)
+       define('__SUB_VALUE', $SUB);
+       define('__CHK_VALUE', $chk);
+       $SW = 2; $cnt = 0; $OUT = "";
+       foreach ($_POST['sel'] as $sel => $confirm)
+       {
+               if ($confirm == 1)
+               {
+                       $cnt++;
+                       $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Entry found so we load the stuff...
+                               list($menu, $vis, $locked) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+                               $content = array(
+                                       'cnt'     => $cnt,
+                                       'menu'    => $menu,
+                                       'sel'     => $sel,
+                                       'sw'      => $SW,
+                                       'visible' => ADD_SELECTION("yn", $vis   , "visible", $sel),
+                                       'locked'  => ADD_SELECTION("yn", $locked, "locked" , $sel),
+                               );
+
+                               // Load template
+                               $OUT .= LOAD_TEMPLATE("admin_menu_status_row", true, $content);
+                       }
+                        else
+                       {
+                               // Entry not found?
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'sel' => $sel
+                               );
+                               $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+                       }
+                       $SW = 3 - $SW;
+               }
+       }
+       define('__MENU_ROWS', $OUT);
+       define('__CNT_VALUE', $cnt);
+       //
+       LOAD_TEMPLATE("admin_mmenu_status");
+}
+ elseif ((isset($_POST['ok'])) && (!IS_DEMO()))
+{
+       // An act is done...
+       foreach ($_POST['sel'] as $sel => $menu)
+       {
+               $AND = "what = ''";
+               $sel = bigintval($sel);
+               if (!empty($SUB)) $AND = "action='".$SUB."'";
+               switch ($_POST['ok'])
+               {
+               case "edit": // Edit menu
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $sel), __FILE__, __LINE__);
+                       break;
+
+               case "del": // Delete menu
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($sel), __FILE__, __LINE__);
+                       break;
+
+               case "status": // Change status of menus
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET visible='%s', locked='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__);
+                       break;
+               }
+               break;
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_data_saved");
+}
+ else
+{
+       if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid'])))
+       {
+               // Get IDs
+               if (!empty($_GET['w']))
+               {
+                       // Sub menus selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['act']), bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE action='%s' AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['act']), bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+                else
+               {
+                       // Main menu selected
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['tid'])), __FILE__, __LINE__);
+                       list($tid) = SQL_FETCHROW($result);
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+                        array(bigintval($_GET['fid'])), __FILE__, __LINE__);
+                       list($fid) = SQL_FETCHROW($result);
+               }
+
+               if ((!empty($tid)) && (!empty($fid)))
+               {
+                       // Sort menu
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__);
+                       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+                        array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__);
+               }
+       }
+
+       if (!empty($SUB))
+       {
+               // Edit sub menus
+               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE ".$AND." AND what != '' AND what IS NOT NULL ORDER BY sort ASC", __FILE__, __LINE__);
+       }
+        else
+       {
+               // Edit main menus
+               $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
+       }
+       $max = SQL_NUMROWS($result);
+       if ($max > 0)
+       {
+               $SUB = "";
+               if (!empty($SUB)) $SUB = $SUB;
+               define('__SUB_VALUE', $SUB);
+
+               $SW = 2; $cnt = 0; $OUT = "";
+               while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result))
+               {
+                       $cnt++;
+                       if (($sort == 0) || (($sort == 1) && (!empty($SUB))))
+                       {
+                               // Is highest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=memedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+                        elseif ($cnt == $max)
+                       {
+                               // Is lowest position
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=memedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>";
+                       }
+                        elseif ($sort > 0)
+                       {
+                               // Anything else between highest and lowest
+                               $NAVI = "<A href=\"".URL."/modules.php?module=admin&amp;what=memedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort-1)."&amp;fid=".$sort."\">".HIGHER."</A>/<A href=\"".URL."/modules.php?module=admin&amp;what=memedit&amp;sub=".$SUB."&amp;act=".$act."&amp;w=".$wht."&amp;tid=".($sort+1)."&amp;fid=".$sort."\">".LOWER."</A>";
+                       }
+                       if (empty($act))   $act   = "&nbsp;";
+                       if (empty($wht))   $wht   = "&nbsp;";
+                       if (empty($title)) $title = "&nbsp;";
+                       $content = array(
+                               'sw'     => $SW,
+                               'id'     => $id,
+                               'action' => $act,
+                               'what'   => $wht,
+                               'title'  => $title,
+                               'navi'   => $NAVI,
+                               'mode'   => "mem",
+                       );
+                       $OUT .= LOAD_TEMPLATE("admin_menu_overview_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__MENU_ROWS', $OUT);
+               LOAD_TEMPLATE("admin_mmenu_overview");
+       }
+        else
+       {
+               // Menu entries are missing... (???)
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND);
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-optimize.php b/inc/modules/admin/what-optimize.php
new file mode 100644 (file)
index 0000000..e11b68b
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/12/2004 *
+ * ================                             Last change: 09/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-optimize.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Optimize and repair database                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Datenbank optimieren und reparieren              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Optimize and repair database and return the result as a multi-dimensional array
+$DATA = REPAIR_OPTIMIZE_DB();
+
+// Output rows
+$SW = 2; $gain_tabs = 0; $OUT = "";
+foreach ($DATA['tables'] as $row_array)
+{
+       // Fixes a bug which causes a parser error on eval'd code
+       if (empty($row_array[1])) $row_array[1] = "NONE";
+       $eval = "\$REP = OPTIMIZE_STATUS_".strtoupper($row_array[1]).";";
+       eval($eval); $B1 = ""; $B2 = "";
+       $OPT = OPTIMIZE_STATUS_UNSUPPORTED;
+       if ($row_array[4] > 0)
+       {
+               $OPT = OPTIMIZE_STATUS_OPTIMIZED;
+               $B1 = "<STRONG>"; $B2 = "<STRONG>";
+               $gain_tabs++;
+       }
+        elseif (count(explode(" ", $row_array[2])) == 0)
+       {
+               $eval = "\$OPT = OPTIMIZE_STATUS_".strtoupper($row_array[2]).";";
+               die($eval);
+               eval($eval);
+       }
+
+       // Prepare data for the row template
+       $content = array(
+               'sw'  => $SW,
+               'b1'  => $B1,
+               'b2'  => $B2,
+               'tpl' => $row_array[0],
+               'rep' => $REP,
+               'opt' => $OPT,
+               'sum' => TRANSLATE_COMMA($row_array[3]),
+               'sav' => TRANSLATE_COMMA($row_array[4]),
+       );
+
+       // Load row template and switch color
+       $OUT .= LOAD_TEMPLATE("admin_optimize_row", true, $content);
+       $SW = 3 - $SW;
+}
+define('__TABLE_ROWS', $OUT);
+
+// Prepare data for the template
+define('__TOTAL_TABS'     , $DATA['total_tabs']);
+define('__TOTAL_SIZE'     , TRANSLATE_COMMA($DATA['total_size']));
+define('__TOTAL_CALLS'    , $DATA['total_rows']);
+define('__TOTAL_OPTIMIZED', TRANSLATE_COMMA($DATA['total_opti']));
+define('__NOW_OPTIMIZED'  , $gain_tabs);
+define('__NOW_SAVED'      , TRANSLATE_COMMA($DATA['total_gain']));
+
+// Load main template
+LOAD_TEMPLATE("admin_optimize");
+
+//
+?>
diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php
new file mode 100644 (file)
index 0000000..1efd917
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-overview.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Generate a simple task list or menu descriptions *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einfache Task-Liste oder Menuebeschreibungen     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Otherwise load include file 'overview-inc' (old standard overview page)
+require_once(PATH."inc/modules/admin/overview-inc.php");
+
+$JOBS_DONE = true;
+$taskExt = false; // Default is that "task" is not installed
+
+// When the admin is logging in check several things first (new jobs to complete and so on)
+if ($GLOBALS['action'] == "login")
+{
+       if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) {
+               // When task extension is registered output advanced overview page
+               $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task'
+               $taskExt = true;
+       } else {
+               // Output standart overview (provided by overview-inc.php)
+               $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks);
+       }
+}
+
+// Are there jobs to be done?
+if ($JOBS_DONE) {
+       // Generate overview of all main menus
+       global $menuDesription, $FATAL;
+       if ((is_array($menuDesription)) && (sizeof($menuDesription) > 0)) {
+               $OUT = "";
+               foreach ($menuDesription as $key => $value)
+               {
+                       // Prepare content
+                       $content = array(
+                               'title' => $menuTitle[$key],
+                               'text'  => $value
+                       );
+
+                       // Load row template
+                       $OUT .= LOAD_TEMPLATE("admin_menu_hints_row", true, $content);
+               }
+
+               // Load base template
+               LOAD_TEMPLATE("admin_menu_hints", false, $OUT);
+       }
+} elseif (!$taskExt) {
+       if (EXT_IS_ACTIVE("task")) {
+               // Output warning message
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(EXTENSION_WARNING_EXT_INACTIVE, "task"));
+               OUTPUT_HTML("<br />");
+       }
+
+       // List selected tasks on overview when task management is not active
+       OUTPUT_SELECTED_TASKS($_POST, $result_tasks);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-payments.php b/inc/modules/admin/what-payments.php
new file mode 100644 (file)
index 0000000..d727b20
--- /dev/null
@@ -0,0 +1,209 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 12/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-payments.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Payments (points) for confirmed mails            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verguetungen fuer bestaetigte Mails              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (empty($_GET['do'])) unset($_GET['do']);
+if (((empty($_POST['t_wait'])) || (empty($_POST['payment']))) && (!empty($_GET['do'])) && ($_GET['do'] == "add"))
+{
+       unset($_POST['ok']);
+}
+
+if (isset($_POST['ok']))
+{
+       $SQL = array();
+       switch ($_GET['do'])
+       {
+       case "add":
+               $SQL[] = "INSERT INTO "._MYSQL_PREFIX."_payments (time, payment, mail_title, price) VALUES ('".$_POST['t_wait']."','".$_POST['payment']."','".$_POST['title']."','".$_POST['price']."')";
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_payments WHERE time='%s' LIMIT 1",
+                array($_POST['t_wait']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Free memory
+                       $SQL[0] = "";
+                       SQL_FREERESULT($result);
+               }
+               break;
+
+       case "edit":
+               foreach ($_POST['time'] as $id => $value)
+               {
+                       $SQL[] = "UPDATE "._MYSQL_PREFIX."_payments SET time='".$value."', payment='".$_POST['pay'][$id]."', price='".$_POST['price'][$id]."', mail_title='".$_POST['title'][$id]."' WHERE id='".$id."' LIMIT 1";
+               }
+               break;
+
+       case "del":
+               foreach ($_POST['id'] as $id => $value)
+               {
+                       $SQL[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_payments WHERE id='".$id."' LIMIT 1";
+               }
+               break;
+       }
+       // Daten abspeichern
+       if ((count($SQL) > 0) || (!empty($SQL[0])))
+       {
+               foreach ($SQL as $s)
+               {
+                       if (!empty($s))
+                       {
+                               // Only run non-empty strings
+                               $result = SQL_QUERY(trim($s), __FILE__, __LINE__);
+                               if (empty($content))
+                               {
+                                       if (SQL_AFFECTEDROWS() == 1)
+                                       {
+                                               $content = "<SPAN class=\"admin_done\">".SETTINGS_SAVED."</SPAN>";
+                                       }
+                                        else
+                                       {
+                                               $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+                                       }
+                               }
+                       }
+               }
+       }
+        else
+       {
+               $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+}
+ elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0))
+{
+       // Delete entries here
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value)
+       {
+               $result = SQL_QUERY_ESC("SELECT time, mail_title FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($time, $title) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare array for the row template
+               $content = array(
+                       'sw'    => $SW,
+                       'id'    => $id,
+                       'time'  => $time,
+                       'title' => $title,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_del_payments_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__PAYMENT_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_del_payments");
+}
+ elseif ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0))
+{
+       // Edit entries
+       $SW = 2; $OUT = "";
+       foreach ($_POST['sel'] as $id => $value)
+       {
+               $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($time, $pay, $title, $price) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Prepare array for the row template
+               $content = array(
+                       'sw'    => $SW,
+                       'id'    => $id,
+                       'time'  => $time,
+                       'title' => $title,
+                       'pay'   => $pay,
+                       'price' => $price,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_edit_payments_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__PAYMENT_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_edit_payments");
+}
+ else
+{
+       // Referral levels
+       $result = SQL_QUERY("SELECT id, time, payment, mail_title, price FROM "._MYSQL_PREFIX."_payments ORDER BY time", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Make referral levels editable and deletable
+               $SW = 2; $OUT = "";
+
+               // List already existing categories for editing
+               while (list($id, $time, $pay, $title, $price) = SQL_FETCHROW($result))
+               {
+                       $pay   = TRANSLATE_COMMA($pay);
+                       $price = TRANSLATE_COMMA($price);
+
+                       // Prepare array for the row template
+                       $content = array(
+                               'sw'    => $SW,
+                               'id'    => $id,
+                               'time'  => $time,
+                               'title' => $title,
+                               'pay'   => $pay,
+                               'price' => $price,
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_payments_list_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__PAYMENT_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_list_payments");
+       }
+
+       // Form for adding new referral levels
+       LOAD_TEMPLATE("admin_add_payment");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-refbanner.php b/inc/modules/admin/what-refbanner.php
new file mode 100644 (file)
index 0000000..c3dd4ef
--- /dev/null
@@ -0,0 +1,176 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-refbanner.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Manage all referral banner                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Banner fuer die Ref-Links verwalten         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$SEL = 0;
+if ((empty($_POST['url'])) || (empty($_POST['alternate'])))
+{
+       unset($_POST['ok']);
+}
+if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
+
+if (isset($_POST['ok']))
+{
+       // Fix older calls from add-new-banner-form
+       if (empty($_GET['mode'])) $_GET['mode'] = "add";
+       $SQL = "";
+       switch ($_GET['mode'])
+       {
+       case "add":
+               // Check if banner is already added
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refbanner WHERE url='%s' LIMIT 1",
+                array($_POST['url']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 0)
+               {
+                       // Add banner
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_refbanner (url, alternate, visible)
+VALUES ('%s','%s','%s')",
+ array($_POST['url'], $_POST['alternate'], $_POST['visible']), __FILE__, __LINE__);
+               }
+                else
+               {
+                       // Free memory
+                       SQL_FREERESULT($result);
+               }
+               break;
+
+       case "edit": // Update banner
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       // Secure ID
+                       $id = bigintval($id);
+
+                       // Update entry
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refbanner SET url='%s', alternate='%s', visible='%s' WHERE id=%s LIMIT 1",
+                        array($_POST['url'][$id], $_POST['alternate'][$id], $_POST['visible'], $id), __FILE__, __LINE__);
+               }
+               break;
+       }
+       if (SQL_AFFECTEDROWS() == 1)
+       {
+               $content = "<SPAN class=\"admin_done\">".SETTINGS_SAVED."</SPAN>";
+       }
+        else
+       {
+               $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+       }
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+}
+ elseif (($SEL > 0) && (isset($_POST['edit'])))
+{
+       // Edit banner
+       $SW = ""; $OUT = "";
+       foreach ($_POST['sel'] as $id => $sel)
+       {
+               // Load data
+               $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM "._MYSQL_PREFIX."_refbanner WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+               list($url, $alt, $vis) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Preapre data for the row
+               $content = array(
+                       'sw'  => $SW,
+                       'id'  => $id,
+                       'url' => $url,
+                       'alt' => $alt,
+                       'vis' => ADD_SELECTION("yn", $vis   , "visible"),
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_refbanner_edit_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__BANNER_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("admin_refbanner_edit");
+}
+ else
+{
+       if (($SEL > 0) && (isset($_POST['del'])))
+       {
+               // Delete banner
+               foreach ($_POST['sel'] as $id => $sel)
+               {
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_refbanner WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+               }
+       }
+
+       // Referral levels
+       $result = SQL_QUERY("SELECT id, url, alternate, visible, counter, clicks FROM "._MYSQL_PREFIX."_refbanner ORDER BY url", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Make referral banner editable and deletable
+               $SW = 2; $OUT = "";
+               while (list($id, $url, $alt, $vis, $cntr, $clks) = SQL_FETCHROW($result))
+               {
+                       // Preapre data for the row
+                       $content = array(
+                               'sw'  => $SW,
+                               'id'  => $id,
+                               'url' => $url,
+                               'alt' => $alt,
+                               'vis' => TRANSLATE_YESNO($vis),
+                               'cnt' => $cntr,
+                               'clx' => $clks
+                       );
+
+                       // Load row template and switch color
+                       $OUT .= LOAD_TEMPLATE("admin_refbanner_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__BANNER_ROWS', $OUT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_refbanner");
+       }
+
+       // Form for adding new referral levels
+       LOAD_TEMPLATE("admin_add_banner");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php
new file mode 100644 (file)
index 0000000..3168bd4
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/25/2004 *
+ * ================                             Last change: 02/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-repair_amenu.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Repair admin menu weight                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Menuegewichtigung reparieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$ACTIONS = array();
+// First fix all main menus (what="")...
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$cnt = 0; $REP = 0;
+while(list($id, $act) = SQL_FETCHROW($result_fix)) {
+       // Store act value for later usage in sorting sub menus
+       $ACTIONS[] = $act;
+
+       // Fix weight
+       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort=%s WHERE id=%s LIMIT 1",
+               array($cnt, $id), __FILE__, __LINE__);
+       $REP += SQL_AFFECTEDROWS();
+
+       // Count one up
+       $cnt++;
+}
+
+// Set logout weight to 999
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+
+// Now sort every each menu
+foreach ($ACTIONS as $act) {
+       $result_fix = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+               array($act), __FILE__, __LINE__);
+       $cnt = 1;
+       while (list($id) = SQL_FETCHROW($result_fix)) {
+               // Fix weight
+               $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort=%s WHERE id=%s LIMIT 1",
+                       array($cnt, $id), __FILE__, __LINE__);
+               $REP += SQL_AFFECTEDROWS();
+
+               // Count one up
+               $cnt++;
+       }
+}
+
+// @TODO This causes the whole (!) menu cache being rebuilded
+CACHE_PURGE_ADMIN_MENU();
+
+// Repair finished
+LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_done\">".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2."</FONT>");
+
+//
+?>
diff --git a/inc/modules/admin/what-repair_cats.php b/inc/modules/admin/what-repair_cats.php
new file mode 100644 (file)
index 0000000..5ad1350
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/24/2004 *
+ * ================                             Last change: 04/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-repair_cats.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Repairs category selections                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Repariert Kategorieauswahlen                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_cats ORDER BY userid", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0)
+{
+       // Check if found userid is also found in user_data table
+       $REMOVED = 0; // Nothing is removed for now... ;-)
+       while (list($uid) = SQL_FETCHROW($result))
+       {
+               $result_user = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(bigintval($uid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result_user) == 0)
+               {
+                       // Ok, we found something to remove
+                       $result_remove = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+                       $REMOVED += SQL_AFFECTEDROWS();
+               }
+                else
+               {
+                       // Free memory
+                       SQL_FREERESULT($result_user);
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       if ($REMOVED > 0)
+       {
+               // Entries repaired
+               $content = "<FONT class=\"admin_done\">".ADMIN_REPAIR_ENTRIES_FIXED_1.$REMOVED.ADMIN_REPAIR_ENTRIES_FIXED_2."</FONT>";
+       }
+        else
+       {
+               // Nothing repaired
+               $content = "<FONT class=\"admin_failed\">".ADMIN_REPAIR_NOTHING_FIXED."</FONT>";
+       }
+}
+ else
+{
+       // No category selections found, no members registered?
+       $content = "<STRONG class=\'admin_failed\">".ADMIN_REPAIR_CATS_NOTHING."</STRONG>";
+}
+
+// Load template
+LOAD_TEMPLATE("admin_settings_saved", false, $content);
+
+//
+?>
diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php
new file mode 100644 (file)
index 0000000..3913491
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/25/2004 *
+ * ================                             Last change: 02/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-repair_gmenu.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Repair guest menu weight                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Menuegewichtigung reparieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$ACTIONS = array();
+// First fix all main menus (what="")...
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$cnt = 0; $REP = 0;
+while(list($id, $act) = SQL_FETCHROW($result_fix))
+{
+       // Store act value for later usage in sorting sub menus
+       $ACTIONS[] = $act;
+
+       // Fix weight
+       $result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='".$cnt."' WHERE id='".$id."' LIMIT 1", __FILE__, __LINE__);
+       $REP += SQL_AFFECTEDROWS();
+
+       // Count one up
+       $cnt++;
+}
+// Set logout weight to 999
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+
+// Now sort every each menu
+foreach ($ACTIONS as $act) {
+       $result_fix = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+               array($act), __FILE__, __LINE__);
+       $cnt = 1;
+       while (list($id) = SQL_FETCHROW($result_fix)) {
+               // Fix weight
+               $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort=%s WHERE id=%s LIMIT 1",
+                       array($cnt, $id), __FILE__, __LINE__);
+               $REP += SQL_AFFECTEDROWS();
+
+               // Count one up
+               $cnt++;
+       }
+}
+
+// Repair finished
+LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_done\">".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2."</FONT>");
+
+//
+?>
diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php
new file mode 100644 (file)
index 0000000..74ae23f
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/25/2004 *
+ * ================                             Last change: 02/25/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-repair_mmenu.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Repair member menu weight                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Menuegewichtigung reparieren                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$ACTIONS = array();
+// First fix all main menus (what="")...
+$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$cnt = 0; $REP = 0;
+while(list($id, $act) = SQL_FETCHROW($result_fix)) {
+       // Store action value for later usage in sorting sub menus
+       $ACTIONS[] = $act;
+
+       // Fix weight
+       $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET sort=%s WHERE id=%s LIMIT 1",
+               array($cnt, $id), __FILE__, __LINE__);
+       $REP += SQL_AFFECTEDROWS();
+
+       // Count one up
+       $cnt++;
+}
+// Set logout weight to 999
+$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+
+// Now sort every each menu
+foreach ($ACTIONS as $act) {
+       $result_fix = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+               array($act), __FILE__, __LINE__);
+       $cnt = 1;
+       while (list($id) = SQL_FETCHROW($result_fix)) {
+               // Fix weight
+               $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_member_menu SET sort=%s WHERE id=%s LIMIT 1",
+                       array($cnt, $id), __FILE__, __LINE__);
+               $REP += SQL_AFFECTEDROWS();
+
+               // Count one up
+               $cnt++;
+       }
+}
+
+// Repair finished
+LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_done\">".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2."</FONT>");
+
+//
+?>
diff --git a/inc/modules/admin/what-send_bonus.php b/inc/modules/admin/what-send_bonus.php
new file mode 100644 (file)
index 0000000..a297af0
--- /dev/null
@@ -0,0 +1,244 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 08/05/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-send_bonus.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Send out bonus mails to all members              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : An alle Mitglieder Bonus-Mails verschicken       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("order")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "order"));
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$whereStatement = " WHERE visible='Y'";
+if (is_admin()) $whereStatement = "";
+$EXT_HTML = EXT_IS_ACTIVE("html_mail");
+if (empty($_GET['mode'])) $_GET['mode'] = "select";
+
+if (isset($_POST['ok']))
+{
+       // Check if category and number of receivers is okay
+       $CAT_TABS = "%s"; $CAT_WHERE = ""; $cat = "";
+       if ($_POST['cat'] > 0)
+       {
+               // Select category
+               $CAT_TABS  = "LEFT JOIN "._MYSQL_PREFIX."_user_cats AS c ON d.userid=c.userid";
+               $cat = bigintval($_POST['cat']);
+               $CAT_WHERE = " AND c.cat_id=%s";
+       }
+       if (GET_EXT_VERSION("holiday") >= "0.1.3")
+       {
+               // Add something for the holiday extension
+               $CAT_WHERE .= " AND d.holiday_active='N'";
+       }
+
+       if (($EXT_HTML) && ($_GET['mode'] == "html"))
+       {
+               // Only include HTML receivers
+               $result = SQL_QUERY_ESC("SELECT d.userid FROM "._MYSQL_PREFIX."_user_data AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
+                array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
+       }
+        else
+       {
+               // Include all
+               $result = SQL_QUERY_ESC("SELECT d.userid FROM "._MYSQL_PREFIX."_user_data AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
+                array($cat, $_CONFIG['order_select'], $_CONFIG['order_mode'], bigintval($_POST['receiver'])), __FILE__, __LINE__);
+       }
+       if ((SQL_NUMROWS($result) == $_POST['receiver']) && ($_POST['receiver'] > 0))
+       {
+               $RECEIVER = "";
+               while (list($REC) = SQL_FETCHROW($result))
+               {
+                       // Add receiver when not empty
+                       if (!empty($REC)) $RECEIVER .= ";".$REC;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               $RECEIVER = substr($RECEIVER, 1);
+
+               // Gettings points is oka, so we can add $USED later from
+               if ($EXT_HTML)
+               {
+                       $HTML = "N";
+                       if ($_GET['mode'] == "html") $HTML = "Y";
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus
+(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, html_msg)
+VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
+ array(
+       $_POST['subject'],
+       addslashes($_POST['text']),
+       $RECEIVER,
+       $_POST['points'],
+       $_POST['seconds'],
+       $_POST['url'],
+       $cat,
+       SELECTION_COUNT(explode(";", $RECEIVER)),
+       bigintval($_POST['receiver']),
+       $HTML
+), __FILE__, __LINE__);
+               }
+                else
+               {
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_bonus
+(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent)
+VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
+ array(
+       $_POST['subject'],
+       addslashes($_POST['text']),
+       $RECEIVER,
+       $_POST['points'],
+       $_POST['seconds'],
+       $_POST['url'],
+       $cat,
+       SELECTION_COUNT(explode(";", $RECEIVER)),
+       bigintval($_POST['receiver']),
+), __FILE__, __LINE__);
+               }
+
+               // Mail inserted into bonus pool
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_SEND);
+       }
+        else
+       {
+               // More entered than can be reached!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MORE_SELECTED);
+       }
+       if (!empty($URL))
+       {
+               // Redirect to requested URL
+               LOAD_URL($URL);
+       }
+} else {
+       $result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               $MORE = "";
+               if ($_GET['mode'] == "html") $MORE = " AND html='Y'";
+               if (GET_EXT_VERSION("holiday") >= "0.1.3")
+               {
+                       // Add something for the holiday extension
+                       $MORE .= " AND holiday_active='N'";
+               }
+
+               $result_all = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND receive_mails > 0".$MORE, __FILE__, __LINE__);
+               define('__ALL_VALUE', SQL_NUMROWS($result_all));
+               // Initialize array...
+               $CATS = array(
+                       'id'   => array(),
+                       'name' => array(),
+                       'uids' => array()
+               );
+               // ... and begin loading stuff
+               while (list($id, $cat) = SQL_FETCHROW($result))
+               {
+                       $CATS['id'][]   = $id;
+                       $CATS['name'][] = $cat;
+                       $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $uid_cnt = 0;
+                       while (list($ucat) = SQL_FETCHROW($result_uids))
+                       {
+                               $result_ver = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s AND status='CONFIRMED' AND receive_mails > 0".$MORE." LIMIT 1",
+ array(bigintval($ucat)), __FILE__, __LINE__);
+                               $uid_cnt += SQL_NUMROWS($result_ver);
+
+                               // Free memory
+                               SQL_FREERESULT($result_ver);
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result_uids);
+                       $CATS['uids'][] = $uid_cnt;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               if (!empty($MSG))
+               {
+                       // We got system message so we drop it out to the user
+                       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+               }
+               if ($EXT_HTML)
+               {
+                       // If HTML extension is active
+                       define('__HTML_SELECT',  LOAD_TEMPLATE("admin_send_bonus_html", true));
+               }
+                else
+               {
+                       // And if not
+                       define('__HTML_SELECT', "");
+               }
+
+               // Generate options
+               $OUT = "";
+               foreach ($CATS['id'] as $key => $value)
+               {
+                       if (strlen($CATS['name'][$key]) > 20) $CATS['name'][$key] = substr($CATS['name'][$key], 0, 17)."...";
+                       $OUT .= "      <OPTION value=\"".$value."\">".$CATS['name'][$key]." (".$CATS['uids'][$key]." ".USER_IN_CAT.")</OPTION>\n";
+               }
+               define('__OPTION_LINES', $OUT);
+
+               // Store send mode
+               define('__MODE', $_GET['mode']);
+
+               // Select template
+               switch($_GET['mode'])
+               {
+               case "html":   // HTML mails
+               case "normal": // Normal mails
+                       $template = "admin_send_bonus_form";
+                       break;
+
+               case "select": // Selection
+                       $template = "admin_send_bonus_select";
+                       break;
+               }
+
+               // Load template
+               LOAD_TEMPLATE($template);
+       }
+        else
+       {
+               // No cateogries are defined yet
+               OUTPUT_HTML("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-send_newsletter.php b/inc/modules/admin/what-send_newsletter.php
new file mode 100644 (file)
index 0000000..3b2a13d
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 03/04/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-send_newsletter.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : Handle HTML or text newsletter                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verwalten von HTML- oder Text-Newslettern        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (isset($_POST['ok']))
+{
+       $result = SQL_QUERY("SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND nl_receive='Y' ORDER BY userid", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Members are available so we can send out the newsletter!
+               while (list($id, $email) = SQL_FETCHROW($result))
+               {
+                       // Construct mail...
+                       $template = "newsletter";
+
+                       // Check for extension and sending-mode
+                       if (!EXT_IS_ACTIVE("html_mail", true) && ($_POST['mode'] == "html"))
+                       {
+                               // Set mode to text mode
+                               $_POST['mode'] == "text";
+                       }
+                        elseif ($_POST['mode'] == "html")
+                       {
+                               // Set HTML templates
+                               $template = "newsletter_html";
+                       }
+
+                       // Compile message
+                       $_POST['text'] = COMPILE_CODE($_POST['text']);
+
+                       // Load template
+                       $msg = LOAD_EMAIL_TEMPLATE($template, array('text' => $_POST['text']), $id);
+
+                       // ... and send it away!
+                       SEND_NEWSLETTER($email, $_POST['subject'], $msg, $_POST['mode']);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Output message
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_SEND_DONE);
+       }
+}
+ else
+{
+       // Copy data into constants for the template and load it
+       define('_DATESTAMP', MAKE_DATETIME(time(), "3"));
+       if (EXT_IS_ACTIVE("html_mail"))
+       {
+               // Load template with HTML mode
+               LOAD_TEMPLATE("admin_newsletter");
+       }
+        else
+       {
+               // Load template with only text mode
+               LOAD_TEMPLATE("admin_newsletter_nohtml");
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-stats_mods.php b/inc/modules/admin/what-stats_mods.php
new file mode 100644 (file)
index 0000000..fc69db6
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/27/2004 *
+ * ================                             Last change: 08/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-stats_mods.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Module statistics                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Modul-Statistiken                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// If var is empty set it to empty
+if (empty($_GET['mod'])) $_GET['mod'] = "";
+
+// Check if module was selected
+if (($_GET['mod'] == "index") || ($_GET['mod'] == "login"))
+{
+       // Select menu system
+       $mod = "";
+       switch ($_GET['mod'])
+       {
+               case "index": $mod = "guest" ; break;
+               case "login": $mod = "member"; break;
+       }
+
+       // Load module's detail statistic
+       $result = SQL_QUERY("SELECT action, title, counter FROM "._MYSQL_PREFIX."_".$mod."_menu WHERE what != '' ORDER BY counter DESC", __FILE__, __LINE__);
+       $SW = 2; $OUT = "";
+       while(list($act, $title, $clicks) = SQL_FETCHROW($result))
+       {
+               // Prepare array for the template
+               $content = array(
+                       'sw'     => $SW,
+                       'title'  => $title,
+                       'action' => $act,
+                       'clicks' => $clicks,
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_mods_stats2_row", true, $content);
+
+               // Switch colors
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__MODS_ROWS', $OUT);
+
+       // Load final template
+       LOAD_TEMPLATE("admin_mods_stats2");
+}
+ else
+{
+       // Load module statics
+       $result = SQL_QUERY("SELECT module, title, clicks FROM "._MYSQL_PREFIX."_mod_reg ORDER BY clicks DESC, module", __FILE__, __LINE__);
+       $SW = 2; $OUT = "";
+       while(list($mod, $title, $clicks) = SQL_FETCHROW($result))
+       {
+               if (empty($title)) $title = "---";
+               if (($mod == "index") || ($mod == "login"))
+               {
+                       // Add link to detail statistics
+                       $mod = "<STRONG><A href=\"".URL."/modules.php?module=admin&amp;what=stats_mods&amp;mod=".$mod."\">".$mod."</A></STRONG>";
+               }
+               // Prepare array for the template
+               $content = array(
+                       'sw'     => $SW,
+                       'title'  => $title,
+                       'mod'    => $mod,
+                       'clicks' => $clicks,
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_mods_stats_row", true, $content);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__MODS_ROWS', $OUT);
+
+       // Load final template
+       LOAD_TEMPLATE("admin_mods_stats");
+}
+//
+?>
diff --git a/inc/modules/admin/what-sub_points.php b/inc/modules/admin/what-sub_points.php
new file mode 100644 (file)
index 0000000..3625940
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/23/2003 *
+ * ===============                              Last change: 09/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sub_points.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Add manually points to a user                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Manuell einem Mitglied Punkte gutschreiben       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Fix a notice
+if (!isset($_GET['u_id'])) $_GET['u_id'] = "";
+
+if ($_GET['u_id'] == "all")
+{
+       // Add points to all accounts
+       define('__POINTS_VALUE', $_POST['points']);
+       if ((isset($_POST['ok'])) && ($_POST['points'] > 0))
+       {
+               $result_main = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+               while (list($uid) = SQL_FETCHROW($result_main))
+               {
+                       // User ID found in URL so we use this give him some credits
+                       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Selected user does exist
+                               list($sname, $fname, $email) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               if ((isset($_POST['ok'])) && (!empty($_POST['points'])))
+                               {
+                                       // Ok, add points to used points and send an email to him...
+                                       SUB_POINTS($uid, $_POST['points']);
+
+                                       // Prepare content
+                                       $content = array(
+                                               'text' => SQL_ESCAPE($_POST['reason']),
+                                               'points' => bigintval($_POST['points'])
+                                       );
+
+                                       // Load message and send it away
+                                       $msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval($uid));
+                                       SEND_EMAIL(bigintval($uid), ADMIN_SUB_SUBJ, $msg);
+                               }
+                       }
+               }
+               // Free memory
+               SQL_FREERESULT($result_main);
+
+               // Output message
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_POINTS_SUBTRACTED);
+       }
+        else
+       {
+               // Display form add points
+               LOAD_TEMPLATE("admin_sub_points_all");
+       }
+}
+ elseif (!empty($_GET['u_id']))
+{
+       // User ID found in URL so we use this give him some credits
+       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+        array(bigintval($_GET['u_id'])),__FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Selected user does exist
+               list($sname, $fname, $email) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               if ((isset($_POST['ok'])) && (!empty($_POST['points'])))
+               {
+                       // Ok, add to used points and send an email to him...
+                       SUB_POINTS(bigintval($_GET['u_id']), $_POST['points']);
+
+                       // Prepare content
+                       $content = array(
+                               'text' => SQL_ESCAPE($_POST['reason']),
+                               'points' => bigintval($_POST['points'])
+                       );
+
+                       // Load email and send it away
+                       $msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval($_GET['u_id']));
+                       SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_SUB_SUBJ, $msg);
+
+                       // Output message
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_SUBTRACTED);
+               }
+                else
+               {
+                       // Opps, missing form here
+                       define('__USER_VALUE', "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</A>");
+                       define('__UID_VALUE', $_GET['u_id']);
+                       LOAD_TEMPLATE("admin_sub_points");
+               }
+       }
+        else
+       {
+               // User not found!
+               OUTPUT_HTML("<STRONG class=\"admin_failed\">".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."</STRONG>");
+       }
+}
+ else
+{
+       // Output selection form with all confirmed user accounts listed
+       ADD_MEMBER_SELECTION_BOX("0", true);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php
new file mode 100644 (file)
index 0000000..0ed0f4d
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_stats.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar URL statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : URL-Statistiken fuer die Surfbar                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/admin/what-theme_check.php b/inc/modules/admin/what-theme_check.php
new file mode 100644 (file)
index 0000000..1c9d7f0
--- /dev/null
@@ -0,0 +1,154 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/22/2004 *
+ * ================                             Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-extentions.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Extension management                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erweiterungen-Management                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+global $cacheInstance, $cacheArray, $cacheMode;
+
+// Normally we want the overview of all registered theme_check
+$mode = "overview";
+$SEL = 0;
+
+// Get response from our server
+$response = GET_URL("check-themes.php");
+
+// Are theme_check found?
+if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
+{
+       // Ok, mark found and create the array
+       $THEMES = array(
+               'fname'  => array(), // File names
+               'fsize'  => array(), // File size
+               'fctime' => array(), // File creation timestamp
+               'infos'  => array(), // File informations (maybe loaded!)
+               'ver'    => array(), // Version number
+               'cver'   => array(), // Current version number
+       );
+
+       // Get count of theme_check for validation
+       $count = trim($response[sizeof($response) - 2]);
+       foreach ($response as $idx => $value) {
+               $value = str_replace("\n", "", $value); $ver = "";
+
+               // Leave loop when data is invalid or EOF?
+               if ((substr($value, 0, 6) == "theme-") && (substr($value, -4) == ".zip")) {
+                       $name = substr($value, 6, -4);
+                       $file = sprintf("%sthemes/%s/theme.php", PATH, $name);
+                       $ver  = trim(substr($response[$idx + 3], 4));
+
+                       // Load version
+                       $cver = THEME_GET_VERSION($name);
+
+                       // Is the extension already installed or not?
+                       if (((SQL_NUMROWS($result) == 0) && (!FILE_READABLE($file))) || ($ver != $cver)) {
+                               // No, it isn't. So let's add this one!
+                               $THEMES['fname'][]  = $name;
+                               $THEMES['fsize'][]  = $response[$idx + 1];
+                               $THEMES['fctime'][] = $response[$idx + 2];
+                               $THEMES['ver'][]    = $ver;
+                               $THEMES['cver'][]   = $cver;
+
+                               $LANG_DUMMY = explode("[nl]", $response[$idx + 4]);
+                               $LANG = array();
+                               $INFO = ADMIN_EXT_NO_INFO_FOUND;
+
+                               // Trim every data line
+                               foreach ($LANG_DUMMY as $k => $v) {
+                                       $v = trim($v);
+                                       if (substr($v, 3) == "") $v = "---";
+                                       $LANG_DUMMY[$k] = $v;
+                                       if ($v == "xx:xx") break;
+                                       $LANG[] = $v;
+                               } // END - foreach
+
+                               // If language is found stop searching on matching line
+                               foreach($LANG as $search) {
+                                       if (substr($search, 0, 3) == (GET_LANGUAGE().":")) { $INFO = substr($search, 3); break; }
+                               } // END - foreach
+
+                               // Add informations to array
+                               $THEMES['infos'][] = $INFO;
+                       } // END - if
+               } // END - if
+       } // END - foreach
+
+       // Ok, themes are on our server but maybe you have already installed them?
+       if (sizeof($THEMES['fname']) > 0) {
+               // Sort array (I missed ver and cver here)
+               array_pk_sort($THEMES, array("cver", "fname"), 0, 1);
+
+               // Extensions where found which are not downloaded and installed
+               $SW = 2; $OUT = ""; $TSIZE = 0;
+               foreach ($THEMES['fname'] as $idx => $name) {
+                       // Generate download link
+                       $LINK = SERVER_URL."/themes/theme-".$name.".zip";
+                       $OUT .= "<TR>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".($idx + 1).".</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\"><A href=\"".$LINK."\">".$name."</A></TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".MAKE_DATETIME($THEMES['fctime'][$idx], "2")."</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".TRANSLATE_COMMA(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</TD>
+  <TD align=\"center\" class=\"switch_sw".$SW." bottom2\">".$THEMES['ver'][$idx]." (".$THEMES['cver'][$idx].")</TD>
+</TR>
+<TR>
+  <TD class=\"switch_sw".$SW." bottom2\">&nbsp;</TD>
+  <TD colspan=\"4\" class=\"switch_sw".$SW." bottom2\">
+    <FONT class=\"tiny\">".$THEMES['infos'][$idx]."</FONT>
+  </TD>
+</TR>\n";
+                       $TSIZE += $THEMES['fsize'][$idx];
+                       $SW = 3 - $SW;
+               }
+               define('__THEMES_ROWS', $OUT);
+               define('__TKBYTES_VALUE', TRANSLATE_COMMA(round($TSIZE / 1.024) / 1000));
+               define('__TTHEME_VALUE', sizeof($THEMES['fname']));
+
+               // Load template
+               LOAD_TEMPLATE("admin_theme_list");
+       } else {
+               // All Themes are downloaded and installed
+               LOAD_TEMPLATE("admin_theme_installed", false, $count);
+       }
+} else {
+       // No theme where found
+       LOAD_TEMPLATE("admin_theme_404");
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php
new file mode 100644 (file)
index 0000000..7479579
--- /dev/null
@@ -0,0 +1,146 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 02/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-theme_edit.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check for selected themes
+$SEL = 0;
+if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
+if ($SEL > 0) {
+       $OUT = "";
+       foreach ($_POST['sel'] as $id => $sel) {
+               $SQL = "";
+               // Shall I de-/activate or delete themes?
+               if (isset($_POST['status'])) {
+                       // Change status
+                       if ($_POST['active'][$id] == "Y") {
+                               $SQL = "UPDATE "._MYSQL_PREFIX."_themes SET theme_active='N' WHERE id='".$id."' LIMIT 1";
+                       } else {
+                               $SQL = "UPDATE "._MYSQL_PREFIX."_themes SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
+                       }
+                       $OUT = ADMIN_THEMES_UPDATED;
+               } elseif (isset($_POST['del'])) {
+                       // Delete themes
+                       $SQL = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_themes WHERE id='".$id."' LIMIT 1";
+                       $OUT = ADMIN_THEMES_DELETED;
+               }
+
+               // Run SQL command?
+               if (!empty($SQL)) {
+                       // Run it
+                       $result = SQL_QUERY($SQL, __FILE__, __LINE__);
+
+                       // Rebuild cache
+                       REBUILD_CACHE("themes", "them");
+               }
+       }
+
+       // Output generated?
+       if (empty($OUT)) ADMIN_THEME_NO_OUTPUT;
+} elseif (!empty($_GET['default_theme'])) {
+       // Escape string from input
+       $POST['default_theme'] = SQL_ESCAPE($_GET['default_theme']);
+
+       // Set session
+       set_session("mxchange_theme", $POST['default_theme']);
+
+       // Set it in config and current theme as well
+       global $currTheme;
+       $currTheme = $POST['default_theme'];
+       $_CONFIG['default_theme'] = $POST['default_theme'];
+
+       // Save theme
+       ADMIN_SAVE_SETTINGS($POST);
+}
+
+// Switch to testing mode
+$THEME_MODE = "test";
+
+// Generate output lines for the template
+$OUT = ""; $SW = 2;
+$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY theme_path", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0)
+{
+       while(list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result))
+       {
+               // Load theme in test mode
+               require(PATH."theme/".$unix."/theme.php");
+
+               // Is the loaded theme name != current theme name?
+               $LINK = $unix;
+               if ($unix != GET_CURR_THEME()) $LINK = "<A href=\"".URL."/modules.php?module=admin&amp;what=theme_edit&amp;default_theme=".$unix."\" title=\"".ADMIN_SET_AS_NEW_THEME."\">".$unix."</A>";
+
+               // Prepare data for the row template
+               $content = array(
+                       'sw'        => $SW,
+                       'id'        => $id,
+                       'active'    => $active,
+                       'link'      => $LINK,
+                       'name'      => $name,
+                       'is_act'    => TRANSLATE_YESNO($active),
+                       'email'     => "<A href=\"mailto:".$THEME_EMAIL."?Subject=[Theme:] ".$THEME_NAME." (".$unix.")"."\">".$THEME_AUTHOR."</A>",
+                       'url_link'  => DEREFERER($THEME_URL),
+                       'url_title' => $THEME_URL,
+                       'ver'       => $ver,
+               );
+
+               // Load row template and switch color
+               $OUT .= LOAD_TEMPLATE("admin_theme_edit_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+} else {
+               // No themes found???
+       $OUT .= "<TR>
+  <TD colspan=\"7\" class=\"bottom2\" height=\"60\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)."
+  </TD>
+</TR>\n";
+}
+
+define('__THEME_LIST', $OUT);
+
+// Load template
+LOAD_TEMPLATE("admin_theme_edit");
+
+//
+?>
diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php
new file mode 100644 (file)
index 0000000..d075327
--- /dev/null
@@ -0,0 +1,166 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 11/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-theme_import.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Import of new themes                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Importieren von neuen Themes                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Switch to testing mode
+$THEME_MODE = "test";
+
+// Import selected theme if not present
+if (!empty($_POST['theme'])) {
+       // Check if theme is there
+       if (!THEME_CHECK_EXIST($_POST['theme'])) {
+               // Import theme
+               $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme']));
+               if (FILE_READABLE($file)) {
+                       // Load the theme header file
+                       include($file);
+
+                       // Register it ith the exchange
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_themes (theme_path, theme_active, theme_ver, theme_name)
+VALUES ('%s','N','%s','%s')",
+                               array($_POST['theme'], $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__);
+
+                       // Destroy cache
+                       REBUILD_CACHE("themes", "them");
+
+                       // Prepare message
+                       $msg = ADMIN_THEME_IMPORTED_1.$_POST['theme'].ADMIN_THEME_IMPORTED_2;
+               } else {
+                       // Include file not found!
+                       $msg = ADMIN_THEME_INC_404_1.$_POST['theme'].ADMIN_THEME_INC_404_2;
+               }
+       } else {
+               // Theme already imported
+               $msg = ADMIN_THEME_ALREADY_1.$_POST['theme'].ADMIN_THEME_ALREADY_2;
+       }
+
+       // Output message
+       LOAD_TEMPLATE("admin_settings_saved", false, $msg);
+       OUTPUT_HTML("<br />");
+} // END - if
+
+// Initialize array
+$THEMES = array(
+       'theme_unix'   => array(), // Unix name from filesystem
+       'theme_name'   => array(), // Title
+       'theme_author' => array(), // Theme author's name
+       'theme_email'  => array(), // Author's email address
+       'theme_url'    => array(), // URL were you can download it from
+       'theme_ver'    => array(), // Version number of theme
+);
+
+// Read directory "themes"
+$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
+while ($dir = readdir($handle)) {
+       // Construct absolute theme.php file name
+       $theme = sprintf("%stheme/%s/theme.php", PATH, $dir);
+
+       // Test it...
+       if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme))) {
+               // Found a valid directory so let's load it's theme.php file
+               include($theme);
+
+               // Add found theme to array
+               $THEMES['theme_unix'][]   = $dir;
+               $THEMES['theme_name'][]   = $THEME_NAME;
+               $THEMES['theme_author'][] = $THEME_AUTHOR;
+               $THEMES['theme_email'][]  = $THEME_EMAIL;
+               $THEMES['theme_url'][]    = $THEME_URL;
+               $THEMES['theme_ver'][]    = $THEME_VERSION;
+       } // END - if
+} // END - while
+
+// Close directory
+closedir($handle);
+
+// Sort array by Uni* name
+array_pk_sort($THEMES, array("theme_name"));
+
+// Generate output lines for the template
+$OUT = ""; $SW = 2;
+foreach ($THEMES['theme_unix'] as $key => $unix) {
+       // Check if current theme is already imported or not
+       if (THEME_CHECK_EXIST($unix)) {
+               // Already installed
+               $FOUND = "<FONT class=\"admin_note\">".ADMIN_THEME_ALREADY_INSTALLED."</FONT>";
+       } else {
+               // Theme not installed
+               $FOUND = "<FORM action=\"".URL."/modules.php?module=admin&amp;what=theme_import\" method=\"POST\">
+  <INPUT type=\"submit\" name=\"ok\" class=\"admin_submit\" value=\"".ADMIN_INSTALL_THEME."\">
+  <INPUT type=\"hidden\" name=\"theme\" value=\"".$unix."\">
+</FORM>";
+       }
+
+       // Add row
+       $OUT .= "<TR>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\" height=\"30\">".$unix."</TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">".$THEMES['theme_name'][$key]."</TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
+    <A href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")"."\">".$THEMES['theme_author'][$key]."</A>
+  </TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
+    <A href=\"".DEREFERER($THEMES['theme_url'][$key])."\" target=\"_blank\">".$THEMES['theme_url'][$key]."</A>
+  </TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">v".$THEMES['theme_ver'][$key]."</TD>
+  <TD class=\"switch_sw".$SW." bottom2\" align=\"center\">
+    ".$FOUND."
+  </TD>
+</TR>\n";
+
+       // Switch color
+       $SW = 3 - $SW;
+}
+
+if (empty($OUT)) {
+       // No themes found???
+       $OUT .= "<TR>
+  <TD colspan=\"6\" class=\"bottom2\" height=\"80\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)."
+  </TD>
+</TR>\n";
+} // END - if
+define('__THEME_LIST', $OUT);
+
+// Load template
+LOAD_TEMPLATE("admin_theme_import");
+
+//
+?>
diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php
new file mode 100644 (file)
index 0000000..45281dd
--- /dev/null
@@ -0,0 +1,241 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/28/2003 *
+ * ===============                              Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-unlock_emails.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Unlock ordered emails                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Werbebuchungen freigeben                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Define some variables
+global $DATA;
+
+// Check for mails
+$result_main = SQL_QUERY("SELECT id, sender, subject, payment_id, timestamp, url, target_send, cat_id FROM "._MYSQL_PREFIX."_pool WHERE data_type='ADMIN' ORDER BY timestamp", __FILE__, __LINE__);
+
+if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock']))) {
+       // Count checked checkboxes
+       $SEL = 0;
+       if (isset($_POST['sel'])) {
+               // Are there checked boxes?
+               if (count($_POST['sel']) > 0) {
+                       // Count now... We use an own function for now
+                       $SEL = SELECTION_COUNT($_POST['sel']);
+               } // END - if
+       } // END - if
+
+       if (isset($_POST['accept'])) {
+               if ($SEL > 0) {
+                       // Accept mail orders
+                       foreach ($_POST['sel'] as $id => $value) {
+                               // Secure ID number
+                               $id = bigintval($id);
+
+                               // Order placed in queue...
+                               $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment, po.payment_id
+FROM "._MYSQL_PREFIX."_pool AS po
+INNER JOIN "._MYSQL_PREFIX."_payments AS pay
+ON po.payment_id=pay.id
+WHERE po.id=%s
+LIMIT 1",
+                                       array($id), __FILE__, __LINE__);
+
+                               // Update wents fine?
+                               if (SQL_NUMROWS($result) == 1) {
+                                       // Load data
+                                       $DATA = SQL_FETCHARRAY($result);
+
+                                       // Free result
+                                       SQL_FREERESULT($result);
+
+                                       // Is the surfbar installed?
+                                       if ((EXT_IS_ACTIVE("surfbar")) && ($_CONFIG['surfbar_migrate_order'] == "Y")) {
+                                               // Then "migrate" the URL to the surfbar
+                                               SURFBAR_ADMIN_MIGRATE_URL($DATA['url'], $DATA['sender']);
+                                       } // END - if
+
+                                       // Check for bonus extension version >= 0.4.4 for the order bonus
+                                       if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
+                                               // Add points directly
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_order=bonus_order+".$_CONFIG['bonus_order']." WHERE userid=%s LIMIT 1",
+                                                array(bigintval($DATA['sender'])), __FILE__, __LINE__);
+
+                                               // Subtract bonus points from system
+                                               BONUS_POINTS_HANDLER($_CONFIG['bonus_order']);
+                                       } // END - if
+
+                                       // Load email template
+                                       $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", array(), $DATA['sender']);
+
+                                       // Send email
+                                       SEND_EMAIL($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user);
+
+                                       // Unlock selected email
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW' WHERE id=%s AND data_type='ADMIN' LIMIT 1",
+                                               array($id), __FILE__, __LINE__);
+                               } // END - if
+                       } // END - foreach
+
+                       // Set message
+                       $MSG = ADMIN_MAILS_ACTIVATED;
+               } else {
+                       // Nothing checked!
+                       $MSG = ADMIN_MAILS_NOTHING_CHECKED;
+               }
+
+               // Mails unlocked for mail delivery
+               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+       } elseif (isset($_POST['reject'])) {
+               if ($SEL > 0) {
+                       // Reject mail orders
+                       $SW = 2; $OUT = "";
+                       foreach ($_POST['sel'] as $id => $value) {
+                               // Secure ID number
+                               $id = bigintval($id);
+
+                               // Load URL and subject from pool
+                               $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                                array($id), __FILE__, __LINE__);
+
+                               // Load data
+                               $DATA = SQL_FETCHARRAY($result);
+
+                               // Free result
+                               SQL_FREERESULT($result);
+
+                               // Load email template and send it away
+                               $msg_user = LOAD_EMAIL_TEMPLATE("order-reject", array(), $DATA['sender']);
+                               SEND_EMAIL($DATA['sender'], MEMBER_ORDER_REJECTED, $msg_user);
+
+                               // If you do not enter an URL to redirect to, your URL will be set!
+                               if ((empty($_POST['redirect'])) || ($_POST['redirect'] == "http://")) $_POST['redirect'] = URL;
+
+                               // Redirect URL
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1",
+                                array($_POST['redirect'], $id),__FILE__, __LINE__);
+
+                               // Prepare data for the row template
+                               $content = array(
+                                       'sw'  => $SW,
+                                       'id'  => $id,
+                                       'url' => $_POST['url'][$id],
+                               );
+
+                               // Load row template and switch colors
+                               $OUT .= LOAD_TEMPLATE("admin_unlock_emails_redir_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+                       define('__URL_ROWS', $OUT);
+
+                       // Load main template
+                       LOAD_TEMPLATE("admin_unlock_emails_redir");
+               } else {
+                       // Nothing selected
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MAILS_NOTHING_CHECKED);
+               }
+       } elseif ((isset($_POST['lock'])) || ($SEL > 0)) {
+               if ($SEL > 0) {
+                       // Lock URLs
+                       foreach ($_POST['sel'] as $id => $url) {
+                               // Lookup in blacklist
+                               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
+                                array($url), __FILE__, __LINE__);
+                               if (SQL_NUMROWS($result) == 0) {
+                                       // Did not find a record so we can add it... :)
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_url_blist (url, timestamp) VALUES ('%s', UNIX_TIMESTAMP())",
+                                        array($url), __FILE__, __LINE__);
+                               } else {
+                                       // Free memory
+                                       SQL_FREERESULT($result);
+                               }
+                       }
+
+                       // Set message
+                       $MSG = ADMIN_URLS_BLOCKED;
+               } else {
+                       // Nothing selected
+                       $MSG = ADMIN_MAILS_NOTHING_CHECKED;
+               }
+               LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+       } elseif ((empty($_POST['lock'])) && (empty($_POST['accept'])) && (empty($_POST['reject']))) {
+               // Mail orders are in pool so we can display them
+               $SW = 2; $OUT = "";
+               while (list($id, $sender, $subj, $pay, $time, $url, $tsend, $cat) = SQL_FETCHROW($result_main))
+               {
+                       // Prepare data for the template
+                       $content = array(
+                               'sw'        => $SW,
+                               'id'        => $id,
+                               'sender'    => $sender,
+                               'u_link'    => ADMIN_USER_PROFILE_LINK($sender),
+                               'subj'      => COMPILE_CODE($subj),
+                               'tester'    => FRAMETESTER($url),
+                               'url'       => $url,
+                               'cat_title' => str_replace("\"", "&quot;", GET_CATEGORY($cat)),
+                               'cat_link'  => $cat,
+                               'pay_title' => str_replace("\"", "&quot;", GET_PAYMENT($pay, true)),
+                               'pay_link'  => $pay,
+                               'ordered'   => MAKE_DATETIME($time, "2"),
+                               'tsend'     => $tsend,
+                       );
+
+                       // Load row template and switch colors
+                       $OUT .= LOAD_TEMPLATE("admin_unlock_emails_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               define('__UNLOCK_ROWS', $OUT);
+
+               // Prepare rejection URL
+               $REJECT = "http://";
+               if (GET_EXT_VERSION("other") >= "0.1.6") $REJECT = $_CONFIG['reject_url'];
+               define('__REJECT_URL', $REJECT);
+
+               // Load main template
+               LOAD_TEMPLATE("admin_unlock_emails");
+       } else {
+               // Wrong call!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL);
+       }
+} else {
+       // No mail orders fond
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php
new file mode 100644 (file)
index 0000000..98a7207
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+/************************************************************************
+ * M-XChange v0.2.1                                   Start: 04/23/2005 *
+ * ================                             Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-unlock_sponsor.php                          *
+ * -------------------------------------------------------------------- *
+ * Short description : Unlock sponsor accounts                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenaccounts freigeben                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Check if admin has submitted form
+if (isset($_POST['ok'])) {
+       // Does he have selected at least one sponsor?
+       if (SELECTION_COUNT($_POST['id']) > 0) {
+               // At least one entry selected
+               foreach ($_POST['id'] as $id => $sel) {
+                       // Secure ID number
+                       $id = bigintval($id);
+
+                       // Load his personal data
+                       $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, email, remote_addr, sponsor_created, points_amount, refid
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE status='PENDING' AND id='%s' LIMIT 1",
+ array($id), __FILE__, __LINE__);
+                       $refid = 0;
+                       if (SQL_NUMROWS($result_main) == 1) {
+                               // Load data and free memory
+                               list($gender, $sname, $fname, $email, $ip, $created, $points, $refid) = SQL_FETCHROW($result_main);
+
+                               // Check for open payments and close them
+                               $result = SQL_QUERY_ESC("SELECT DISTINCT so.aid, so.pay_count, so.pay_ordered, so.pay_status,
+sp.pay_name, sp.pay_rate, sp.pay_currency
+FROM "._MYSQL_PREFIX."_sponsor_orders AS so
+LEFT JOIN "._MYSQL_PREFIX."_sponsor_paytypes AS sp
+ON sp.id=so.payid
+WHERE so.sponsorid='%s'
+ORDER BY sp.pay_name",
+ array($id), __FILE__, __LINE__);
+                               if (SQL_NUMROWS($result) > 0) {
+                                       // Payment does exist
+                                       while(list($aid, $count, $ordered, $status, $pname, $prate, $pcurr) = SQL_FETCHROW($result))
+                                       {
+                                               if ($aid == "0") {
+                                                       // No admin assigned!
+                                                       $aid = SPONSOR_NO_ADMIN;
+                                               } else {
+                                                       // Load admin's email address for contact
+                                                       $aid = GET_ADMIN_EMAIL(GET_ADMIN_LOGIN(($aid));
+                                               }
+
+                                               // Transfer data to array
+                                               $content = array(
+                                                       'aid'   => $aid,
+                                                       'order' => ($count * $prate)." ".$pcurr,
+                                                       'stamp' => MAKE_DATETIME($ordered, "2"),
+                                                       'pname' => $pname,
+                                               );
+       
+                                               // Load email template
+                                               $content['msg'] = LOAD_EMAIL_TEMPLATE("sponsor_unlock_sponsor_pay", $content, $id);
+                                       }
+                               } else {
+                                       // No payments found
+                                       $content['msg'] = SPONSOR_NO_PAYMENTS_FOUND;
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result_main);
+
+                       // Unlock sponsor account
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='CONFIRMED'
+WHERE id='%s' AND status='PENDING' LIMIT 1",
+ array($id), __FILE__, __LINE__);
+
+                       // Update, if applyable, referral count and points
+                       if (($refid > 0) && ($refid != $id)) {
+                               // Update referral account
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data
+SET points_amount=points_amount+%s, ref_count=ref_count+1
+WHERE id='%s' LIMIT 1",
+ array($_CONFIG['sponsor_ref_points'], bigintval($refid)), __FILE__, __LINE__);
+
+                               // Whas that update fine?
+                               if (SQL_AFFECTEDROWS() == 1) {
+                                       // Load referral's data
+                                       $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email,
+(points_amount - points_used) AS points, receive_warnings, ref_count AS refs
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' LIMIT 1",
+ array(bigintval($refid)), __FILE__, __LINE__);
+                                       $REFERRAL = SQL_FETCHARRAY($result);
+
+                                       // Send warnings out?
+                                       if ($REFERRAL['receive_warnings'] == "Y") {
+                                               // Translate some data
+                                               $REFERRAL['points']     = TRANSLATE_COMMA($REFERRAL['points']);
+                                               $REFERRAL['ref_points'] = TRANSLATE_COMMA($_CONFIG['sponsor_ref_points']);
+                                               $REFERRAL['gender']      = TRANSLATE_GENDER($REFERRAL['gender']);
+
+                                               // Send notification to referral
+                                               $REF_MSG = LOAD_EMAIL_TEMPLATE("sponsor_ref_notify", $REFERRAL);
+                                               SEND_EMAIL($REFERRAL['email'], SPONSOR_REF_NOTIFY_SUBJ, $REF_MSG);
+                                       }
+
+                                       // Free memory
+                                       SQL_FREERESULT($result);
+                               }
+                       }
+
+                       // Transfer data to array
+                       $content['gender']   = TRANSLATE_GENDER($gender);
+                       $content['surname'] = $sname;
+                       $content['family']  = $fname;
+                       $content['sponsor'] = $id;
+                       $content['points']  = TRANSLATE_COMMA($points);
+
+                       // So let's send the email away
+                       $msg = LOAD_EMAIL_TEMPLATE("sponsor_unlocked", $content);
+                       SEND_EMAIL($email, SPONSOR_UNLOCKED_SUBJ, $msg);
+               }
+       } else {
+               // Nothing selected
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_SELECTED_UNLOCK);
+       }
+
+       // Add seperator
+       OUTPUT_HTML("<br />");
+}
+
+// Begin listing of all pending sponsor accounts
+$result = SQL_QUERY("SELECT id, gender, surname, family, email, remote_addr, sponsor_created
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE status='PENDING' ORDER BY id", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0) {
+       // Entries found so let's list them!
+       $OUT = ""; $SW = 2;
+       while(list($id, $gender, $sname, $fname, $email, $ip, $created) = SQL_FETCHROW($result)) {
+               // Transfer data to array
+               $content = array(
+                       'sw'      => $SW,
+                       'id'      => $id,
+                       'gender'   => TRANSLATE_GENDER($gender),
+                       'surname' => $sname,
+                       'family'  => $fname,
+                       'email'   => "mailto:".$email,
+                       'remote'  => $ip,
+                       'created' => MAKE_DATETIME($created, "2"),
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_unlock_sponsor_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__SPONSOR_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_unlock_sponsor");
+} else {
+       // No pending accounts found
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_PENDING);
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-unlock_surfbar_urls.php b/inc/modules/admin/what-unlock_surfbar_urls.php
new file mode 100644 (file)
index 0000000..b112215
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ================                             Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-unlock_surfbar_urls.php                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Unlock pending URLs for surfbar                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wartende URLs in der Surfbar freigeben           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} // END - if
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Is the form sent?
+if ((isset($_POST['unlock'])) && (is_array($_POST['id'])) && (count($_POST['id']) > 0)) {
+       // Unlock selected URLs
+       if (SURFBAR_ADMIN_UNLOCK_URL_IDS($_POST['id'])) {
+               // Unlock done! :-)
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_DONE);
+       } else {
+               // Unlock failed!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_FAILED);
+       }
+} elseif ((isset($_POST['reject'])) && (is_array($_POST['id'])) && (count($_POST['id']) > 0)) {
+       // Reject selected URLs
+       if (SURFBAR_ADMIN_REJECT_URL_IDS($_POST['id'])) {
+               // Unlock done! :-)
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_DONE);
+       } else {
+               // Unlock failed!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_FAILED);
+       }
+}
+
+// List all URLs
+$result = SQL_QUERY("SELECT id, userid, url, UNIX_TIMESTAMP(registered) AS registered
+FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE status='PENDING'
+ORDER BY id ASC", __FILE__, __LINE__);
+
+// Do we have some URLs left?
+if (SQL_NUMROWS($result) > 0) {
+       // List all URLs
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // "Translate"/add content
+               $content['sw']         = $SW;
+               $content['userid']     = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['url']        = FRAMETESTER($content['url']);
+               $content['registered'] = MAKE_DATETIME($content['registered'], 2);
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("admin_unlock_surfbar_urls_row", true, $content);
+
+               // Switch color
+               $SW = 3 - $SW;
+       } // END - while
+
+       // Load main template
+       LOAD_TEMPLATE("admin_unlock_surfbar_urls", false, $OUT);
+} else {
+       // No URLs in surfbar
+       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_URLS_FOUND);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/admin/what-updates.php b/inc/modules/admin/what-updates.php
new file mode 100644 (file)
index 0000000..e6fd292
--- /dev/null
@@ -0,0 +1,173 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/16/2004 *
+ * ================                             Last change: 05/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-updates.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Check for updates                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Prueft nach Updates                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Init array
+$ONLINE['code'] = "???";
+
+// Get response from our server in an array
+$response = GET_URL("check-updates3.php");
+
+if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($response[3])) {
+       // Error!
+       $response = array("", "", "");
+} else {
+       // Analyse header for response code
+       if (eregi("200 OK", $response[0])) {
+               // Found, kill header
+               $pos = 0;
+               foreach($response as $k => $v) {
+                       $v = trim($v);
+                       if (empty($v)) {
+                               // Header ends here (+1)
+                               $pos = $k + 1; break;
+                       }
+               }
+
+               $response2 = array();
+               for($i = $pos; $i < count($response); $i++) {
+                       $response2[] = trim($response[$i]);
+               }
+               $response = $response2; unset($response2);
+               unset($pos);
+
+               // Which is the latest version on server?
+               $ONLINE = array(
+                       'version'  => str_replace("\n", "", $response[0]),
+                       'changed'  => str_replace("\n", "", $response[1]),
+                       'revision' => str_replace("\n", "", $response[2]),
+               );
+
+               // Array for available patches
+               $PATCHES = array(
+                       'fname' => array(),
+                       'fsize' => array(),
+                       'ctime' => array()
+               );
+
+               if (($response[3] != "[EOF]") && ($ONLINE['version'] == FULL_VERSION)) {
+                       // We have found new patches (newer than FULL_VERSION)
+                       $max = str_replace("\n", "", $response[sizeof($response) - 2]); $TOTAL_SIZE = 0;
+
+                       // Maximum of available pacthes extracted (above). Now we can get all informations
+                       for ($idx = 0; $idx < $max; $idx++) {
+                               // List only newer patches
+                               $TEST = substr(str_replace("\n", "", $response[$idx * 5 + 2]), 0, strlen($_CONFIG['patch_level']));
+
+                               // I have removed the addional test for the stored timemark in database or you cannot find
+                               // new updates on my server when you haven't installed it before I upload a patch... :-(
+                               if (bigintval($TEST) > bigintval($_CONFIG['patch_level'])) {
+                                       // Copy every data from the response array
+                                       $PATCHES['fname'][] = str_replace("\n", "", $response[$idx * 5 + 2]);
+                                       $PATCHES['fsize'][] = str_replace("\n", "", $response[$idx * 5 + 3]);
+                                       $PATCHES['ctime'][] = str_replace("\n", "", $response[$idx * 5 + 4]);
+                                       switch (GET_LANGUAGE()) {
+                                               case "de": $PATCHES['descr'][] = str_replace("\n", "", $response[$idx * 5 + 5]); break; // Load german description
+                                               default  : $PATCHES['descr'][] = str_replace("\n", "", $response[$idx * 5 + 6]); break; // Load english description as default
+                                       }
+
+                                       // Add patch's size to total
+                                       $TOTAL_SIZE += $PATCHES['fsize'][$idx];
+                               }
+                       }
+
+                       array_pk_sort($PATCHES, array("ctime", "fname"));
+
+                       // All done here!
+                       $ONLINE['code'] = "200 OK";
+               }
+       } else {
+               // 404 / 403 error from server
+               $ONLINE['code'] = $response[0];
+       }
+}
+
+// Is a newer version available?
+if (empty($ONLINE['version'])) {
+       // Disconnected?
+       LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_failed\">".ADMIN_CANNOT_CHECK_VERSION." (".$ONLINE['code'].")</FONT>");
+} elseif (($ONLINE['version'] != FULL_VERSION) || ($ONLINE['revision'] != CURR_SVN_REVISION)) {
+       // New full-version available (all previous released patches are included in this version!)
+       define('__ONLINE_VERSION', $ONLINE['version']);
+       define('__ONLINE_CHANGE' , MAKE_DATETIME($ONLINE['changed'], "2"));
+       define('__ONLINE_REVISION', $ONLINE['revision']);
+
+       // Load template
+       LOAD_TEMPLATE("admin_update_download");
+/*
+ * DEACTIVATED ON 09/11/2008,02:47 AM
+ *
+} elseif (sizeof($PATCHES['fname']) > 0) {
+       // Some patches are available
+       $OUT = ""; $SW = "2";
+       foreach ($PATCHES['fname'] as $idx => $file) {
+               $SIZE = TRANSLATE_COMMA(round($PATCHES['fsize'][$idx]/102.4)/10);
+               $content = array(
+                       'sw'          => $SW,
+                       'patch_url'   => SERVER_URL."/patches/".$file,
+                       'patch_title' => str_replace("_", " ", str_replace(".zip", "", $file)),
+                       'patch_ctime' => MAKE_DATETIME($PATCHES['ctime'][$idx], "2"),
+                       'patch_size'  => $SIZE,
+                       'patch_desc'  => COMPILE_CODE($PATCHES['descr'][$idx]),
+               );
+               // Evaluate descrition code
+               $eval = "\$content['patch_desc'] = \"".$content['patch_desc']."\";";
+               eval($eval);
+
+               // Load template, switch color and count total size up
+               $OUT .= LOAD_TEMPLATE("admin_patches_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__PATCH_ROWS', $OUT);
+
+       // Total size
+       define('__TOTAL_SIZE', TRANSLATE_COMMA($TOTAL_SIZE / 1024));
+
+       // Load main template
+       LOAD_TEMPLATE("admin_patches");
+*/
+} else {
+       // You have the latest version!
+       LOAD_TEMPLATE("admin_settings_saved", false, NO_UPDATES_AVAILABLE);
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-usage.php b/inc/modules/admin/what-usage.php
new file mode 100644 (file)
index 0000000..9fcbcaa
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/15/2003 *
+ * ===============                              Last change: 04/02/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-usage.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Auto-detection of usage statistics               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Automatische Erkennung der Aufrufstatistiken     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Base directory (should be moved to database)
+$usage = "usage/";
+
+if (!empty($_GET['image'])) {
+       if ($_GET['type'] == "usage") {
+               $file = sprintf("%s%susage.png", PATH, $usage);
+       } else {
+               if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));
+               $file = sprintf("%s%s%s_usage_%s.png", PATH, $usage, SQL_ESCAPE($_GET['type']), SQL_ESCAPE($_GET['image']));
+       }
+
+       if (FILE_READABLE($file)) {
+               $image = imagecreatefrompng($file);
+               header("Content-type: image/png");
+               imagepng($image);
+               imagedestroy($image);
+       }
+       exit();
+} elseif (empty($_GET['usage'])) {
+       $file = sprintf("%s%sindex.html", PATH, $usage);
+} else {
+       $file = sprintf("%s%susage_%s.html",
+               PATH,
+               $usage,
+               SQL_ESCAPE($_GET['usage'])
+       );
+}
+
+if (!empty($file)) {
+       if (FILE_READABLE($file)) {
+                       $tmpl_file = implode("", file($file));
+                       $tmpl_file = addslashes($tmpl_file);
+                       $tmpl_file = "\$content=\"".$tmpl_file."\";";
+                       eval($tmpl_file);
+                       $content = str_replace("usage.png", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=usage&image=usage", $content);
+                       $content = str_replace("daily_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=daily&image=", $content);
+                       $content = str_replace("hourly_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=hourly&image=", $content);
+                       $content = str_replace("ctry_usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&type=ctry&image=", $content);
+                       $content = str_replace("usage_", URL."/modules.php?module=admin&amp;what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content));
+                       // Disabled due to too much trouble
+                       //$content = str_replace("HREF=\"http://", "href=\"".URL."/modules.php?module=loader&amp;url=http://", $content);
+                       $test = strtolower($content);
+                       $body_start = strpos($test, "<body");
+                       $body_end   = strpos($test, "</body>");
+                       if (($body_start > 0) && ($body_end > 0))
+                       {
+                               $content = substr(substr($content, 0, $body_end), $body_start);
+                               $content = substr($content, strpos($content, ">") + 1);
+                               OUTPUT_HTML("<DIV align=\"left\">
+  ".$content."
+</DIV>");
+                       }
+       }
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php
new file mode 100644 (file)
index 0000000..190d17c
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/29/2008 *
+ * ================                             Last change: 01/29/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-user_contct.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Contact the user over a form                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Das Mitglied ueber ein Formular kontaktieren     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Is a user id given?
+if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) {
+       // Load user data and display it
+       $result = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
+
+       // Is a user account found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Load the data
+               $content = SQL_FETCHARRAY($result);
+
+               // Including user ID
+               $content['u_id'] = bigintval($_GET['u_id']);
+
+               // Shall we send the email?
+               if (isset($_POST['ok'])) {
+                       // Insert text
+                       $content['text'] = trim(strip_tags($_POST['text']));
+
+                       // Send contact form out
+                       $msg = LOAD_EMAIL_TEMPLATE("member_contct", $content);
+                       SEND_EMAIL($content['email'], ADMIN_CONTACT_USER_SUBJECT, $msg);
+                       LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_USER_CONTACTED);
+               } else {
+                       // Load contact form template
+                       LOAD_TEMPLATE("admin_contct_user_form", false, $content);
+               }
+       } else {
+               // Not found?
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(USER_ACCOUNT_404, bigintval($_GET['u_id'])));
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+} else {
+       // Display selection box
+       ADD_MEMBER_SELECTION_BOX();
+}
+
+//
+?>
diff --git a/inc/modules/admin/what-user_online.php b/inc/modules/admin/what-user_online.php
new file mode 100644 (file)
index 0000000..f1f7727
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/02/2004 *
+ * ================                             Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-online.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is where? (DO NOT add sub menus!)            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wer ist wo? (KEINE Untermenues anhaengen!)       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+// Count guests, members and admins
+$result_guests  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);
+$result_members = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);
+$result_admins  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='Y'", __FILE__, __LINE__);
+
+OUTPUT_HTML("<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" width=\"170\" class=\"admin_table dashed\">
+<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\">&nbsp;</TD></TR>
+<TR>
+  <TD colspan=\"3\" class=\"admin_title\" align=\"center\">
+    <STRONG>".USER_NOW_ONLINE."</STRONG>
+  </TD>
+</TR>
+<TR><TD colspan=\"5\" height=\"7\" class=\"seperator admin_title\">&nbsp;</TD></TR>
+<TR>
+  <TD width=\"85%\" class=\"top2 bottom2\" align=\"right\"><FONT class=\"medium\">".GUESTS_ONLINE.":</FONT></TD>
+  <TD width=\"5%\" class=\"top2 bottom2\">&nbsp;</TD>
+  <TD width=\"10%\" class=\"top2 bottom2\"><B>".SQL_NUMROWS($result_guests)."</B></TD>
+</TR>
+<TR>
+  <TD width=\"85%\" class=\"bottom2\" align=\"right\"><FONT class=\"medium\">".MEMBERS_ONLINE.":</FONT></TD>
+  <TD width=\"5%\" class=\"bottom2\">&nbsp;</TD>
+  <TD width=\"10%\" class=\"bottom2\"><B>".SQL_NUMROWS($result_members)."</B></TD>
+</TR>
+<TR>
+  <TD width=\"85%\" align=\"right\"><FONT class=\"medium\">".ADMINS_ONLINE.":</FONT></TD>
+  <TD width=\"5%\">&nbsp;</TD>
+  <TD width=\"10%\"><B>".SQL_NUMROWS($result_admins)."</B></TD>
+</TR>
+</TABLE><br />");
+
+$result = SQL_QUERY("SELECT id, ip, userid, refid, module, action, what, is_member, is_admin, timestamp FROM "._MYSQL_PREFIX."_online ORDER by timestamp DESC", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0)
+{
+       // Load header template
+       LOAD_TEMPLATE("admin_online_header");
+
+       // List all online users
+       $SW = 2;
+       while (list($id, $ip, $userid, $refid, $module, $action, $what, $mem, $admin, $time) = SQL_FETCHROW($result))
+       {
+               if ($action == "") $action = "---";
+               if ($what   == "")   $what = "---";
+
+               if ($admin == "Y")
+               {
+                       // Is an administrator
+                       $userid = _IS_ADMIN;
+               }
+               elseif (($mem == "N") && ($admin == "N"))
+               {
+                       // Is a guest
+                       $userid = _IS_GUEST;
+               }
+               OUTPUT_HTML("<TR>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$id."</TD>
+  <TD align=\"center\" width=\"15%\" class=\"switch_sw".$SW." bottom right\">");
+               if ($userid > 0)
+               {
+                       OUTPUT_HTML("<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;u_id=".$userid."\">".$userid."</A>");
+               }
+               else
+               {
+                       OUTPUT_HTML($userid);
+               }
+               if ($refid > 0)
+               {
+                       $refid = "<A href=\"".URL."/modules.php?module=admin&amp;what=list_user&amp;u_id=".$refid."\">".$refid."</A>";
+               }
+               OUTPUT_HTML("</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$ip."</TD>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$refid."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$module."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$action."</TD>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$what."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".MAKE_DATETIME($time, "2")."</TD>
+</TR>");
+               $SW = 3 - $SW;
+       }
+       OUTPUT_HTML("<TR>
+  <TD colspan=\"8\" align=\"center\" class=\"admin_footer\">
+    ".ONLINE_TIMEOUT_IS_1.CREATE_FANCY_TIME($_CONFIG['online_timeout']).ONLINE_TIMEOUT_IS_2."
+  </TD>
+</TR>
+</TABLE>");
+}
+//
+?>
diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php
new file mode 100644 (file)
index 0000000..6ec2f99
--- /dev/null
@@ -0,0 +1,127 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/14/2005 *
+ * ================                             Last change: 01/14/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-usr_online.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is where? (DO NOT add sub menus!)            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wer ist wo? (KEINE Untermenues anhaengen!)       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+if (EXT_IS_ACTIVE("online", true))
+{
+       // Count guests, members and admins
+       $result_guests  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);
+       $result_members = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);
+       $result_admins  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='Y'", __FILE__, __LINE__);
+
+       // Remember values for the template
+       define('_GUESTS_ONLINE' , SQL_NUMROWS($result_guests));
+       define('_ADMINS_ONLINE' , SQL_NUMROWS($result_admins));
+       define('_MEMBERS_ONLINE', SQL_NUMROWS($result_members));
+
+       // Free memory
+       SQL_FREERESULT($result_guests);
+       SQL_FREERESULT($result_admins);
+       SQL_FREERESULT($result_members);
+
+       // Load template
+       LOAD_TEMPLATE("admin_mini_online");
+
+       // Check for online users
+       $result = SQL_QUERY("SELECT id, ip, userid, refid, module, action, what, is_member, is_admin, timestamp FROM "._MYSQL_PREFIX."_online ORDER by timestamp DESC", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Load header template
+               LOAD_TEMPLATE("admin_online_header");
+
+               // List all online users
+               $SW = 2;
+               while (list($id, $ip, $uid, $ref, $mod, $act, $wht, $mem, $admin, $time) = SQL_FETCHROW($result))
+               {
+                       if (empty($act)) $act = "---";
+                       if (empty($wht))   $wht = "---";
+
+                       if ($admin == "Y")
+                       {
+                               // Is an administrator
+                               $uid = _IS_ADMIN;
+                       }
+                        elseif (($mem == "N") && ($admin == "N"))
+                       {
+                               // Is a guest
+                               $uid = _IS_GUEST;
+                       }
+                       OUTPUT_HTML("<TR>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$id."</TD>
+  <TD align=\"center\" width=\"15%\" class=\"switch_sw".$SW." bottom right\">");
+                       if ($uid > 0)
+                       {
+                               OUTPUT_HTML(ADMIN_USER_PROFILE_LINK($uid));
+                       }
+                        else
+                       {
+                               OUTPUT_HTML($uid);
+                       }
+                       if ($ref > 0)
+                       {
+                               $ref = ADMIN_USER_PROFILE_LINK($ref);
+                       }
+                       OUTPUT_HTML("</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$ip."</TD>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$ref."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$mod."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$act."</TD>
+  <TD align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$wht."</TD>
+  <TD align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".MAKE_DATETIME($time, "2")."</TD>
+</TR>");
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Load footer template
+               define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['online_timeout']));
+               LOAD_TEMPLATE("admin_online_footer");
+       }
+}
+ else
+{
+       // Online statistics deactivated!
+       LOAD_TEMPLATE("admin_settings_saved", false, ONLINE_STATISTICS_DEACTIVATED);
+}
+//
+?>
diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php
new file mode 100644 (file)
index 0000000..a96bc1d
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/26/2003 *
+ * ===============                              Last change: 02/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : chk_login.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Check if user has logged in (delay)              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Pruefen ob die Login-Cookies gesetzt sind        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// @TODO Replace with own template!
+OPEN_TABLE("500", "guest_login_header dashed", "center");
+OUTPUT_HTML("<br /><strong>".VALIDATING_LOGIN."</strong><br />");
+
+if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash')) && (isSessionVariableSet('lifetime'))) {
+       // Login failtures are supported since 0.4.7
+       // Do we have 0.4.7 of sql_patches or later?
+       $ADD = "";
+       if (GET_EXT_VERSION("sql_patches") >= "0.4.7") {
+               // Load them here
+               $ADD = ", login_failtures, UNIX_TIMESTAMP(last_failture) AS last_failture";
+       } // END - if
+
+       // Get theme from profile
+       $result = SQL_QUERY_ESC("SELECT curr_theme".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Load data
+       $data = SQL_FETCHARRAY($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Change to new theme
+       set_session("mxchange_theme", $data['curr_theme']);
+
+       // Remmeber login failtures if available
+       if (GET_EXT_VERSION("sql_patches") >= "0.4.7") {
+               // Reset login failtures
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET login_failtures=0, last_failture='0000-00-00 00:00:00'
+WHERE userid=%s
+LIMIT 1",
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Store it in session
+               set_session('mxchange_member_failtures', $data['login_failtures']);
+               set_session('mxchange_member_last_fail', $data['last_failture']);
+       } // END - if
+
+       // Bonus is not given by default ;-)
+       $bonus = false;
+       if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && ($_CONFIG['bonus_login_yn'] == "N") && ($_CONFIG['bonus_login_yn'] == "Y")) {
+               // Update last login if far enougth away
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET last_login=UNIX_TIMESTAMP()
+WHERE userid=%s AND last_login < (UNIX_TIMESTAMP() - %s)
+LIMIT 1",
+                       array(
+                               $GLOBALS['userid'],
+                               $_CONFIG['login_timeout']
+                       ), __FILE__, __LINE__
+               );
+               if (SQL_AFFECTEDROWS() == 1) $bonus = true;
+       } // END - if
+
+       if (($bonus) && ($_GET['mode'] == "bonus") && (EXT_IS_ACTIVE("bonus"))) {
+               // Output message with added points
+               OUTPUT_HTML("<font class=\"tiny\">
+  ".BONUS_LOGIN_BONUS_ADDED_1."
+  <strong>".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS."</strong>
+  ".BONUS_LOGIN_BONUS_ADDED_2."
+</font>");
+       } elseif (EXT_IS_ACTIVE("bonus")) {
+               // No login bonus added!
+               OUTPUT_HTML("<font class=\"member_failed\">".BONUS_LOGIN_BONUS_NOT_ADDED."</font>");
+       }
+
+       // Redirect to member area
+       LOAD_TEMPLATE("member_login_js");
+} else {
+       // Login failed!
+       LOAD_TEMPLATE("login_failed_js");
+}
+
+// Close table
+CLOSE_TABLE();
+
+//
+?>
diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php
new file mode 100644 (file)
index 0000000..4e3f4f3
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/24/2003 *
+ * ===============                              Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : frametester.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Test your website against frame killers          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Testet die Mitgliedsseite gegen Frame-Killer     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+$MODE = "guest";
+
+if (!empty($_GET['order'])) {
+       // Order number placed, is he also logged in?
+       if(IS_MEMBER()) {
+               // Ok, test passed... :)
+               $result = SQL_QUERY_ESC("SELECT subject, url FROM "._MYSQL_PREFIX."_pool WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
+                array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Finally is the entry valid?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load subject and URL (but forwhat do we need the subject line here???
+                       list($sub, $url) = SQL_FETCHROW($result);
+
+                       // This fixes a white page
+                       $_POST['url'] = $url;
+
+                       // Mode is member
+                       $MODE = "member";
+               } else {
+                       // Matching line not found!
+                       LOAD_URL("modules.php?module=index&amp;what=login");
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } else {
+               // He is no longer logged in
+               LOAD_URL("modules.php?module=index&amp;what=login");
+       }
+}
+
+if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame']))) {
+       // Default URL is ours
+       $url = URL;
+
+       // Decode URL if set in GET parameters
+       if (!empty($_GET['url']))  $url = gzuncompress(base64_decode(str_replace(" ", "+", COMPILE_CODE(urldecode($_GET['url'])))));
+
+       // Use URL from POST data if set
+       if (!empty($_POST['url'])) $url = $_POST['url'];
+
+       // Add missing element
+       $frame = "";
+       if (!empty($_GET['frame'])) $frame = SQL_ESCAPE($_GET['frame']);
+       switch ($frame)
+       {
+       case "":
+               switch ($MODE)
+               {
+               case "member":
+                       // Build frameset
+                       define('__ORDER_VALUE', bigintval($_GET['order']));
+                       define('__URL_VALUE'  , DEREFERER($url));
+                       LOAD_TEMPLATE("member_order_frametester");
+                       break;
+
+               case "guest":
+                       define('__URL_VALUE'  , DEREFERER($url));
+                       LOAD_TEMPLATE("guest_frametester");
+                       break;
+               }
+               break;
+
+       case "test_top":
+               OUTPUT_HTML("<STRONG class=\"guest_done\">".GUEST_FRAMETESTER_TOP."</SPAN>");
+               break;
+
+       case "back": // Back buttom
+               LOAD_TEMPLATE("member_order_back", false, $_GET['order']);
+               break;
+
+       case "send": // Send mail away
+               LOAD_TEMPLATE("member_order_send", false, $_GET['order']);
+               break;
+       }
+} else {
+       // Go away...
+       LOAD_URL("modules.php?module=login");
+}
+//
+?>
diff --git a/inc/modules/guest/.htaccess b/inc/modules/guest/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/modules/guest/action- b/inc/modules/guest/action-
new file mode 100644 (file)
index 0000000..1194380
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/27/2004 *
+ * ================                             Last change: 01/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the guest action module
+       include($INC);
+} else {
+       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php
new file mode 100644 (file)
index 0000000..68567e0
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ================                             Last change: 04/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-admin.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Administrative links                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Administrative Links                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+if (GET_ACTION("guest", $GLOBALS['what']) == "admin") {
+       // Only when one admin link is clicked...
+       $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
+       if (FILE_READABLE($INC)) {
+               // Ok, we finally load the guest action module
+               include($INC);
+       } else {
+               ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+       }
+} // END - if
+
+//
+?>
diff --git a/inc/modules/guest/action-main.php b/inc/modules/guest/action-main.php
new file mode 100644 (file)
index 0000000..854a7d8
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/10/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-main.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Main menu: register, login, welcome and so on    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptmenue: Anmeldung, Login, Willkommen usw.    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
+$IS_VALID = WHAT_IS_VALID(GET_ACTION("guest", $GLOBALS['what']), $GLOBALS['what'], "guest");
+
+if ((FILE_READABLE($INC)) && ($IS_VALID)) {
+       // Ok, we finally load the guest action module
+       require_once($INC);
+} elseif ($IS_VALID) {
+       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+} else {
+       ADD_FATAL(GUEST_LOCKED_ACTION);
+}
+
+//
+?>
diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php
new file mode 100644 (file)
index 0000000..32dd12b
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/14/2003 *
+ * ===============                              Last change: 01/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-members.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Menu points for members (login register, ...)    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Menues fuer Mitglieder (Login, Anmeldung, ...)   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the guest action module
+       include($INC);
+} else {
+       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php
new file mode 100644 (file)
index 0000000..07fbcec
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/02/2004 *
+ * ================                             Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-online.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is where? (DO NOT add sub menus!)            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Wer ist wo? (KEINE Untermenues anhaengen!)       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("online")) {
+       // Just skip this extension
+       return;
+}
+
+$result_guests  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);
+$result_members = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);
+$result_admins  = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_online WHERE is_admin='Y'", __FILE__, __LINE__);
+
+// Total visitors online
+$total      = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins);
+if ($_CONFIG['mad_count'] < $total) {
+       // Update counter
+       UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
+       $_CONFIG['mad_count'] = $total;
+       $_CONFIG['last_mad']  = time();
+}
+
+// Put all values in constants for the template
+define('GUESTS_ONLINE_CNT' , SQL_NUMROWS($result_guests));
+define('MEMBERS_ONLINE_CNT', SQL_NUMROWS($result_members));
+define('ADMINS_ONLINE_CNT' , SQL_NUMROWS($result_admins));
+
+// Output table
+LOAD_TEMPLATE("online_now");
+
+if (EXT_IS_ACTIVE("active")) {
+       // Init content
+       $content = array(
+               'menu' => "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&amp;what=active\">".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."</A>",
+               'what' => "active"
+       );
+
+       // Add link to "we were active today" page
+       LOAD_TEMPLATE("guest_menu_bottom", false, $content);
+} // END - if
+
+//
+?>
diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php
new file mode 100644 (file)
index 0000000..4f7c9b5
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-sponsor.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor area                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenbereich                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load the include file
+$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC)) {
+       // Ok, we finally load the guest action module
+       include($INC);
+} else {
+       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php
new file mode 100644 (file)
index 0000000..a94178b
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/12/2004 *
+ * ================                             Last change: 11/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-themes.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme selector                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Theme-Auswahl                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Already loaded?
+if (defined('__THEME_SELECTION_CONTENT')) return false;
+
+// Load all active designs (or all if admin)
+$whereStatement = ""; $OUT = "";
+if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
+$result_themes = SQL_QUERY("SELECT theme_path FROM "._MYSQL_PREFIX."_themes".$whereStatement, __FILE__, __LINE__);
+$num_themes = SQL_NUMROWS($result_themes);
+
+if ($num_themes > 1) {
+       // If more than 1 is installed output selection box
+       $act = "";
+       if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
+       $OUT = THEME_SELECTION_BOX("index", $act, $GLOBALS['what'], $result_themes);
+} elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
+       // If there's only one just print it's name
+       define('__THEME_NAME', GET_CURR_THEME_NAME());
+       $OUT = LOAD_TEMPLATE("theme_one", true);
+} elseif (IS_ADMIN()) {
+       // If there is no theme installed and there's an admin notify him!
+       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, "<FONT class=\"admin_note\">".ADMIN_NO_THEME_INSTALLED_WARNING."</FONT>");
+}
+
+// Remember
+define('__THEME_SELECTION_CONTENT', $OUT);
+
+// Free memory
+SQL_FREERESULT($result_themes);
+
+// Load final box template
+LOAD_TEMPLATE("theme_select_box");
+
+//
+?>
diff --git a/inc/modules/guest/what- b/inc/modules/guest/what-
new file mode 100644 (file)
index 0000000..0b024b4
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/27/2004 *
+ * ================                             Last change: 01/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyleft (c) 2003, 2004, 2005 by Roland Haeder                       *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load default template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php
new file mode 100644 (file)
index 0000000..4435932
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/26/2004 *
+ * ================                             Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-active.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Today active members list                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Liste heutiger aktiver Mitglieder                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// The day normally starts on 00:00:00, so let's subtract current hours/minutes/seconds from current time stamp!
+$START = time() - date("H", time())*60*60 - date("m", time())*60 - date("s", time());
+
+// Check for members who were active only this day
+$ADD = "uid";
+if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname";
+
+$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online
+FROM "._MYSQL_PREFIX."_user_data
+WHERE last_online >= %s AND status='CONFIRMED'
+ORDER BY last_online DESC LIMIT %s",
+ array($START, $_CONFIG['active_limit']), __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // At least one member was online so let's load them all
+       $OUT = ""; $SW = 2;
+       while(list($uid, $nick, $last) = SQL_FETCHROW($result))
+       {
+               $nick2 = "---";
+               if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+
+               // Transfer data to array
+               $content = array(
+                       'sw'     => $SW,
+                       'uid'    => $uid,
+                       'nick'   => $nick2,
+                       'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points")),
+                       'last'   => MAKE_DATETIME($last, "2"),
+               );
+
+               // Load template
+               $OUT .= LOAD_TEMPLATE("guest_active_row", true, $content);
+
+               // Switch colors
+               $SW = 3 - $SW;
+       }
+}
+ else
+{
+       // No member was online today! :-(
+       $OUT = LOAD_TEMPLATE("guest_active_none_row", true);
+}
+
+// Remember output in constant
+define('__ACTIVE_ROWS', $OUT);
+
+// Load template
+LOAD_TEMPLATE("guest_active_table");
+
+//
+?>
diff --git a/inc/modules/guest/what-admin.php b/inc/modules/guest/what-admin.php
new file mode 100644 (file)
index 0000000..f8a4af5
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ================                             Last change: 04/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-admin.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Go to admin area                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Zum Administrationsbereich                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Redirect...
+LOAD_URL (URL."/modules.php?module=admin&amp;action=login");
+
+//
+?>
diff --git a/inc/modules/guest/what-agb.php b/inc/modules/guest/what-agb.php
new file mode 100644 (file)
index 0000000..e802710
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 03/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-agb.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : General regulations                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine Geschaeftsbedingungen                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR ("guest", basename(__FILE__));
+
+// Load default template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-beg.php b/inc/modules/guest/what-beg.php
new file mode 100644 (file)
index 0000000..9e5ee35
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/09/2005 *
+ * ================                             Last change: 01/09/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-beg.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Beg points with us!                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mit uns Punkte erbetteln!                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Prepare constants
+define('__BEG_POINTS'    , TRANSLATE_COMMA($_CONFIG['beg_points']));
+define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max']));
+if ($GLOBALS['refid'] > 0) {
+       // Take referral ID from URL/Cookie
+       define('__BEG_UID'       , $GLOBALS['refid']);
+} else {
+       // Take default referral ID
+       define('__BEG_UID'       , $_CONFIG['def_refid']);
+}
+
+if (function_exists('CREATE_FANCY_TIME')) {
+       define('__BEG_TIMEOUT'    , CREATE_FANCY_TIME($_CONFIG['beg_timeout']));
+       define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout']));
+} else {
+       define('__BEG_TIMEOUT '   , round($_CONFIG['beg_timeout']     / 60)." ".MINUTES);
+       define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES);
+}
+
+// Load final template
+LOAD_TEMPLATE("guest_".substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php
new file mode 100644 (file)
index 0000000..22acf14
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/13/2003 *
+ * ===============                              Last change: 08/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-confirm.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Stuff around the confirmation link               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alles um den Bestaetigungslink                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+if (!empty($_GET['hash'])) {
+       // Initialize the user ID
+       $uid = 0;
+
+       // Search for an unconfirmed or confirmed account
+       $result = SQL_QUERY_ESC("SELECT userid, email, refid FROM "._MYSQL_PREFIX."_user_data WHERE user_hash='%s' AND (status='UNCONFIRMED' OR status='CONFIRMED') LIMIT 1",
+               array($_GET['hash']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Ok, he want's to confirm now so we load some data
+               list ($uid, $email, $rid) = SQL_FETCHROW($result);
+
+               // Unlock his account (but only when it is on UNCONFIRMED!)
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET status='CONFIRMED', ref_payout=%s, user_hash=NULL WHERE user_hash='%s' AND status='UNCONFIRMED' LIMIT 1",
+                       array($_CONFIG['ref_payout'], $_GET['hash']), __FILE__, __LINE__);
+               if (SQL_AFFECTEDROWS() == 1) {
+                       $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => $_CONFIG['points_register']), bigintval($uid));
+
+                       // And send him right away the confirmation mail
+                       SEND_EMAIL($email, GUEST_THANX_CONFIRM, $msg);
+
+                       // Maybe he got "referraled"?
+                       if (($rid > 0) && ($rid != $uid)) {
+                               // Select the referral userid
+                               $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                array(bigintval($rid)), __FILE__, __LINE__);
+                               if (SQL_NUMROWS($result) == 1) {
+                                       // Update ref counter...
+                                       UPDATE_REF_COUNTER($rid);
+
+                                       // Ok, write the ref-points to this user and his parent-ref
+                                       unset($DEPTH);
+
+                                       // Shall I "pay" the referral points imidiately?
+                                       if ($_CONFIG['ref_payout'] == "0") {
+                                               // Yes, "pay" it now
+                                               $locked = false;
+                                       } else {
+                                               // No, "pay" it later
+                                               $locked = true;
+                                       }
+
+                                       // If version matches add ref bonus to refid's account
+                                       if ((GET_EXT_VERSION("bonus") >= "0.4.4") && ($_CONFIG['bonus_active'] == "Y")) {
+                                               // Add points (directly only!)
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_ref=bonus_ref+%s WHERE userid=%s LIMIT 1",
+                                                array($_CONFIG['bonus_ref'], bigintval($rid)), __FILE__, __LINE__);
+
+                                               // Subtract points from system
+                                               BONUS_POINTS_HANDLER($_CONFIG['bonus_ref']);
+                                       } // END - if
+
+                                       // Add one-time referral bonus over referral system or directly
+                                       $DEPTH = 0;
+                                       ADD_POINTS_REFSYSTEM($rid, $_CONFIG['points_ref'], true, bigintval($uid), $locked, $_CONFIG['reg_points_mode']);
+                               } // END - if
+                       } // END - if
+
+                       if (EXT_IS_ACTIVE("rallye")) {
+                               // Add user to rallye (or not?)
+                               RALLYE_AUTOADD_USER(bigintval($uid));
+                       } // END - if
+
+                       // Account confirmed!
+                       if (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+                               // Set special lead cookie
+                               set_session("lead_uid", bigintval($uid));
+
+                               // Lead-Code mode enabled
+                               LOAD_URL("lead-confirm.php");
+                       } else {
+                               define('__CONFIRM_MSG', GUEST_CONFIRMED_DONE);
+                               define('__UID', bigintval($uid));
+                               LOAD_TEMPLATE("guest_confirm_table");
+                       }
+               } elseif (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
+                       // Set special lead cookie
+                       set_session("lead_uid", bigintval($uid));
+
+                       // Lead-Code mode enabled
+                       LOAD_URL("lead-confirm.php");
+               } else {
+                       // Nobody was found unter this hash key... or our new member want's to confirm twice?
+                       define('__CONFIRM_MSG', GUEST_CONFIRMED_TWICE);
+                       define('__UID', "0");
+                       LOAD_TEMPLATE("guest_confirm_table");
+               }
+       } else {
+               // Nobody was found unter this hash key... or our new member want's to confirm twice?
+               define('__CONFIRM_MSG', GUEST_CONFIRMED_TWICE);
+               define('__UID', "0");
+               LOAD_TEMPLATE("guest_confirm_table");
+       }
+}
+ elseif ((isset($_POST['ok'])) && (!empty($_POST['email'])))
+{
+       // Confirmation link requested      0     1         2
+       $result = SQL_QUERY_ESC("SELECT userid, status, user_hash FROM "._MYSQL_PREFIX."_user_data WHERE email='%s' LIMIT 1",
+        array($_POST['email']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Email address found
+               $DATA = SQL_FETCHROW($result);
+               switch ($DATA[1])
+               {
+               case "UNCONFIRMED": // Account not confirmed
+                       $msg = LOAD_EMAIL_TEMPLATE("guest_request_confirm", array('hash' => $DATA[2]), $DATA[0]);
+                       SEND_EMAIL($_POST['email'], REQUEST_CONFIRM_LINK_SUBJ, $msg);
+                       $content = CONFIRM_LINK_SENT;
+                       break;
+
+               case "CONFIRMED": // Account already confirmed
+                       $content = LOGIN_ID_CONFIRMED;
+                       break;
+
+               case "LOCKED": // Account is locked
+                       $content = LOGIN_ID_LOCKED;
+                       break;
+               }
+       }
+        else
+       {
+               // Email address not registered
+               $content = EMAIL_ADDY_404;
+       }
+
+       define('__CONFIRM_MSG', $content);
+       LOAD_TEMPLATE("guest_confirm_table");
+}
+ else
+{
+       // No hash found, the guest may want to enter his email address to re-get his confirmation link?
+       LOAD_TEMPLATE("guest_confirm_link");
+}
+
+//
+?>
diff --git a/inc/modules/guest/what-doubler.php b/inc/modules/guest/what-doubler.php
new file mode 100644 (file)
index 0000000..fc14a72
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/17/2005 *
+ * ================                             Last change: 02/18/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-doubler.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : General doubling informations                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine Informationen zum Verdoppen           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "doubler");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Percent values etc.
+define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100));
+define('__REF_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100));
+define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points']));
+define('__MIN_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_min']));
+define('__MAX_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_max']));
+
+// Transfer referral ID
+define('__REFID', $GLOBALS['refid']);
+
+// Usage counter
+define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']);
+
+// Which mail-send-mode did the admin setup?
+switch ($_CONFIG['doubler_send_mode'])
+{
+case "DIRECT":
+       define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
+       break;
+
+case "RESET":
+       define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_RESET);
+       break;
+}
+
+// Generate table with already payed out doubles
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE("0", "Y", "N", "DESC"));
+
+// Generate table with next-to-run payouts
+define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE());
+
+// Generate timemark
+define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout']));
+
+// Points left to double
+define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
+
+// Load template
+LOAD_TEMPLATE("guest_doubler");
+
+//
+?>
diff --git a/inc/modules/guest/what-impressum.php b/inc/modules/guest/what-impressum.php
new file mode 100644 (file)
index 0000000..b0ae9cf
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 03/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-impressum.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Who is the webmaster?                            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Impressum                                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load template template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-infos.php b/inc/modules/guest/what-infos.php
new file mode 100644 (file)
index 0000000..ae5be50
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 03/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-infos.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : General informations                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine Informationen                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load default template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php
new file mode 100644 (file)
index 0000000..7a147e0
--- /dev/null
@@ -0,0 +1,355 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/14/2003 *
+ * ===============                              Last change: 04/28/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-login.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Login area (redirects to the real login module)  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Loginbereich (leitet an das richtige Lgin-Modul  *
+ *                     weiter)                                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+global $DATA, $FATAL;
+
+// Initialize data
+$probe_nickname = false; $uid = false; $hash = "";
+unset($login); unset($online);
+
+if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash'))) {
+       // Already logged in?
+       $uid = $GLOBALS['userid'];
+} elseif ((!empty($_POST['id'])) && (!empty($_POST['password'])) && (isset($_POST['ok']))) {
+       // Set userid and crypt password when login data was submitted
+       $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".bigintval($_POST['id'])."") != $_POST['id']));
+       if ($probe_nickname === true) {
+               // Nickname entered
+               $uid = SQL_ESCAPE($_POST['id']);
+       } else {
+               // Direct userid entered
+               $uid  = bigintval($_POST['id']);
+       }
+} elseif (!empty($_POST['new_pass'])) {
+       // New password requested
+       $uid = 0;
+       if (!empty($_POST['id'])) $uid = $_POST['id'];
+} else {
+       // Not logged in
+       $uid = 0; $hash = "";
+}
+
+$URL = ""; $ADD = "";
+// Set unset variables
+if (empty($_POST['new_pass'])) $_POST['new_pass'] = "";
+if (empty($_GET['login']))     $_GET['login']     = "";
+
+if (IS_MEMBER()) {
+       // Login immidiately...
+       $URL = URL."/modules.php?module=login";
+} elseif ((isset($_POST['ok'])) && ("".$uid."" != "".$_POST['id']."")) {
+       // Invalid input (no nickname extension installed but nickname entered)
+       $ERROR = CODE_EXTENSION_PROBLEM;
+} elseif (isset($_POST['ok'])) {
+       // Add last_login if available
+       $LAST = "";
+       if (GET_EXT_VERSION("sql_patches") >= "0.2.8") {
+               $LAST = ", last_login";
+       } // END - if
+
+       // Check login data
+       $password = "";
+       if ($probe_nickname === true) {
+               // Nickname entered
+               $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' AND status='CONFIRMED' LIMIT 1",
+                array($uid), __FILE__, __LINE__);
+               list($uid2, $password, $online, $login) = SQL_FETCHROW($result);
+               if (!empty($uid2)) $uid = bigintval($uid2);
+       } else {
+               // Direct userid entered
+               $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                array($uid, $hash), __FILE__, __LINE__);
+               list($dmy, $password, $online, $login) = SQL_FETCHROW($result);
+       }
+
+       // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // By default the hash is empty
+               $hash = "";
+
+               // Check for old MD5 passwords
+               if ((strlen($password) == 32) && (md5($_POST['password']) == $password)) {
+                       // Just set the hash to the password from DB... :)
+                       $hash = $password;
+               } else {
+                       // Encrypt hash for comparsion
+                       $hash = generateHash($_POST['password'], substr($password, 0, -40));
+               }
+
+               if ($hash == $password) {
+                       // New hashed password found so let's generate a new one
+                       $hash = generateHash($_POST['password']);
+
+                       // ... and update database
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET password='%s' WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                        array($hash, $uid), __FILE__, __LINE__);
+
+                       // No login bonus by default
+                       $BONUS = false;
+
+                       // Probe for last online timemark
+                       $probe = time() -  $online;
+                       if (!empty($login)) $probe = time() - $login;
+                       if ((GET_EXT_VERSION("bonus") >= "0.2.2") && ($probe >= $_CONFIG['login_timeout'])) {
+                               // Add login bonus to user's account
+                               $ADD = ", login_bonus=login_bonus+'".$_CONFIG['login_bonus']."'";
+                               $BONUS = true;
+
+                               // Subtract login bonus from userid's account or jackpot
+                               if ((GET_EXT_VERSION("bonus") >= "0.3.5") && ($_CONFIG['bonus_mode'] != "ADD")) BONUS_POINTS_HANDLER('login_bonus');
+                       } // END - if
+
+
+                       // Secure lifetime from input form
+                       $l = bigintval($_POST['lifetime']);
+                       $life = "-1";
+                       if ($l > 0) {
+                               // Calculate lifetime of cookies
+                               $life = time() + $l;
+
+                               // Calculate new hash with the secret key and master salt together
+                               $hash = generatePassString($hash);
+
+                               // Update cookies
+                               $login = (set_session("userid"  , $uid , $life, COOKIE_PATH)
+                                      && set_session("u_hash"  , $hash, $life, COOKIE_PATH)
+                                      && set_session("lifetime", $l   , $life, COOKIE_PATH));
+
+                               // Update global array
+                               $GLOBALS['userid'] = $uid;
+                       } else {
+                               // Check for login data
+                               $login = IS_MEMBER();
+                       }
+
+                       if ($login) {
+                               // Update database records
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET total_logins=total_logins+1".$ADD." WHERE userid=%s LIMIT 1",
+                                array($uid), __FILE__, __LINE__);
+                               if (SQL_AFFECTEDROWS() == 1) {
+                                       // Procedure to checking for login data
+                                       if (($BONUS) && (EXT_IS_ACTIVE("bonus"))) {
+                                               // Bonus added (just displaying!)
+                                               $URL = URL."/modules.php?module=chk_login&amp;mode=bonus";
+                                       } else {
+                                               // Bonus not added
+                                               $URL = URL."/modules.php?module=chk_login&amp;mode=login";
+                                       }
+                               } else {
+                                       // Cannot update counter!
+                                       $URL = URL."/modules.php?module=index&amp;what=login&amp;login=".CODE_CNTR_FAILED;
+                               }
+                       } else {
+                               // Cookies not setable!
+                               $URL = URL."/modules.php?module=index&amp;what=login&amp;login=".CODE_NO_COOKIES;
+                       }
+               } else {
+                       // Update failture counter
+                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET login_failtures=login_failtures+1,last_failture=NOW() WHERE userid=%s LIMIT 1",
+                               array($uid), __FILE__, __LINE__);
+
+                       // Wrong password!
+                       $ERROR = CODE_WRONG_PASS;
+               }
+       } else {
+               // Other account status?
+               $result = SQL_QUERY_ESC("SELECT status FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array($uid), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Load status
+                       list($status) = SQL_FETCHROW($result);
+                       switch ($status)
+                       {
+                       case "LOCKED":
+                               $ERROR = CODE_ID_LOCKED;
+                               break;
+
+                       case "UNCONFIRMED":
+                               $ERROR = CODE_ID_UNCONFIRMED;
+                               break;
+
+                       default:
+                               $ERROR = CODE_UNKNOWN_STATUS;
+                               break;
+                       }
+               } else {
+                       // ID not found!
+                       $ERROR = CODE_WRONG_ID;
+               }
+
+               // Construct URL
+               $URL = URL."/modules.php?module=index&amp;what=login&amp;login=".$ERROR;
+       }
+} elseif ((!empty($_POST['new_pass'])) && (isset($uid))) {
+       // Compile email when found in address (only secure chars!)
+       if (!empty($_POST['email'])) $_POST['email'] = str_replace("{DOT}", '.', $_POST['email']);
+
+       // Set ID number when left empty
+       if (empty($_POST['id'])) $_POST['id'] = 0;
+
+       // Probe userid/nickname
+       $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['id'])."") != $_POST['id']));
+       if ($probe_nickname) {
+               // Nickname entered
+               $result = SQL_QUERY_ESC("SELECT userid, status FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' OR email='%s' LIMIT 1",
+                array(addslashes($uid), $_POST['email']), __FILE__, __LINE__);
+       } else {
+               // Direct userid entered
+               $result = SQL_QUERY_ESC("SELECT userid, status FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s OR email='%s' LIMIT 1",
+                array($uid, $_POST['email']), __FILE__, __LINE__);
+       }
+
+       // Any entry found?
+       if (SQL_NUMROWS($result) == 1) {
+               // This data is valid, so we create a new pass... :-)
+               list($uid, $status) = SQL_FETCHROW($result);
+
+               if ($status == "CONFIRMED") {
+                       // Ooppps, this was missing! ;-) We should update the database...
+                       $NEW_PASS = GEN_PASS();
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET password='%s' WHERE userid=%s LIMIT 1",
+                        array(generateHash($NEW_PASS), $uid), __FILE__, __LINE__);
+
+                       // Prepare data and message for email
+                       $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid);
+
+                       // ... and send it away
+                       SEND_EMAIL($uid, GUEST_NEW_PASSWORD, $msg);
+
+                       // Output note to user
+                       LOAD_TEMPLATE("admin_settings_saved", false, GUEST_NEW_PASSWORD_SEND);
+               } else {
+                       // Account is locked or unconfirmed
+                       switch ($status) {
+                               case "LOCKED"     : $MSG = CODE_ID_LOCKED;      break;
+                               case "UNCONFIRMED": $MSG = CODE_ID_UNCONFIRMED; break;
+                       }
+
+                       // Load URL
+                       LOAD_URL("modules.php?module=index&amp;what=login&amp;login=".$MSG);
+               }
+       } else {
+               // ID or email is wrong
+               LOAD_TEMPLATE("admin_settings_saved", false, "<SPAN class=\"guest_failed\">".GUEST_WRONG_ID_EMAIL."</SPAN>");
+       }
+}
+
+// Login problems?
+if (!empty($_GET['login'])) {
+       // Use code from URL
+       $ERROR = SQL_ESCAPE($_GET['login']);
+} // END  - if
+
+// Login problems?
+if (!empty($ERROR)) {
+       // Ok, which one now?
+       $MSG = "<TR>
+  <TD width=\"10\">&nbsp;</TD>
+  <TD colspan=\"7\" align=\"center\">
+    <STRONG><SPAN class=\"guest_failed\">";
+
+       switch ($ERROR) {
+               case CODE_WRONG_PASS:
+                       $MSG .= LOGIN_WRONG_PASS;
+                       break;
+
+               case CODE_WRONG_ID:
+                       $MSG .= LOGIN_WRONG_ID;
+                       break;
+
+               case CODE_ID_LOCKED:
+                       $MSG .= LOGIN_ID_LOCKED;
+                       break;
+
+               case CODE_ID_UNCONFIRMED:
+                       $MSG .= LOGIN_ID_UNCONFIRMED;
+                       break;
+
+               case CODE_NO_COOKIES:
+                       $MSG .= LOGIN_NO_COOKIES;
+                       break;
+
+               case CODE_EXTENSION_PROBLEM:
+                       if (IS_ADMIN()) {
+                               $MSG .= sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "nickname");
+                       } else {
+                               $MSG .= LOGIN_WRONG_ID;
+                       }
+                       break;
+
+               default:
+                       $MSG .= LOGIN_WRONG_ID;
+                       break;
+               }
+               $MSG .= "</SPAN></STRONG>
+  </TD>
+  <TD width=\"10\">&nbsp;</TD>
+</TR>\n";
+               define('LOGIN_FAILURE_MSG', $MSG);
+} else {
+       // No problems, no output
+       define('LOGIN_FAILURE_MSG', "");
+}
+
+// Display login form with resend-password form
+if (EXT_IS_ACTIVE("nickname")) {
+       LOAD_TEMPLATE("guest_nickname_login");
+} else {
+       LOAD_TEMPLATE("guest_login");
+}
+
+// Was an URL constructed?
+if (!empty($URL)) {
+       // URL was constructed
+       if (!empty($FATAL[0])) {
+               // Fatal errors!
+               require_once(PATH."inc/fatal_errors.php");
+       } else {
+               // Load URL
+               LOAD_URL($URL);
+       }
+} // END - if
+
+//
+?>
diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php
new file mode 100644 (file)
index 0000000..066aa37
--- /dev/null
@@ -0,0 +1,324 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/09/2003 *
+ * ===============                              Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-mediadata.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Media data                                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mediendaten                                      *
+ * -------------------------------------------------------------------- *
+ *          mod_media - By Robert Niedziela                             *
+ *          (c)2003 www.megacomputing.net                               *
+ * -------------------------------------------------------------------- *
+ *           Rewritten by Roland Haeder, 2003 - 2008                    *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("mediadata")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "mediadata");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+define('value', "value");
+define('lang', "lang");
+define('rows', "rows");
+
+// Get total confirmed user IDs...
+define('user_confirmed'  , round(GET_TOTAL_DATA("CONFIRMED"  , "user_data", "userid", "status", true)));
+define('user_unconfirmed', round(GET_TOTAL_DATA("UNCONFIRMED", "user_data", "userid", "status", true)));
+define('user_locked'     , round(GET_TOTAL_DATA("LOCKED"     , "user_data", "userid", "status", true)));
+define('user_count'      , (user_confirmed + user_unconfirmed + user_locked));
+
+// Start of this exchange
+define('__MT_START', MAKE_DATETIME($_CONFIG['mt_start'], "3"));
+
+// Projected number of members
+define('__MT_STAGE', $_CONFIG['mt_stage']);
+
+// Project timestamp when number of members are reached
+$PROJECTED = 0;
+if (user_count > 0) {
+       $PROJECTED = round((time() - $_CONFIG['mt_start']) / user_count * $_CONFIG['mt_stage'] + $_CONFIG['mt_start']);
+}
+
+$YEAR = date('Y', $PROJECTED); $MONTH = date("m", $PROJECTED); $DAY = date("d", $PROJECTED);
+$TEST = mktime(0, 0, 0, $MONTH, $DAY, $YEAR);
+if ($TEST > time()) {
+       define('__MT_PROJECTED', MAKE_DATETIME($PROJECTED, "3"));
+} else {
+       define('__MT_PROJECTED', USER_PROJECTION_UNKNOWN);
+}
+
+// User who can receive mails
+$result_max = SQL_QUERY("SELECT COUNT(max_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
+list($dummy) = SQL_FETCHROW($result_max);
+SQL_FREERESULT($result_max);
+define('user_max_mails', $dummy);
+
+// Users who can receive mails today
+$result_rec = SQL_QUERY("SELECT COUNT(receive_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND receive_mails > 0", __FILE__, __LINE__);
+list($dummy) = SQL_FETCHROW($result_rec);
+SQL_FREERESULT($result_rec);
+define('user_max_rec', $dummy);
+
+// Max mails per day
+$result_max = SQL_QUERY("SELECT SUM(max_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
+list($dmy) = SQL_FETCHROW($result_max);
+SQL_FREERESULT($result_max);
+define('max', $dmy);
+
+// Max mails for this day
+$result_rec = SQL_QUERY("SELECT SUM(receive_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND receive_mails > 0", __FILE__, __LINE__);
+list($dummy) = SQL_FETCHROW($result_rec);
+define('rec', $dummy);
+SQL_FREERESULT($result_rec);
+
+// Initial lots of variables
+$bmails = 0; $sent = 0; $max = 0; $rec = 0; $clicks = 0;
+
+// Mail orders (only current)
+$nmails = MEDIA_GET_ENTRY("normal_orders");
+if (empty($nmails)) $nmails = 0;
+
+// Mails sent so far
+$clicks = MEDIA_GET_ENTRY("normal_clicks");
+$sent   = MEDIA_GET_ENTRY("normal_send");
+if (empty($sent))   $sent   = 0;
+if (empty($clicks)) $clicks = 0;
+
+// Bonus mails
+if (EXT_IS_ACTIVE("bonus")) {
+       $bmails = MEDIA_GET_ENTRY("bonus_orders");
+       if (empty($bmails)) $bmails = 0;
+
+       // Count bonus mails clicks / sent mails
+       $dmy  = MEDIA_GET_ENTRY("bonus_clicks");
+       $dmy2 = MEDIA_GET_ENTRY("bonus_send");
+       if (empty($dmy))  $dmy  = 0;
+       if (empty($dmy2)) $dmy2 = 0;
+       $sent += $dmy2; $clicks += $dmy;
+}
+
+define('user_stats', ($nmails + $bmails));
+define('sent'      , $sent);
+
+// All clicks
+define('user_links', abs($sent - $clicks));
+
+$clr = "0.00000";
+if ($sent > 0) $clr = $clicks / $sent * 100;
+define('_clr', TRANSLATE_COMMA($clr)."%");
+
+// Load jackpot
+$result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
+list($jackpot) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+if (empty($jackpot)) $jackpot = 0;
+define('jackpot', TRANSLATE_COMMA($jackpot));
+
+// Total referral link clicks, total logins
+$result = SQL_QUERY("SELECT DISTINCT SUM(d.ref_clicks), SUM(d.total_logins)
+FROM "._MYSQL_PREFIX."_user_data AS d", __FILE__, __LINE__);
+list($ref, $logins) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// Get total points
+$points = MEDIA_GET_ENTRY("total_points");
+
+if (empty($points)) $points = 0;
+if (empty($ref))    $ref    = 0;
+if (empty($logins)) $logins = 0;
+
+define('__TOTAL_POINTS'   , TRANSLATE_COMMA($points));
+define('__TOTAL_REFCLICKS', $ref);
+define('__TOTAL_LOGINS'   , $logins);
+
+// Referral banner
+$result = SQL_QUERY("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y'", __FILE__, __LINE__);
+list($total) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+$result = SQL_QUERY("SELECT SUM(counter), SUM(clicks) FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y'", __FILE__, __LINE__);
+list($views, $clicks) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+if (empty($total))  $total  = 0;
+if (empty($views))  $views  = 0;
+if (empty($clicks)) $clicks = 0;
+
+define('__REF_TOTAL' , $total);
+define('__REF_VIEWS' , $views);
+define('__REF_CLICKS', $clicks);
+
+//
+// Extra mediadata depending on installed extensions
+//
+
+// Initialize Variables
+$OUT_EXTRA   = ""; $rowNameS_EXTRA   = 2;
+$OUT_POINTS  = ""; $rowNameS_POINTS  = 2;
+$OUT_USER    = ""; $rowNameS_USER    = 6;
+$OUT_SPECIAL = ""; // We don't need row count here
+
+if (EXT_IS_ACTIVE("beg")) {
+       // Clicks on beg links
+       $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM "._MYSQL_PREFIX."_user_data WHERE beg_clicks>0", __FILE__, __LINE__);
+       list($extra) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+       if (empty($extra)) $extra = 0;
+       $content = array(
+               'lang'  => MEDIA_BEG_CLICKS,
+               'value' => $extra
+       );
+       $OUT_EXTRA .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $rowNameS_EXTRA++;
+}
+
+if (EXT_IS_ACTIVE("doubler")) {
+       // Total payed points
+       $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM "._MYSQL_PREFIX."_doubler WHERE completed='Y' AND points > 0", __FILE__, __LINE__);
+       list($count1, $points1) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+       $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM "._MYSQL_PREFIX."_doubler WHERE completed='N' AND points > 0", __FILE__, __LINE__);
+       list($count2, $points2) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if (empty($count1))  $count1  = 0;
+       if (empty($count2))  $count2  = 0;
+       if (empty($points1)) $points1 = 0;
+       if (empty($points2)) $points2 = 0;
+
+       // Add header
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_DOUBLER_HEADER);
+
+       // Add first line (count)
+       $content = array(
+               'lang'  => MEDIA_DOUBLER_COUNT,
+               'value' => $count1,
+               'rows'  => "4"
+       );
+       // Add points
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row2", true, $content);
+       $content = array(
+               'lang'  => MEDIA_DOUBLER_CPOINTS,
+               'value' => TRANSLATE_COMMA($points1)
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $content = array(
+               'lang'  => MEDIA_DOUBLER_WAITING,
+               'value' => TRANSLATE_COMMA($count2)
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $content = array(
+               'lang'  => MEDIA_DOUBLER_WPOINTS,
+               'value' => TRANSLATE_COMMA($points2)
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+}
+
+if (EXT_IS_ACTIVE("holiday")) {
+       // Total holiday requests
+       $result = SQL_QUERY("SELECT DISTINCT COUNT(h.userid)
+FROM "._MYSQL_PREFIX."_user_holidays AS h
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON h.userid=d.userid
+WHERE d.holiday_active='Y'",
+ __FILE__, __LINE__);
+       list($holiday) = SQL_FETCHROW($result);
+       if (empty($holiday)) $holiday = 0;
+       $content = array(
+               'lang'  => MEDIA_HOLIDAY_COUNT,
+               'value' => $holiday
+       );
+       $OUT_USER .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $rowNameS_USER++;
+}
+
+if (EXT_IS_ACTIVE("transfer")) {
+       // Statistics for points transfers
+       $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
+FROM "._MYSQL_PREFIX."_user_transfers_in AS t
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON t.userid=d.userid",
+ __FILE__, __LINE__);
+       list($count_in, $points_in) = SQL_FETCHROW($result);
+       if (empty($count_in))  $count_in  = 0;
+       if (empty($points_in)) $points_in = 0;
+
+       $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
+FROM "._MYSQL_PREFIX."_user_transfers_out AS t
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON t.userid=d.userid",
+ __FILE__, __LINE__);
+       list($count_out, $points_out) = SQL_FETCHROW($result);
+       if (empty($count_out))  $count_out  = 0;
+       if (empty($points_out)) $points_out = 0;
+
+       // Add header
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_TRANSFER_HEADER);
+       $content = array(
+               'lang'  => MEDIA_TRANSFER_IN_COUNT,
+               'value' => $count_in,
+               'rows'  => "4"
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row2", true, $content);
+       $content = array(
+               'lang'  => MEDIA_TRANSFER_IN_POINTS,
+               'value' => TRANSLATE_COMMA($points_in)
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $content = array(
+               'lang'  => MEDIA_TRANSFER_OUT_COUNT,
+               'value' => $count_out
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $content = array(
+               'lang'  => MEDIA_TRANSFER_OUT_POINTS,
+               'value' => TRANSLATE_COMMA($points_out)
+       );
+       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+}
+
+define('__EXTRA_MEDIADATA'  , $OUT_EXTRA);
+define('__POINTS_MEDIADATA' , $OUT_POINTS);
+define('__USER_MEDIADATA'   , $OUT_USER);
+define('__SPECIAL_MEDIADATA', $OUT_SPECIAL);
+define('__ROWSPAN_EXTRA'    , $rowNameS_EXTRA);
+define('__ROWSPAN_POINTS'   , $rowNameS_POINTS);
+define('__ROWSPAN_USER'     , $rowNameS_USER);
+
+// Patch level and it's timespamp
+define('__PATCH_LEVEL', $_CONFIG['patch_level']);
+define('__PATCH_CTIME', MAKE_DATETIME($_CONFIG['patch_ctime'], "2"));
+
+// Load template
+LOAD_TEMPLATE("mediadata");
+
+//
+?>
diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php
new file mode 100644 (file)
index 0000000..49624af
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/29/2004 *
+ * ================                             Last change: 08/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-rallyes.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Ref rallyes                                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Rallyes                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "rallye");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+OUTPUT_HTML("<DIV align=\"center\">");
+
+// Check for possible running rallyes
+$ADMIN = " AND d.is_active='Y'";
+if (IS_ADMIN()) $ADMIN = "";
+
+$result = SQL_QUERY("SELECT DISTINCT d.id, d.admin_id, a.login, d.title, d.descr, d.template, d.start_time, d.end_time, d.min_users, d.min_prices
+FROM "._MYSQL_PREFIX."_rallye_data AS d, "._MYSQL_PREFIX."_admins AS a
+WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y'
+ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) == 1)
+{
+       // Found some (normally one...
+       list($id, $aid, $login, $title, $descr, $templ, $start, $end, $min_users, $min_prices) = SQL_FETCHROW($result);
+
+       $expired = false;
+       if ($end < time())
+       {
+               // Rallye is expired
+               define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
+               $expired = true;
+       }
+        elseif (time() >= ($end - $_CONFIG['one_day']))
+       {
+               // Rallye will expire in less one day!
+               define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
+       }
+        else
+       {
+               define('__RALLYE_EXTRAS', "<A href=\"".URL."/modules.php?module=index&amp;what=register\">".RALLYE_REGISTER_NOW."</A>");
+       }
+       // Set admin line (currently set to impressum, later to contact form)
+       define('__RALLYE_ADMIN', "<A href=\"".URL."/modules.php?module=index&amp;what=impressum&amp;admin=".$aid."\">".$login."</A>");
+
+       // Set title
+       define('__RALLYE_TITLE', COMPILE_CODE($title));
+
+       // Handle description...
+       if ((empty($descr)) && (!empty($templ)))
+       {
+               // Use description from template
+               define('__RALLYE_DESCR', LOAD_TEMPLATE("rallye_".$templ, true));
+       }
+        else
+       {
+               // Use description from database
+               define('__RALLYE_DESCR', COMPILE_CODE($descr));
+       }
+
+       // Set start and end time
+       define('__RALLYE_START', MAKE_DATETIME($start, "1"));
+       define('__RALLYE_END'  , MAKE_DATETIME($end  , "1"));
+
+       if ($min_users == 0)
+       {
+               // Rallye ends without user limitation
+               define('__RALLYE_MAX_USERS', RALLYE_END_NO_USER_LIMITATION);
+       }
+        else
+       {
+               // Rallye ends when X members are totally in your exchange
+               define('__RALLYE_MAX_USERS', RALLYE_END_USERS_1." ".$min_users." ".RALLYE_END_USERS_2);
+       }
+       if ($min_prices == 0)
+       {
+               // Rallye ends without user limitation
+               define('__RALLYE_MIN_PRICES', RALLYE_END_NO_PRICE_LIMITATION);
+       }
+        else
+       {
+               // Rallye ends when X members are totally in your exchange
+               define('__RALLYE_MIN_PRICES', RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2);
+       }
+
+       if ($expired)
+       {
+               define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
+               define('__RALLYE_TOP_USERS', "<DIV align=\"center\" class=\"big\">".__RALLYE_EXTRAS."</DIV>");
+               define('__RALLYE_CAN_WIN_THIS', RALLYE_OUR_WINNERS_ARE);
+       }
+        else
+       {
+               define('__RALLYE_PRICES', RALLYE_ADD_PRICES($id, "html"));
+               define('__RALLYE_TOP_USERS', RALLYE_ADD_TOPUSERS($id, $GLOBALS['userid']));
+               define('__RALLYE_CAN_WIN_THIS', RALLYE_YOU_CAN_WIN);
+       }
+
+       // And load final template
+       LOAD_TEMPLATE("guest_rallye_show");
+}
+ else
+{
+       // No rallye found so far
+       LOAD_TEMPLATE("guest_no_rallyes");
+}
+//
+OUTPUT_HTML("</DIV>");
+//
+?>
diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php
new file mode 100644 (file)
index 0000000..afaef39
--- /dev/null
@@ -0,0 +1,453 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/10/2003 *
+ * ===============                              Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-register.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Registration form                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Anmeldeformular                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("register"))) {
+       if (IS_ADMIN()) {
+               ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "register"));
+       } else {
+               ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "register");
+       }
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+global $_CONFIG, $DATA;
+
+// Initialize variables
+$FAILED = false; $SHORT_PASS = false; $cats = 0; $IP_TIMEOUT = false;
+if (!isset($_POST['ok']))          unset($_POST['ok']);
+if (empty($_POST['agree']))        $_POST['agree']        = "";
+if (empty($_POST['addy']))         $_POST['addy']         = "";
+if (empty($_POST['surname']))      $_POST['surname']      = "";
+if (empty($_POST['family_name']))  $_POST['family_name']  = "";
+if (empty($_POST['pass1']))        $_POST['pass1']        = "";
+if (empty($_POST['pass2']))        $_POST['pass2']        = "";
+if (empty($_POST['day']))          $_POST['day']          = "";
+if (empty($_POST['month']))        $_POST['month']        = "";
+if (empty($_POST['year']))         $_POST['year']         = "";
+if (empty($_POST['max_mails']))    $_POST['max_mails']    = "";
+if (empty($_POST['street_nr']))    $_POST['street_nr']    = "";
+if (empty($_POST['zip']))          $_POST['zip']          = "";
+if (empty($_POST['city']))         $_POST['city']         = "";
+if (empty($_POST['cntry']))        $_POST['cntry']        = "";
+if (empty($_POST['country_code'])) $_POST['country_code'] = "1";
+
+// Default refid is zero
+$_POST['refid'] = 0;
+if ($GLOBALS['refid'] > 0) {
+       // Test if the refid is valid
+       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Not found so we set your refid!
+               $_POST['refid'] = $_CONFIG['def_refid'];
+               set_session('refid', $_CONFIG['def_refid']);
+       } else {
+               // Use the refid here
+               $_POST['refid'] = $GLOBALS['refid'];
+       }
+} // END - if
+
+if (isset($_POST['ok'])) {
+       // First we only check the submitted data then we continue... :)
+       //
+       // Did he agree to our Terms Of Usage?
+       if ($_POST['agree'] != "Y")
+       {
+               $_POST['agree'] = "!";
+               $FAILED = true;
+       }
+
+       // Did he enter a valid email address? (we really don't care about
+       // that, he has to click on a confirmation link :P )
+       if ((empty($_POST['addy'])) || (!VALIDATE_EMAIL($_POST['addy'])))
+       {
+               $_POST['addy'] = "!";
+               $FAILED = true;
+       }
+
+       // And what about surname and family's name?
+       if (empty($_POST['surname']))
+       {
+               $_POST['surname'] = "!";
+               $FAILED = true;
+       }
+       if (empty($_POST['family_name']))
+       {
+               $_POST['family_name'] = "!";
+               $FAILED = true;
+       }
+
+       // Check for required fields
+       if (!$FAILED) $FAILED = REGISTER_CHECK_REQUIRED_FIELDS($_POST);
+
+       // Did he enter his password twice?
+       if (((empty($_POST['pass1'])) || (empty($_POST['pass2']))) || (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2']))))
+       {
+               if (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])))
+               {
+                       $_POST['pass1'] = "!";
+                       $_POST['pass2'] = "!";
+               }
+                else
+               {
+                       if (empty($_POST['pass1'])) { $_POST['pass1'] = "!"; } else { $_POST['pass1'] = ""; }
+                       if (empty($_POST['pass2'])) { $_POST['pass2'] = "!"; } else { $_POST['pass2'] = ""; }
+               }
+               $FAILED = true;
+       }
+       // Is the password long enouth?
+       if ((strlen($_POST['pass1']) < $_CONFIG['pass_len']) && (!$FAILED) && (!IS_ADMIN()))
+       {
+               $SHORT_PASS = true;
+               $FAILED = true;
+       }
+       // Did he select enougth categories?
+       if (!IS_ADMIN())
+       {
+               // Do this check only when no admin is logged in
+               foreach ($_POST['cat'] as $id => $answer)
+               {
+                       if ($answer == "Y") $cats++;
+               }
+               if ($cats < $_CONFIG['least_cats'])
+               {
+                       // ... nope!
+                       $FAILED = true;
+               }
+       }
+       if (($_POST['addy'] != "!") && ($_CONFIG['check_double_email'] == "Y") && (!IS_ADMIN()))
+       {
+               // Does the email address already exists in our database?
+               $CHK = SEARCH_EMAIL_USERTAB($_POST['addy']);
+               if ($CHK) { $_POST['addy'] = "?"; $FAILED = true; }
+       }
+
+       // Check his IP number
+       $result = SQL_QUERY_ESC("SELECT joined, last_update FROM "._MYSQL_PREFIX."_user_data WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
+        array(GET_REMOTE_ADDR(), $_CONFIG['ip_timeout'], $_CONFIG['ip_timeout']), __FILE__, __LINE__);
+       if ((SQL_NUMROWS($result) == 1) && (!IS_ADMIN()))
+       {
+               // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
+               // But admins are allowed to fake their own exchange service.
+               $IP_TIMEOUT = true;
+               $FAILED = true;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+
+if ((isset($_POST['ok'])) && (!$FAILED))
+{
+       // Save the registration
+       if (strlen($_POST['day'])   == 1) $_POST['day']   = "0".$_POST['day'];
+       if (strlen($_POST['month']) == 1) $_POST['month'] = "0".$_POST['month'];
+
+       // Get total users
+       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+
+       // Hash = MM-DD-YYYY:IP:USER_AGENT:TIMEMARK
+       $hash = generateHash(sha1($totalUsers.":".$_POST['month']."-".$_POST['day']."-".$_POST['year'].":".getenv('SERVER_NAME').":".GET_REMOTE_ADDR().":".GET_USER_AGENT()."-".time())."/".RAND_NUMBER);
+
+       // Add design when extension sql_patches is v0.2.7 or greater
+       $ADD1 = ""; $ADD2 = "";
+       if (GET_EXT_VERSION("sql_patches") >= "0.2.7") {
+               // Okay, add design here
+               $ADD1 = ", curr_theme";
+               $ADD2 = ", '".GET_CURR_THEME()."'";
+       } // END - if
+
+       // Check if I shall disable sending mail to newly registered members out about active/begging rallye
+       //
+       // First comes first: begging rallye
+       if (GET_EXT_VERSION("beg") >= "0.1.7") {
+               // Okay, shall I disable now?
+               if ($_CONFIG['beg_new_mem_notify'] == "N") {
+                       $ADD1 .= ", beg_ral_notify, beg_ral_en_notify";
+                       $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
+               } // END - if
+       } // END - if
+
+       // Second: active rallye
+       if (GET_EXT_VERSION("bonus") >= "0.7.7") {
+               // Okay, shall I disable now?
+               if ($_CONFIG['bonus_new_mem_notify'] == "N") {
+                       $ADD1 .= ", bonus_ral_notify, bonus_ral_en_notify";
+                       $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
+               } // END - if
+       } // END - if
+
+       // Write user data to table
+       if (EXT_IS_ACTIVE("country")) {
+               // Save with new selectable country code
+               $countryRow = "country_code";
+               $countryData = bigintval($_POST['country_code']);
+       } else {
+               // Old way with enterable two-char-code
+               $countryRow = "country";
+               $countryData = addslashes(substr($_POST['cntry'], 0, 2));
+       }
+
+       //////////////////////////////
+       // Create user's account... //
+       //////////////////////////////
+       //
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_data (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.")
+VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$ADD2.")",
+       array(
+               $countryRow,
+               SQL_ESCAPE(substr($_POST['gender'], 0, 1)),
+               SQL_ESCAPE($_POST['surname']),
+               SQL_ESCAPE($_POST['family_name']),
+               SQL_ESCAPE($_POST['street_nr']),
+               $countryData,
+               bigintval($_POST['zip']),
+               SQL_ESCAPE($_POST['city']),
+               SQL_ESCAPE($_POST['addy']),
+               bigintval($_POST['day']),
+               bigintval($_POST['month']),
+               bigintval($_POST['year']),
+               generateHash($_POST['pass1']),
+               bigintval($_POST['max_mails']),
+               bigintval($_POST['max_mails']),
+               bigintval($_POST['refid']),
+               $hash,
+               GET_REMOTE_ADDR(),
+       ), __FILE__, __LINE__);
+
+       // Get his userid
+       $userid = SQL_INSERTID();
+
+       // Did this work?
+       if ($userid == 0) {
+               // Something bad happened!
+               LOAD_TEMPLATE("admin_settings_saved", false, USER_NOT_REGISTERED);
+               return;
+       } // END - if
+
+       // Is the refback extension there?
+       if (EXT_IS_ACTIVE("refback")) {
+               // Update refback table
+               UPDATE_REFBACK_TABLE($userid);
+       } // END - if
+
+       // Write his welcome-points
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=0 LIMIT 1",
+        array(bigintval($userid)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Add only when the line was not found (maybe some more secure?)
+               $locked = "points";
+               if ($_CONFIG['ref_payout'] > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails!
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid, ref_depth, ".$locked.") VALUES(%s,0,'%s')",
+                array(bigintval($userid), $_CONFIG['points_register']), __FILE__, __LINE__);
+
+               // Update mediadata as well
+               if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($locked == "points")) {
+                       // Update database
+                       MEDIA_UPDATE_ENTRY(array("total_points"), "add", $_CONFIG['points_register']);
+               } // END - if
+       } // END - if
+
+       // Write catgories
+       if ((is_array($_POST['cat'])) && (count($_POST['cat']))) {
+               foreach ($_POST['cat'] as $cat => $joined) {
+                       if ($joined == "Y") {
+                               // Insert category entry
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_cats (userid, cat_id) VALUES (%s, %s)",
+                                array(bigintval($userid), bigintval($cat)), __FILE__, __LINE__);
+                       } // END - if
+               } // END - foreach
+       } // END - if
+
+       // Rewrite gender
+       $gender = TRANSLATE_GENDER($_POST['gender']);
+
+       // ... rewrite a zero referral ID to the main title
+       if ($_POST['refid'] == "0") $_POST['refid'] = MAIN_TITLE;
+
+       // Prepare data array for the email template
+       // Start with the gender...
+       $DATA = array(
+               'hash'    => $hash,
+               'uid'     => $userid,
+               'gender'  => $gender,
+               'surname' => SQL_ESCAPE($_POST['surname']),
+               'family'  => SQL_ESCAPE($_POST['family_name']),
+               'email'   => SQL_ESCAPE($_POST['addy']),
+               'street'  => SQL_ESCAPE($_POST['street_nr']),
+               'city'    => SQL_ESCAPE($_POST['city']),
+               'zip'     => bigintval($_POST['zip']),
+               'country' => $countryData,
+               'refid'   => SQL_ESCAPE($_POST['refid']),
+               'pass'    => SQL_ESCAPE($_POST['pass1']),
+       );
+
+       // Continue with birthday...
+       switch (GET_LANGUAGE())
+       {
+       case "de":
+               $DATA['birthday'] = bigintval($_POST['day']).".".bigintval($_POST['month']).".".bigintval($_POST['year']);
+               break;
+
+       default:
+               $DATA['birthday'] = bigintval($_POST['month'])."/".bigintval($_POST['day'])."/".bigintval($_POST['year']);
+               break;
+       }
+
+       // Display information to the user that he got mail and send it away
+       $msg_guest = LOAD_EMAIL_TEMPLATE("register-member", $DATA, $userid);
+
+       // Send mail to user (confirmation link!)
+       $EMAIL = $DATA['email'];
+       SEND_EMAIL ($DATA['email'], GUEST_CONFIRM_LINK, $msg_guest);
+       $DATA['email'] = $EMAIL;
+
+       // Send mail to admin
+       SEND_ADMIN_NOTIFICATION(ADMIN_NEW_ACCOUNT, "register-admin", $DATA, $userid);
+
+       // Output success registration
+       LOAD_TEMPLATE("admin_settings_saved", false, REGISTRATION_DONE);
+} else {
+       if ($_POST['agree'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".HAVE_TO_AGREE."</SPAN></STRONG><br /><br />");
+       } // END - if
+
+       if ($_POST['addy'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_EMAIL."</SPAN></STRONG><br /><br />");
+               $_POST['addy'] = "";
+       } elseif ($_POST['addy'] == "?") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".EMAIL_ALREADY_DB."</SPAN></STRONG><br /><br />");
+               $_POST['addy'] = "";
+       }
+
+       if ($_POST['surname'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_SURNAME."</SPAN></STRONG><br /><br />");
+               $_POST['surname'] = "";
+       } // END - if
+
+       if ($_POST['family_name'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_FAMILY."</SPAN></STRONG><br /><br />");
+               $_POST['family_name'] = "";
+       } // END - if
+
+       if (($_POST['pass1'] == "!") && ($_POST['pass2'] == "!")) {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_BOTH_PASSWORDS."</SPAN></STRONG><br /><br />");
+       } elseif ($_POST['pass1'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_PASS1."</SPAN></STRONG><br /><br />");
+       } elseif ($_POST['pass2'] == "!") {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_PASS2."</SPAN></STRONG><br /><br />");
+       }
+
+       if ($SHORT_PASS) {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".$_CONFIG['pass_len']."</SPAN></STRONG><br /><br />");
+       } // END - if
+
+       if ($IP_TIMEOUT) {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</SPAN></STRONG><br /><br />");
+       } // END - if
+
+       if ((!empty($cats)) && ($cats < $_CONFIG['least_cats'])) {
+               OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".$_CONFIG['least_cats']."</SPAN></STRONG><br /><br />");
+       } // END - if
+
+       // Generate birthday selection
+       switch (GET_LANGUAGE())
+       {
+       case "de": // German date format
+               define('BIRTHDAY_SELECTION', ADD_SELECTION("day", $_POST['day']).ADD_SELECTION("month", $_POST['month']).ADD_SELECTION("year", $_POST['year']));
+               break;
+
+       default: // Default is the US date format... :)
+               break;
+       }
+
+       // Adds a table for the guests with all visible categories
+       define('CATEGORY_SELECTION', REGISTER_ADD_CATEGORY_TABLE("guest", true));
+
+       // Adds maximum receiveable mails list... :)
+       define('MAX_RECEIVE_LIST', ADD_MAX_RECEIVE_LIST("guest", "", true));
+
+       // Shall I display the refid or shall I make it editable?
+       if ($_CONFIG['display_refid'] == "Y") {
+               // Load "hide" form template
+               define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid']));
+       } else {
+               // Load template to enter it
+               define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid", true, $GLOBALS['refid']));
+       }
+
+       // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
+       define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE("register_header", true));
+
+       // Please select at least x categories
+       define('LEAST_CATS_VALUE', $_CONFIG['least_cats']);
+
+       // Other values
+       define('__SURNAME', SQL_ESCAPE($_POST['surname']));
+       define('__FAMILY',  SQL_ESCAPE($_POST['family_name']));
+       define('__STREET',  SQL_ESCAPE($_POST['street_nr']));
+       define('__COUNTRY', SQL_ESCAPE($_POST['cntry']));
+       define('__ZIP',     bigintval($_POST['zip']));
+       define('__CITY',    SQL_ESCAPE($_POST['city']));
+       define('__ADDY',    SQL_ESCAPE($_POST['addy']));
+
+       // Shall I add a counrty selection box or the old input box?
+       if (EXT_IS_ACTIVE("country")) {
+               // New variant, good!
+               $OUT  = "<SELECT name=\"country_code\" class=\"guest_select\" size=\"1\">\n";
+               $whereStatement = "WHERE is_active='Y'";
+               if (IS_ADMIN()) $whereStatement = "";
+               $OUT .= ADD_OPTION_LINES("countries", "id", "descr", $_POST['country_code'], "code", $whereStatement);
+               $OUT .= "</SELECT>";
+               define('__COUNTRY_CONTENT', $OUT);
+       } else {
+               // Old out-dated variant
+               define('__COUNTRY_CONTENT', "<INPUT type=\"text\" name=\"cntry\" class=\"guest_normal\" size=\"2\" maxlength=\"3\" value=\"".__COUNTRY."\">");
+       }
+
+       // Set MUST_??? constants
+       if ((EXT_IS_ACTIVE("register")) && (GET_EXT_VERSION("register") > "0.0")) REGISTER_FILL_MUST_CONSTANTS();
+
+       // Display registration form
+       LOAD_TEMPLATE("guest_register");
+}
+
+//
+?>
diff --git a/inc/modules/guest/what-sponsor_agb.php b/inc/modules/guest/what-sponsor_agb.php
new file mode 100644 (file)
index 0000000..b85642c
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sponsor_agb.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : General Terms & Conditions for the sponsor       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine Geschaeftsbedingungen fuer Sponsor    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php
new file mode 100644 (file)
index 0000000..7e0f927
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sponsor_infos.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Informations and prices for the sponsor          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Informationen/Preise fuer den Sponsoren          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Remove result_act
+unset($result_act);
+
+// Load all sponsor actions
+$result_act = SQL_QUERY("SELECT DISTINCT m.title, c.conv_rate, c.conv_name
+FROM "._MYSQL_PREFIX."_sponsor_menu AS m
+LEFT JOIN "._MYSQL_PREFIX."_sponsor_action_convert AS c ON m.what=c.ext_name
+LEFT JOIN "._MYSQL_PREFIX."_sponsor_registry AS r ON m.what=r.ext_name
+WHERE m.action='actions' AND r.is_active='Y'
+ORDER BY m.sort ASC", __FILE__, __LINE__);
+$num_act = SQL_NUMROWS($result_act);
+
+if ($num_act > 0)
+{
+       // Load all actions
+       $OUT_ACT = ""; $SW = 2;
+       while (list($title, $conv, $name) = SQL_FETCHROW($result_act))
+       {
+               // Prepare data for the row template
+               $content = array(
+                       'sw'    => $SW,
+                       'title' => $title,
+                       'conv'  => round($conv),
+                       'name'  => $name,
+               );
+
+               // Load row template and switch color
+               $OUT_ACT .= LOAD_TEMPLATE("guest_sponsor_act_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Check for pay types
+       $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_pay) > 0)
+       {
+               // Load all pay types
+               $OUT_PAY = ""; $SW = 2;
+               while (list($name, $rate, $min, $curr) = SQL_FETCHROW($result_pay))
+               {
+                       // Prepare data for the row template
+                       $content = array(
+                               'sw'    => $SW,
+                               'name'  => $name,
+                               'rate'  => TRANSLATE_COMMA($rate),
+                               'min'   => $min,
+                               'curr'  => $curr,
+                               'price' => $min,
+                       );
+
+                       if (!ereg(",", $content['price']))
+                       {
+                               // Add missing zeros
+                               $content['price'] .= ",".str_repeat("0", $_CONFIG['max_comma']);
+                       }
+
+                       // Load row template and switch color
+                       $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content);
+                       $SW = 3 - $SW;
+               }
+       }
+        else
+       {
+               // No pay types setuped so far!
+               $OUT_PAY = "<TR><TD colspan=\"2\">
+  ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
+</TD></TR>";
+       }
+}
+ else
+{
+       // No actions activated so far!
+       $OUT_ACT = "<TR><TD colspan=\"2\" class=\"bottom2\" style=\"padding-top: 10px; padding-bottom: 10px\">
+  ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
+</TD></TR>";
+       $OUT_PAY = "<TR><TD colspan=\"2\" class=\"bottom2\" style=\"padding-top: 10px; padding-bottom: 10px\">
+  ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
+</TD></TR>";
+}
+
+// Transfer rows to constans
+define('__SPONSOR_ACTIONS' , $OUT_ACT);
+define('__SPONSOR_PAYTYPES', $OUT_PAY);
+
+// Free memory
+if (isset($result_act)) SQL_FREERESULT($result_act);
+if (isset($result_pay)) SQL_FREERESULT($result_pay);
+
+// Load main template
+LOAD_TEMPLATE("guest_sponsor_infos");
+
+//
+?>
diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php
new file mode 100644 (file)
index 0000000..c28f500
--- /dev/null
@@ -0,0 +1,313 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sponsor_login.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Login form and password resending for sponsor    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Loginformular und Neues Passwort fuer Sponsor    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+$MODE = "";
+if (!empty($_GET['mode']))
+{
+       // A "special" mode of the login system was requested
+       switch ($_GET['mode'])
+       {
+               case "activate" : $MODE = "activate";  break; // Activation link requested
+               case "lost_pass": $MODE = "lost_pass"; break; // Request new password
+       }
+}
+
+// Check if hash for confirmation of email address is given...
+if (!empty($_GET['hash']))
+{
+       // Lookup sponsor
+       $result = SQL_QUERY_ESC("SELECT id, status, gender, surname, family,
+company, position, tax_ident,
+street_nr1, street_nr2, country, zip, city, email, phone, fax, cell,
+points_amount AS points, last_pay AS pay, last_curr AS curr
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE hash='%s' AND (status='UNCONFIRMED' OR status='EMAIL')
+LIMIT 1", array($_GET['hash']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Sponsor found, load his data...
+               $SPONSOR = SQL_FETCHARRAY($result);
+
+               // Translate gender and comma
+               $SPONSOR['gender']  = TRANSLATE_GENDER($SPONSOR['gender']);
+               $SPONSOR['points'] = TRANSLATE_COMMA($SPONSOR['points']);
+               $SPONSOR['pay']    = TRANSLATE_COMMA($SPONSOR['pay']);
+
+               // Unconfirmed account or changed email address?
+               if ($SPONSOR['status'] == "UNCONFIRMED")
+               {
+                       // Set account to pending
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='PENDING'
+WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1",
+ array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
+
+                       // Check on success 
+                       if (SQL_AFFECTEDROWS() == 1)
+                       {
+                               // Prepare mail and send it to the sponsor
+                               $MSG = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR);
+                               SEND_EMAIL($SPONSOR['email'], SPONSOR_ACCOUNT_PENDING_SUBJ, $MSG);
+
+                               // Send email to admin
+                               SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_pending", $SPONSOR);
+
+                               // Sponsor account set to pending
+                               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_IS_PENDING);
+                       }
+                        else
+                       {
+                               // Could not unlock account!
+                               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_PENDING_FAILED);
+                       }
+               }
+                elseif ($SPONSOR['status'] == "EMAIL")
+               {
+                       // Changed email adress need to be confirmed
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='CONFIRMED'
+WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1",
+ array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
+
+                       // Check on success 
+                       if (SQL_AFFECTEDROWS() == 1)
+                       {
+                               // Sponsor account is unlocked again
+                               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN);
+                       }
+                        else
+                       {
+                               // Could not unlock account!
+                               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_EMAIL_FAILED);
+                       }
+               }
+                else
+               {
+                       /// ??? Other status?
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_STATUS_FAILED);
+               }
+       }
+        else
+       {
+               // No sponsor found
+               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACCOUNT_404);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+ elseif ($MODE == "activate")
+{
+       // Send activation link again
+       if (isset($_POST['ok']))
+       {
+               // Check submitted data
+               if (empty($_POST['email'])) unset($_POST['ok']);
+       }
+
+       if (isset($_POST['ok']))
+       {
+               // Check email
+               $result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
+ array($_POST['email']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Unconfirmed sponsor account found so let's load the requested data
+                       $SPONSOR = SQL_FETCHARRAY($result);
+
+                       // Translate some data
+                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
+                       $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
+
+                       // Prepare email and send it to the sponsor
+                       if ($SPONSOR['status'] == "UNCONFIRMED")
+                       {
+                               // Unconfirmed accounts
+                               $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_activate", $SPONSOR);
+                       }
+                        else
+                       {
+                               // Confirmed email address
+                               $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
+                       }
+                       SEND_EMAIL($_POST['email'], SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
+
+                       // Output message
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACTIVATION_LINK_SENT);
+               }
+                else
+               {
+                       // No account found or not UNCONFIRMED
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACTIVATION_LINK_404);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // Load form
+               LOAD_TEMPLATE("guest_sponsor_activate");
+       }
+}
+ elseif ($MODE == "lost_pass")
+{
+       // Send new password
+       if (isset($_POST['ok']))
+       {
+               // Check submitted data
+               if (empty($_POST['email'])) unset($_POST['ok']);
+       }
+
+       if (isset($_POST['ok']))
+       {
+               // Check email
+               $result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1",
+ array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Unconfirmed sponsor account found so let's load the requested data
+                       $SPONSOR = SQL_FETCHARRAY($result);
+
+                       // Translate some data
+                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
+                       $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
+
+                       // Generate password
+                       $SPONSOR['password']        = GEN_PASS();
+
+                       // Prepare email and send it to the sponsor
+                       $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
+                       SEND_EMAIL($_POST['email'], SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
+
+                       // Update password
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET password='%s'
+WHERE id='%s' LIMIT 1",
+ array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
+
+                       // Output message
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_LOST_PASSWORD_SENT);
+               }
+                else
+               {
+                       // No account found or not UNCONFIRMED
+                       LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_LOST_PASSWORD_404);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // Load form
+               LOAD_TEMPLATE("guest_sponsor_lost");
+       }
+}
+ elseif (isset($_POST['ok']))
+{
+       // Check status and login data ...
+       $result = SQL_QUERY_ESC("SELECT status FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' AND password='%s' LIMIT 1",
+ array(bigintval($_POST['sponsorid']), md5($_POST['pass'])), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
+               list($status) = SQL_FETCHROW($result);
+               if ($status == "CONFIRMED")
+               {
+                       // Calculate cookie lifetime, maybe we have to change this so the admin can setup a
+                       // seperate timeout for these two cookies?
+                       $life = (time() + $_CONFIG['online_timeout']);
+
+                       // Is confirmed so both is fine and we can continue with login procedure
+                       $login = ((setcookie("sponsorid"  , bigintval($_POST['sponsorid']), $life, COOKIE_PATH)) &&
+                                 (setcookie("sponsorpass", md5($_POST['pass'])           , $life, COOKIE_PATH)));
+
+                       if ($login)
+                       {
+                               // Cookie setup successfull so we can forward to sponsor area
+                               LOAD_URL(URL."/modules.php?module=sponsor");
+                       }
+                        else
+                       {
+                               // Cookie setup failed!
+                               LOAD_TEMPLATE("admin_settings_saved", false, SPONSPOR_COOKIE_SETUP_FAILED);
+                               OUTPUT_HTML("<br />");
+
+                               // Login formular and other links
+                               LOAD_TEMPLATE("guest_sponsor_login");
+                       }
+               }
+                else
+               {
+                       // Status is not fine
+                       $eval = "\$content = SPONSOR_LOGIN_FAILED_".strtoupper($status).";";
+                       eval($eval);
+                       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+                       OUTPUT_HTML("<br />");
+
+                       // Login formular and other links
+                       LOAD_TEMPLATE("guest_sponsor_login");
+               }
+       }
+        else
+       {
+               // Account missing or wrong pass! We shall not find this out for the "hacker folks"...
+               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_LOGIN_FAILED_404_WRONG_PASS);
+               OUTPUT_HTML("<br />");
+
+               // Login formular and other links
+               LOAD_TEMPLATE("guest_sponsor_login");
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+ else
+{
+       // Login formular and other links
+       LOAD_TEMPLATE("guest_sponsor_login");
+}
+
+//
+?>
diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php
new file mode 100644 (file)
index 0000000..7b8b0f3
--- /dev/null
@@ -0,0 +1,446 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sponsor_reg.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor's registration form                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Anmeldeformular fuer Sponsoren                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Create array for form errors (= missing data)
+$FORM_ERRORS = array();
+
+if (isset($_POST['ok'])) {
+       //
+       // Check submitted form data
+       //
+       // 1. Salutation / Surname / family name
+       if (empty($_POST['gender']))
+       {
+               // Surname is empty
+               $FORM_ERRORS[] = SPONSOR_NO_GENDER_SELECTED;
+       }
+       if (empty($_POST['surname']))
+       {
+               // Surname is empty
+               $FORM_ERRORS[] = SPONSOR_SURNAME_IS_EMPTY;
+       }
+       if (empty($_POST['family']))
+       {
+               // Surname is empty
+               $FORM_ERRORS[] = SPONSOR_FAMILY_IS_EMPTY;
+       }
+       // 2. Company name
+       // 012     3                          32    23      4                            43    3      4                           4321    12      3                          32    2     3                            3210
+       if (((empty($_POST['company'])) && ((!empty($_POST['tax_ident'])) || (!empty($_POST['position'])))) || ((!empty($_POST['company'])) && (empty($_POST['tax_ident']))))
+       {
+               if (empty($_POST['company']))
+               {
+                       // Company name is empty
+                       $FORM_ERRORS[] = SPONSOR_COMPANY_IS_EMPTY;
+               }
+                elseif (empty($_POST['tax_ident']))
+               {
+                       // Tax ident number name is empty
+                       $FORM_ERRORS[] = SPONSOR_TAX_IDENT_IS_EMPTY;
+               }
+               if (empty($_POST['position']))
+               {
+                       // Not fatal but not nice: position in company is empty
+                       $FORM_ERRORS[] = SPONSOR_POSITION_IS_EMPTY;
+               }
+       }
+       // 3. Street and number
+       if (empty($_POST['street_nr1']))
+       {
+               // Street name and house number are empty
+               $FORM_ERRORS[] = SPONSOR_STREET_NR1_IS_EMPTY;
+       }
+        elseif ((!empty($_POST['street_nr2'])) && (empty($_POST['street_nr1'])))
+       {
+               // 1st line for street is empty, but 2nd line not
+               $FORM_ERRORS[] = SPONSOR_STREET_NR1_IS_EMPTY_2_NOT;
+       }
+       // 4. Country code
+       if (empty($_POST['country']))
+       {
+               // Country code is empty
+               $FORM_ERRORS[] = SPONSOR_COUNTRY_IS_EMPTY;
+       }
+        elseif (strlen($_POST['country']) != 2)
+       {
+               // Country code is invalid
+               $FORM_ERRORS[] = SPONSOR_COUNTRY_IS_INVALID;
+       }
+       // 3. ZIP code
+       if (empty($_POST['zip']))
+       {
+               // ZIP code is empty
+               $FORM_ERRORS[] = SPONSOR_ZIP_IS_EMPTY;
+       }
+        elseif (bigintval($_POST['zip']) != $_POST['zip'])
+       {
+               // ZIP is invalid
+               $FORM_ERRORS[] = SPONSOR_ZIP_IS_INVALID;
+               $_POST['zip'] = "";
+       }
+       // 4. City
+       if (empty($_POST['city']))
+       {
+               // City is empty
+               $FORM_ERRORS[] = SPONSOR_CITY_IS_EMPTY;
+       }
+       // 5. Phone number
+       if (empty($_POST['phone']))
+       {
+               // City is empty
+               $FORM_ERRORS[] = SPONSOR_PHONE_IS_EMPTY;
+       }
+       // 6. Homepage URL
+       if (empty($_POST['url']))
+       {
+               // Homepage URL is empty
+               $FORM_ERRORS[] = SPONSOR_URL_IS_EMPTY;
+       }
+        elseif (!VALIDATE_URL($_POST['url']))
+       {
+               // Homepage URL is invalid
+               $FORM_ERRORS[] = SPONSOR_URL_IS_INVALID;
+               $_POST['url'] = "";
+       }
+       // 7. Light validation of email address
+       if ((empty($_POST['email'])) || ($_POST['email'] == "@"))
+       {
+               // Email is invalid/empty
+               $FORM_ERRORS[] = SPONSOR_EMAIL_IS_INVALID;
+       }
+        elseif (SPONSOR_FOUND_EMAIL_DB($_POST['email']))
+       {
+               // Email already found in database!
+               $FORM_ERRORS[] = SPONSOR_EMAIL_IS_ALREADY_REGISTERED;
+               $_POST['email'] = "";
+       }
+       // 8. Pay type selected?
+       if (empty($_POST['pay_type']))
+       {
+               // Not pay type selected
+               $FORM_ERRORS[] = SPONSOR_NO_PAYTYPE_SELECTED;
+       }
+       // 9. Interval of mails
+       if (empty($_POST['warning_interval']))
+       {
+               // No warning interval selected
+               $FORM_ERRORS[] = SPONSOR_NO_WARNING_INTERVAL_SELECTED;
+       }
+       // 10. Mail notifications disabled/enabled
+       if (empty($_POST['receive_warnings']))
+       {
+               // Option not selected!
+               $FORM_ERRORS[] = SPONSOR_NO_RECEIVE_WARNINGS_SELECTED;
+       }
+       // Did he enter his password twice?
+       if (((empty($_POST['pass1'])) || (empty($_POST['pass2']))) || (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2']))))
+       {
+               if (($_POST['pass1'] != $_POST['pass2']) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])))
+               {
+                       // Passwords missmatch
+                       $FORM_ERRORS[] = SPONSOR_PASSWORDS_MISMATCH;
+               }
+                else
+               {
+                       if (empty($_POST['pass1']))
+                       {
+                               // Password 1 is empty
+                               $FORM_ERRORS[] = SPONSOR_PASSWORD1_EMPTY;
+                       }
+                       if (empty($_POST['pass2']))
+                       {
+                               // Password 2 is empty
+                               $FORM_ERRORS[] = SPONSOR_PASSWORD2_EMPTY;
+                       }
+               }
+       }
+       // Is the password long enough?
+        elseif (strlen($_POST['pass1']) < $_CONFIG['pass_len'])
+       {
+               // Too short!
+               $FORM_ERRORS[] = SPONSOR_PASSWORD_TOO_SHORT;
+       }
+
+       // Check if he has accepted the terms&conditions
+       if (empty($_POST['terms']))
+       {
+               // Homepage URL is empty
+               $FORM_ERRORS[] = SPONSOR_TERMS_NOT_ACCEPTED;
+       }
+       
+       // If there is something wrong/missing stop registration
+       if (count($FORM_ERRORS) > 0) unset($_POST['ok']);
+}
+
+if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0))
+{
+       // Generate message array
+       $MSGs = array(
+               'failed' => SPONSOR_REGISTRATION_FAILED,
+               'added'  => SPONSOR_REGISTRATION_COMPLETED,
+       );
+
+       // Calulate points
+       $result = SQL_QUERY_ESC("SELECT (pay_rate * pay_min_count) AS points, pay_min_count AS pay, pay_currency AS curr
+FROM "._MYSQL_PREFIX."_sponsor_paytypes
+WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__);
+       list($points, $pay, $curr) = SQL_FETCHROW($result);
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Add points to array
+       $_POST['points_amount'] = $points;
+       $_POST['points_used']   = "0.00000";
+       $_POST['last_pay']      = $pay;
+       $_POST['last_curr']     = $curr;
+
+       // Register sponsor but never ever update here!
+       $STATUS = SPONSOR_HANDLE_SPONSOR($_POST, true, $MSGs, true);
+
+       // Check the status of the registration process
+       switch ($STATUS)
+       {
+       case "added": // Sponsor successfully added with account status = UNCONFIRMED!
+               // Check for his ID number
+               $result = SQL_QUERY_ESC("SELECT id, hash FROM "._MYSQL_PREFIX."_sponsor_data WHERE email='%s' LIMIT 1",
+                array($_POST['email']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // ID found so let's load it for the confirmation email
+                       list($id, $hash) = SQL_FETCHROW($result);
+
+                       // Prepare data for the email template
+                       define('__ID'       , $id);
+                       define('__HASH'     , $hash);
+                       define('__EMAIL'    , $_POST['email']);
+                       define('__SURNAME'  , $_POST['surname']);
+                       define('__FAMILY'   , $_POST['family']);
+                       define('__GENDER'    , TRANSLATE_GENDER($_POST['gender']));
+                       define('__TIMESTAMP', MAKE_DATETIME(time(), 0));
+                       define('__PASSWORD' , $_POST['pass1']);
+
+                       // Generate email and send it to the new sponsor
+                       $EMAIL_MSG = LOAD_EMAIL_TEMPLATE("sponsor_confirm", $hash);
+                       SEND_EMAIL($_POST['email'], SPONSOR_PLEASE_CONFIRM_SUBJ, $EMAIL_MSG);
+
+                       // Send mail to admin
+                       SEND_ADMIN_NOTIFICATION(ADMIN_NEW_SPONSOR, "admin_sponsor_reg", $hash);
+
+                       // Output message: DONE
+                       $MSG = $MSGs['added'];
+               }
+                else
+               {
+                       // Sponsor account not found???
+                       $MSG = SPONSOR_EMAIL_404_1.$_POST['email'].SPONSOR_EMAIL_404_2;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+               break;
+
+       default:
+               if (!IS_ADMIN())
+               {
+                       // Message for testing admin
+                       $MSG = ADMIN_SPONSOR_UNKOWN_STATUS_1.$STATUS.ADMIN_SPONSOR_UNKOWN_STATUS_2;
+               }
+                else
+               {
+                       // Message for the guest
+                       $MSG = SPONSOR_UNKOWN_STATUS_1.$STATUS.SPONSOR_UNKOWN_STATUS_2;
+               }
+               break;
+       }
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+}
+ else
+{
+       // Check for payment types
+       $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count
+FROM "._MYSQL_PREFIX."_sponsor_paytypes
+ORDER BY pay_name", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Load all types...
+               $OUT = "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\" class=\"left2 right2 top2\">\n";
+               $SW = 2;
+               while(list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result))
+               {
+                       $OUT .= "<TR>
+  <TD class=\"bottom2 switch_sw".$SW."\" height=\"50\" style=\"padding-left: 2px; padding-right: 2px\">
+    <INPUT type=\"radio\" name=\"pay_type\" class=\"guest_normal\" value=\"".bigintval($id)."\">&nbsp;".$name."<br />
+    <DIV align=\"right\">(".$min." ".$curr." = ".TRANSLATE_COMMA($rate * $min)." ".POINTS.")</DIV>
+  </TD>
+</TR>\n";
+                       $SW = 3 - $SW;
+               }
+               $OUT .= "</TABLE>\n";
+               define('__PAYMENT_LIST', $OUT);
+               SQL_FREERESULT($result);
+
+               // Check for invalid entries
+               if (count($FORM_ERRORS) > 0)
+               {
+                       // Some found... :-(
+                       define('__COMPANY'  , COMPILE_CODE($_POST['company']));
+                       define('__POSITION' , COMPILE_CODE($_POST['position']));
+                       define('__TAX_IDENT', COMPILE_CODE($_POST['tax_ident']));
+                       define('__SURNAME'  , COMPILE_CODE($_POST['surname']));
+                       define('__FAMILY'   , COMPILE_CODE($_POST['family']));
+                       define('__STREET1'  , COMPILE_CODE($_POST['street_nr1']));
+                       define('__STREET2'  , COMPILE_CODE($_POST['street_nr2']));
+                       define('__COUNTRY'  , COMPILE_CODE($_POST['country']));
+                       define('__ZIP'      , COMPILE_CODE($_POST['zip']));
+                       define('__CITY'     , COMPILE_CODE($_POST['city']));
+                       define('__PHONE'    , COMPILE_CODE($_POST['phone']));
+                       define('__FAX'      , COMPILE_CODE($_POST['fax']));
+                       define('__CELL'     , COMPILE_CODE($_POST['cell']));
+                       define('__EMAIL'    , COMPILE_CODE($_POST['email']));
+                       define('__URL'      , COMPILE_CODE($_POST['url']));
+
+                       // Check for gender selection
+                       switch ($_POST['gender'])
+                       {
+                       case "M": // Male
+                               define('__GENDER_M'  , " selected=\"selected\"");
+                               define('__GENDER_F'  , "");
+                               define('__GENDER_C'  , "");
+                               break;
+
+                       case "F": // Female
+                               define('__GENDER_M'  , "");
+                               define('__GENDER_F'  , " selected=\"selected\"");
+                               define('__GENDER_C'  , "");
+                               break;
+
+                       case "C": // Company
+                               define('__GENDER_M'  , "");
+                               define('__GENDER_F'  , "");
+                               define('__GENDER_C'  , " selected=\"selected\"");
+                               break;
+                       }
+
+                       // Check for receive_warnings
+                       switch ($_POST['receive_warnings'])
+                       {
+                       case "Y":
+                               define('__REC_Y'    , " selected=\"selected\"");
+                               define('__REC_N'    , "");
+                               break;
+
+                       case "N":
+                               define('__REC_Y'    , "");
+                               define('__REC_N'    , " selected=\"selected\"");
+                               break;
+                       }
+
+                       // Errors found
+                       $OUT = "<P align=\"center\">
+  <STRONG><FONT class=\"guest_failed\">".SPONSOR_REGISTER_SOMETHING_MISSING.":</FONT></STRONG><br />
+</P>
+<OL>\n";
+                       foreach ($FORM_ERRORS as $error)
+                       {
+                               $OUT .= "<LI>".$error."</LI>\n";
+                       }
+                       $OUT .= "</OL><br />\n";
+                       define('__SPONSOR_FORM_ERRORS', $OUT);
+                       define('__SPONSOR_REFID', $_POST['refid']);
+               }
+                else
+               {
+                       // None found, first call
+                       define('__COMPANY'  , "");
+                       define('__POSITION' , "");
+                       define('__TAX_IDENT', "");
+                       define('__GENDER_M'  , "");
+                       define('__GENDER_F'  , "");
+                       define('__GENDER_C'  , "");
+                       define('__SURNAME'  , "");
+                       define('__FAMILY'   , "");
+                       define('__STREET1'  , "");
+                       define('__STREET2'  , "");
+                       define('__COUNTRY'  , "");
+                       define('__ZIP'      , "");
+                       define('__CITY'     , "");
+                       define('__PHONE'    , "");
+                       define('__FAX'      , "");
+                       define('__CELL'     , "");
+                       define('__EMAIL'    , "");
+                       define('__URL'      , "");
+                       define('__REC_Y'    , "");
+                       define('__REC_N'    , "");
+
+                       // No errors found so far
+                       define('__SPONSOR_FORM_ERRORS', "");
+               }
+
+               // Prepare referral things
+               if (!isset($_GET['refid']))
+               {
+                       // No referral link
+                       define('__SPONSOR_REFID', "0");
+               }
+                else
+               {
+                       // Referral ID transmitted, we don't care here if it is right or not
+                       define('__SPONSOR_REFID', bigintval($_GET['refid']));
+               }
+
+               // Display registration form
+               LOAD_TEMPLATE("guest_sponsor_reg");
+       }
+        else
+       {
+               // Nothing added so far
+               LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_PAYMENT_LIST_IS_EMPTY);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+
+//
+?>
diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php
new file mode 100644 (file)
index 0000000..73833a0
--- /dev/null
@@ -0,0 +1,228 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/14/2003 *
+ * ================                             Last change: 08/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-stats.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Statistics                                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Statistiken                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Derterminate which stats we want and set mode and title for the link below stats block
+if (!isset($_GET['mode'])) $_GET['mode'] = strtolower($_CONFIG['guest_stats']);
+switch ($_GET['mode'])
+{
+       case "members": $_CONFIG['guest_stats'] = "MEMBERS"; $lmode = "modules"; $ltitle = GUEST_STATS_MODULES; break;
+       case "modules": $_CONFIG['guest_stats'] = "MODULES"; $lmode = "members"; $ltitle = GUEST_STATS_MEMBERS; break;
+}
+
+switch ($_CONFIG['guest_stats'])
+{
+case "MEMBERS": // Statistics about your members
+       // Members yesterday / today online
+       $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE last_online >= ".START_YDAY." AND last_online < ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__));
+       $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE last_online >= ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__));
+
+       // Yesterday / today registered
+       $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE joined >= ".START_YDAY." AND joined < ".START_TDAY, __FILE__, __LINE__));
+       $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE joined >= ".START_TDAY, __FILE__, __LINE__));
+
+       // Only males / females
+       $male   = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE gender='M' AND status='CONFIRMED'", __FILE__, __LINE__));
+       $female = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE gender='F' AND status='CONFIRMED'", __FILE__, __LINE__));
+
+       // Unconfirmed accounts
+       $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status != 'CONFIRMED'", __FILE__, __LINE__));
+
+       // Total members
+       $total = $male + $female;
+
+       // List every month
+       $months = array();
+       for ($idx = 1; $idx < 13; $idx++)
+       {
+               $month = $idx; if ($idx < 10) $month = "0".$idx;
+               $months[$month] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE birth_month=%s AND status='CONFIRMED'",
+                array(bigintval($month)), __FILE__, __LINE__));
+       }
+
+       // Members in categories
+       $result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats WHERE visible='Y' ORDER BY id", __FILE__, __LINE__);
+
+       // Load categories first
+       $cats = array(); $cat_cnt = array();
+       while (list($id, $cat) = SQL_FETCHROW($result))
+       {
+               // Simple...
+               $cats[$id] = $cat;
+       }
+
+       // Now we have all categories loaded, count members
+       foreach ($cats as $id => $dummy)
+       {
+               // We only need id and nothing more to count...
+               $cat_cnt[$id] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
+                array(bigintval($id)), __FILE__, __LINE__));
+       }
+
+       // Prepare data for the template
+       define('__TOTAL_USERS' , $total);
+       define('__UNCONFIRMED' , $unconfirmed);
+       define('__MALE_COUNT'  , $male);
+       define('__FEMALE_COUNT', $female);
+       define('__TMEM_COUNT'  , $tmem);
+       define('__YMEM_COUNT'  , $ymem);
+       define('__TREG_COUNT'  , $treg);
+       define('__YREG_COUNT'  , $yreg);
+       define('__LMODE_VALUE' , $lmode);
+       define('__LINK_TITLE'  , $ltitle);
+
+       // Generate monthly stats
+       $SW = 2; $r2 = " right2"; $l = "ll"; $r = "lr"; $OUT = "";
+       foreach ($months as $month => $cnt)
+       {
+               if ($SW == 2) $OUT .= "<TR>\n";
+
+               // Prepare data for template
+               $content = array(
+                       'l_class'  => $l,
+                       'm_descr'  => $MONTH_DESCR[$month],
+                       'r_class'  => $r,
+                       'r2_class' => $r2,
+                       'cnt'      => $cnt
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("guest_stats_month_row", true, $content);
+
+               if ($SW == 2)
+               {
+                       $r2 = "";
+                       $l = "rl"; $r = "rr";
+               }
+                else
+               {
+                       $OUT .= "</TR>\n";
+                       $r2 = " right2";
+                       $l = "ll"; $r = "lr";
+               }
+               $SW = 3 - $SW;
+       }
+       define('__MONTH_STATS_ROWS', $OUT);
+
+       // Generate category stats
+       $SW = 2; $OUT = "";
+       foreach ($cat_cnt as $id => $cnt)
+       {
+               // Prepare data for the template
+               $content = array(
+                       'sw'  => $SW,
+                       'cat' => $cats[$id],
+                       'cnt' => $cnt,
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("guest_stats_cats_row", true, $content);
+               $SW = 3 - $SW;
+       }
+       define('__CATS_STATS_ROWS', $OUT);
+
+       // Load final template
+       LOAD_TEMPLATE("guest_stats_member");
+       break;
+
+case "MODULES": // TOP10 module clicks
+       $AND = "";
+       if (!IS_ADMIN()) $AND = " AND locked='N' AND visible='Y'";
+       $guest_t10 = SQL_QUERY("SELECT counter, title FROM "._MYSQL_PREFIX."_guest_menu WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__);
+       $mem_t10   = SQL_QUERY("SELECT counter, title FROM "._MYSQL_PREFIX."_member_menu WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__);
+       if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0))
+       {
+               // Output header
+               OUTPUT_HTML("<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"guest_table dashed\" width=\"310\">
+<TR>
+  <TD align=\"center\" class=\"guest_stats_title bottom2\" colspan=\"2\"><STRONG>".GUEST_TOPTEN_STATS."</STRONG></TD>
+</TR>");
+       }
+
+       if (SQL_NUMROWS($guest_t10) > 0)
+       {
+               // Guest clicks
+               OUTPUT_HTML("<TR>
+  <TD align=\"center\" class=\"guest_title2 bottom2\" colspan=\"2\">".GUEST_TOP_GUEST_STATS."</TD>
+</TR>");
+               $SW = 2;
+               while (list($clicks, $title) = SQL_FETCHROW($guest_t10))
+               {
+                       OUTPUT_HTML("<TR>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"right\" width=\"250\">".$title."&nbsp;</TD>
+  <TD class=\"switch_sw".$SW." bottom2\" width=\"50\">&nbsp;".$clicks."</TD>
+</TR>");
+                       $SW = 3 - $SW;
+               }
+       }
+       if (SQL_NUMROWS($guest_t10) > 0)
+       {
+               // Guest clicks
+               OUTPUT_HTML("<TR>
+  <TD align=\"center\" class=\"guest_title2 bottom2\" colspan=\"2\">".GUEST_TOP_MEMBER_STATS."</TD>
+</TR>");
+               $SW = 2;
+               while (list($clicks, $title) = SQL_FETCHROW($mem_t10))
+               {
+                       OUTPUT_HTML("<TR>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"right\" width=\"250\">".$title."&nbsp;</TD>
+  <TD class=\"switch_sw".$SW." bottom2\" width=\"50\">&nbsp;".$clicks."</TD>
+</TR>");
+                       $SW = 3 - $SW;
+               }
+       }
+       if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0))
+       {
+               // Output footer
+               OUTPUT_HTML("<TR>
+  <TD align=\"center\" class=\"guest_stats_footer\" colspan=\"2\"><A href=\"".URL."/modules.php?module=index&amp;what=stats&amp;mode=".$lmode."\">".$ltitle."</A></TD>
+</TR>
+</TABLE>");
+       }
+       break;
+
+case "INACTIVE": // Deactivated stats
+       LOAD_TEMPLATE("admin_settings_saved", false, "<STRONG>".GUEST_STATS_DEACTIVATED."</STRONG>");
+       break;
+}
+
+//
+?>
diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php
new file mode 100644 (file)
index 0000000..56ef74b
--- /dev/null
@@ -0,0 +1,205 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/24/2004 *
+ * ================                             Last change: 11/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-top10.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : TOP logins / best earner etc.                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : TOP-Logins / Bestverdiener usw.                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("top10")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "top10");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+//// TOP logins
+$ADD = "userid";
+if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname";
+$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", total_logins, last_online
+FROM "._MYSQL_PREFIX."_user_data
+WHERE total_logins>0 AND status='CONFIRMED' ORDER BY total_logins DESC LIMIT %s",
+ array($_CONFIG['top10_max']), __FILE__, __LINE__);
+
+$OUT = ""; $SW = 2; $cnt = 1;
+while(list($uid, $nick, $logins, $last) = SQL_FETCHROW($result))
+{
+       $nick2 = "---";
+       if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+
+       // Prepare data for template
+       $content = array(
+               'sw'     => $SW,
+               'cnt'    => $cnt,
+               'uid'    => $uid,
+               'nick'   => $nick2,
+               'logins' => $logins,
+               'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points")),
+               'last'   => MAKE_DATETIME($last, "3"),
+       );
+
+       // Load row template
+       $OUT .= LOAD_TEMPLATE("guest_top10_row_login", true, $content);
+
+       // Switch colors and count one up
+       $SW = 3 - $SW; $cnt++;
+}
+if ($cnt < $_CONFIG['top10_max'])
+{
+       // Add more "blank" rows
+       for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+       {
+               // Prepare data for template
+               $content = array(
+                       'sw'  => $SW,
+                       'idx' => $i
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("guest_top10_empty5", true, $content);
+               $SW = 3 - $SW;
+       }
+}
+define('__TOP_LOGINS_ROWS', $OUT);
+
+//// TOP earners
+$result = SQL_QUERY_ESC("SELECT DISTINCT p.userid, d.".$ADD.", (SUM(p.points) - d.used_points) AS tpoints, d.last_online
+FROM "._MYSQL_PREFIX."_user_points AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON p.userid=d.userid
+WHERE p.points > 0 AND d.status='CONFIRMED'
+GROUP BY p.userid
+ORDER BY tpoints DESC, d.last_online DESC
+LIMIT %s",
+ array($_CONFIG['top10_max']), __FILE__, __LINE__);
+
+$OUT = ""; $SW = 2; $cnt = 1;
+while(list($uid, $nick, $points, $last) = SQL_FETCHROW($result))
+{
+       $nick2 = "---";
+       if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+
+       // Prepare data for template
+       $content = array(
+               'sw'     => $SW,
+               'cnt'    => $cnt,
+               'uid'    => bigintval($uid),
+               'nick'   => $nick2,
+               'points' => TRANSLATE_COMMA($points),
+               'last'   => MAKE_DATETIME($last, "3")
+       );
+
+       // Load row template
+       $OUT .= LOAD_TEMPLATE("guest_top10_row_earner", true, $content);
+
+       // Switch colors and count one up
+       $SW = 3 - $SW; $cnt++;
+}
+if ($cnt < $_CONFIG['top10_max'])
+{
+       // Add more "blank" rows
+       for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+       {
+               // Prepare data for template
+               $content = array(
+                       'sw'  => $SW,
+                       'idx' => $i
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("guest_top10_empty4", true, $content);
+               $SW = 3 - $SW;
+       }
+}
+define('__TOP_POINTS_ROWS', $OUT);
+
+//// TOP referral "hunter"
+$result = SQL_QUERY_ESC("SELECT DISTINCT r.userid, d.".$ADD.", SUM(r.counter) AS refs, d.last_online
+FROM "._MYSQL_PREFIX."_refsystem AS r
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON r.userid=d.userid
+WHERE r.counter > 0 AND d.status='CONFIRMED'
+GROUP BY r.userid
+ORDER BY refs DESC, d.last_online DESC
+LIMIT %s",
+ array($_CONFIG['top10_max']), __FILE__, __LINE__);
+
+$OUT = ""; $SW = 2; $cnt = 1;
+while(list($uid, $nick, $refs, $last) = SQL_FETCHROW($result))
+{
+       $nick2 = "---";
+       if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+
+       // Prepare data for template
+       $content = array(
+               'sw'     => $SW,
+               'cnt'    => $cnt,
+               'uid'    => bigintval($uid),
+               'refs'   => $refs,
+               'nick'   => $nick2,
+               'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points")),
+               'last'   => MAKE_DATETIME($last, "3")
+       );
+
+       // Load row template
+       $OUT .= LOAD_TEMPLATE("guest_top10_row_refs", true, $content);
+
+       // Switch colors and count one up
+       $SW = 3 - $SW; $cnt++;
+}
+if ($cnt < $_CONFIG['top10_max'])
+{
+       // Add more "blank" rows
+       for ($i = $cnt; $i <= $_CONFIG['top10_max']; $i++)
+       {
+               // Prepare data for template
+               $content = array(
+                       'sw'  => $SW,
+                       'idx' => $i
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("guest_top10_empty5", true, $content);
+               $SW = 3 - $SW;
+       }
+}
+define('__TOP_REFERRAL_ROWS', $OUT);
+
+// Remember other values in constants
+define('__TOP10_MAX', $_CONFIG['top10_max']);
+
+// Load final template
+LOAD_TEMPLATE("guest_top10");
+
+//
+?>
diff --git a/inc/modules/guest/what-welcome.php b/inc/modules/guest/what-welcome.php
new file mode 100644 (file)
index 0000000..c8e885c
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/10/2003 *
+ * ===============                              Last change: 03/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-welcome.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Welcome page                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Willkommensseite                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+// Load default template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/guest/what-wernis_portal.php b/inc/modules/guest/what-wernis_portal.php
new file mode 100644 (file)
index 0000000..c747674
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ================                             Last change: 10/19/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Special file
+require_once (PATH."inc/rdf.class.php");
+
+// Add description as navigation point
+ADD_DESCR("guest", basename(__FILE__));
+
+OUTPUT_HTML("<DIV style=\"padding-left: 10px; padding-right: 10px\">");
+$rdf = new fase4_rdf;
+$rdf->use_dynamic_display(false);
+$rdf->set_CacheDir(PATH."inc/cache/");
+$rdf->set_salt(SITE_KEY);
+$rdf->set_max_item(10);
+$rdf->set_Options(
+       array(
+               'textinput' => "hidden",
+               'sitelink'  => "http://www.wds66.com",
+               'refid'     => bigintval($_CONFIG['wernis_refid']),
+               'reflink'   => "/ref.php?refid=",
+       )
+);
+
+// Use proxy?
+if ((!empty($_CONFIG['proxy_host'])) && (!empty($_CONFIG['proxy_port']))) {
+       // Set proxy data
+       $rdf->set_proxy($_CONFIG['proxy_host'], $_CONFIG['proxy_port']);
+
+       // Use auth?
+       if (!empty($_CONFIG['proxy_username'])) {
+               // Set auth data
+               $rdf->set_proxy_auth($_CONFIG['proxy_username'], $_CONFIG['proxy_password']);
+       } // END  - if
+} // END - if
+
+$rdf->parse_RDF("http://www.wds66.com/rss.xml");
+$rdf->finish();
+// DISABLED: $rdf->clear_cache();
+OUTPUT_HTML("</DIV>");
+
+//
+?>
diff --git a/inc/modules/index.php b/inc/modules/index.php
new file mode 100644 (file)
index 0000000..191ca68
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/23/2003 *
+ * ===============                              Last change: 03/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : index.php                                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Entrance page                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Eingangsseite                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("sql_patches", true)) {
+       // The extension "sql_patches" *MUST* be activated or you have lot's of problems!
+       LOAD_URL("modules.php?module=admin");
+}
+
+// Load adverstising template
+define('__GUEST_ADVERT', LOAD_TEMPLATE("guest_advert", true));
+
+// Generate a tableset for the menu title and content
+LOAD_TEMPLATE("guest_header");
+
+// Add message here
+if (!empty($_GET['msg'])) {
+       switch ($_GET['msg']) {
+               case CODE_LOGOUT_DONE      : $msg = LOGOUT_DONE; break;
+               case CODE_LOGOUT_FAILED    : $msg = "<SPAN class=\"guest_failed\">".LOGOUT_FAILED."</SPAN>"; break;
+               case CODE_DATA_INVALID     : $msg = MAIL_DATA_INVALID; break;
+               case CODE_POSSIBLE_INVALID : $msg = MAIL_POSSIBLE_INVALID; break;
+               case CODE_ACCOUNT_LOCKED   : $msg = MEMBER_ACCOUNT_LOCKED_UNC; break;
+               case CODE_USER_404         : $msg = USER_NOT_FOUND; break;
+               case CODE_STATS_404        : $msg = MAIL_STATS_404; break;
+               case CODE_ALREADY_CONFIRMED: $msg = MAIL_ALREADY_CONFIRMED; break;
+
+               case CODE_ERROR_MAILID:
+                       if (EXT_IS_ACTIVE($ext, true)) { $msg = ERROR_CONFIRMING_MAIL; } else { $msg = sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"); }
+                       break;
+
+               case CODE_EXTENSION_PROBLEM:
+                       // Default extension is "unknown"
+                       $ext = "unknown";
+
+                       // Is extension given?
+                       if (!empty($_GET['ext'])) $ext = SQL_ESCAPE($_GET['ext']);
+                       $msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, $ext);
+                       break;
+
+               case CODE_COOKIES_DISABLED : $msg = LOGIN_NO_COOKIES; break;
+               case CODE_BEG_SAME_AS_OWN  : $msg = BEG_SAME_UID_AS_OWN; break;
+               case CODE_LOGIN_FAILED     : $msg = LOGIN_FAILED_GENERAL; break;
+               default                    : $msg = UNKNOWN_MAILID_CODE_1.$_GET['msg'].UNKNOWN_MAILID_CODE_2; break;
+       }
+
+       // Load message template
+       LOAD_TEMPLATE("message", false, $msg);
+} // END - if
+
+// Some of you needs this to be extracted into a template... ???
+LOAD_TEMPLATE("guest_menu_td");
+
+// When no what value is provided take the "home" value
+if (empty($GLOBALS['what'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+
+// Adding the main content module here
+if (empty($GLOBALS['action'])) {
+       // Get action value from what value
+       $act = GET_ACTION("guest", $GLOBALS['what']);
+} else {
+       // Get action value directly from URL
+       $act = COMPILE_CODE($GLOBALS['action']);
+}
+
+// Add the guest's menu here...
+if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+       // Show only when guest menu is active
+       ADD_MENU("guest", $act, $GLOBALS['what']);
+} // END - if
+
+// TDs between menu and content
+LOAD_TEMPLATE("guest_menu_content");
+
+$INC_ACTION = sprintf("%sinc/modules/guest/action-%s.php", PATH, $act);
+if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("guest", $act, $GLOBALS['what']))) {
+       // Requested module is available so we load it
+       require_once($INC_ACTION);
+} else {
+       // Invalid module specified or not found...
+       LOAD_URL("modules.php?module=index");
+}
+
+if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+       // TDs between content and </table>
+       LOAD_TEMPLATE("guest_content_footer");
+
+       // Some advertising stuff?
+       LOAD_TEMPLATE("guest_advert2");
+
+       OUTPUT_HTML("  </TD>
+</TR>");
+
+       // Goto TOP template
+       LOAD_TEMPLATE("guest_goto_top");
+} // END - if
+
+// Footer template (Thanx to Mr. Glaus!)
+LOAD_TEMPLATE("guest_footer");
+
+//
+?>
diff --git a/inc/modules/loader.php b/inc/modules/loader.php
new file mode 100644 (file)
index 0000000..ab8533a
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/29/2003 *
+ * ===============                              Last change: 04/17/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : loader.php                                       *
+ * -------------------------------------------------------------------- *
+ * Short description : De-referrer page                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Referrer neu setzen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+if (!empty($_GET['url'])) {
+       // Decode URL
+       $url = gzuncompress(base64_decode(str_replace(" ", "+", COMPILE_CODE(urldecode($_GET['url'])))));
+
+       // Validate the URL
+       if (VALIDATE_URL($url)) {
+               // Prepare data for the template
+               define('__URL', $url);
+
+               // Generate a JavaScript that redirects us
+               LOAD_TEMPLATE("loader");
+       } else {
+               // URL invalid
+               LOAD_URL("index.php");
+       }
+} else {
+       // Invalid or no URL entered!
+       LOAD_URL("index.php");
+}
+
+//
+?>
diff --git a/inc/modules/login.php b/inc/modules/login.php
new file mode 100644 (file)
index 0000000..9ca58e5
--- /dev/null
@@ -0,0 +1,128 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/15/2003 *
+ * ===============                              Last change: 04/18/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : login.php                                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Login area for members                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Login-Bereich fuer Mitglieder                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       $URL = URL."/modules.php?module=index";
+       if ($check == "mem_only") $URL .= "&msg=".urlencode(LANG_MEM_ONLY_1.$GLOBALS['module'].LANG_MEM_ONLY_2);
+       LOAD_URL($URL);
+}
+
+if ($status != "CONFIRMED") {
+       // If the status is different than confirmed move the user away from here
+       switch ($status)
+       {
+       case "LOCKED":
+               $ERROR = CODE_ID_LOCKED;
+               break;
+
+       case "UNCONFIRMED":
+               $ERROR = CODE_ID_UNCONFIRMED;
+               break;
+
+       default:
+               $ERROR = CODE_UNKNOWN_STATUS;
+               break;
+       }
+       $URL = URL."/modules.php?module=index&login=".$ERROR;
+       LOAD_URL($URL);
+} // END - if
+
+// Recheck if he got logged out because bad cookies
+if (!IS_MEMBER()) {
+       $URL = URL."/modules.php?module=index";
+       LOAD_URL($URL);
+} // END - if
+
+// Load adverstising template
+define('__MEMBER_ADVERT', LOAD_TEMPLATE("member_banner", true));
+
+// Disable block mode by default
+$BLOCK_MODE = false;
+
+// Generate a tableset for the menu title and content
+LOAD_TEMPLATE("member_header");
+
+// Begin menu block here
+OUTPUT_HTML("<TR>
+  <TD class=\"member_menu\">");
+
+// Adding the main content module here
+if (empty($GLOBALS['action'])) {
+       if (empty($GLOBALS['what'])) $GLOBALS['what'] = "welcome";
+} else {
+       $act = SQL_ESCAPE($GLOBALS['action']);
+}
+
+// Add the member's menu here...
+if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+       ADD_MENU("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']);
+} // END - if
+
+// Menu -> content
+OUTPUT_HTML("   </TD>
+  <TD valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
+
+$INC_ACTION = sprintf("%sinc/modules/member/action-%s.php", PATH, $act);
+if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']))) {
+       // Requested module is available so we load it
+       include ($INC_ACTION);
+} else {
+       // Invalid module specified or not found...
+       LOAD_URL("modules.php?module=login");
+}
+
+if (($_CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
+       OUTPUT_HTML("  <br /></TD>
+</TR>
+<TR>
+  <TD align=\"center\" valign=\"top\" class=\"member_advert\">");
+
+       // Some advertising stuff?
+       LOAD_TEMPLATE("member_advert");
+}
+
+OUTPUT_HTML("  </TD>
+</TR>");
+
+// Load same template for "Goto TOP"
+LOAD_TEMPLATE("member_goto_top");
+
+// Footer template (Thanx to Mr. Glaus!)
+LOAD_TEMPLATE("member_footer");
+
+//
+?>
diff --git a/inc/modules/member/.htaccess b/inc/modules/member/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/modules/member/action- b/inc/modules/member/action-
new file mode 100644 (file)
index 0000000..93cd742
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_LOGGED_IN()) {
+       LOAD_URL(URL."/modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-account.php b/inc/modules/member/action-account.php
new file mode 100644 (file)
index 0000000..6924b13
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-account.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Account functions                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Accountfunktionen                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-bank.php b/inc/modules/member/action-bank.php
new file mode 100644 (file)
index 0000000..c849656
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/27/2004 *
+ * ================                             Last change: 01/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-extras.php b/inc/modules/member/action-extras.php
new file mode 100644 (file)
index 0000000..dfcacbc
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-extras.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Extra functionality                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Extra-Funktionen                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-logout.php b/inc/modules/member/action-logout.php
new file mode 100644 (file)
index 0000000..03e2bca
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/18/2003 *
+ * ===============                              Last change: 02/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-logout.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Logout menu                                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ausloggenmenue                                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-main.php b/inc/modules/member/action-main.php
new file mode 100644 (file)
index 0000000..2538018
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/16/2003 *
+ * ===============                              Last change: 02/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-main.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Main menu                                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hauptauwahl                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-order.php b/inc/modules/member/action-order.php
new file mode 100644 (file)
index 0000000..2a42cbf
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-order.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Different types of mail orders                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verschiedene Typen von Mailbuchungen             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-rals.php b/inc/modules/member/action-rals.php
new file mode 100644 (file)
index 0000000..8ae25e7
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-rals.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : All rallyes together                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Rallyes zusammen                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-stats.php b/inc/modules/member/action-stats.php
new file mode 100644 (file)
index 0000000..93777ec
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2006 *
+ * ================                             Last change: 02/12/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-stats.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Misc statistics                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verschiedene Statistiken                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-surfbar.php b/inc/modules/member/action-surfbar.php
new file mode 100644 (file)
index 0000000..f76f261
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2008 *
+ * ================                             Last change: 09/05/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-surfbar.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar main menu                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Surfbar-Hauptmenue                               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL(URL."/modules.php?module=index");
+} elseif ($BLOCK_MODE) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load the include file
+$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
+if (FILE_READABLE($INC_WHAT)) {
+       // Ok, we finally load the member action module
+       include_once($INC_WHAT);
+} else {
+       ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
+}
+
+//
+?>
diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php
new file mode 100644 (file)
index 0000000..fc90a45
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/12/2004 *
+ * ================                             Last change: 11/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-themes.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme selector                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Theme-Auswahl                                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Already defined?
+if (defined('__THEME_SELECTION_CONTENT')) return false;
+
+// Load all active designs (or all if admin)
+$whereStatement = ""; $OUT = "";
+if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'";
+$result_themes = SQL_QUERY("SELECT theme_path FROM "._MYSQL_PREFIX."_themes".$whereStatement, __FILE__, __LINE__);
+$num_themes = SQL_NUMROWS($result_themes);
+
+if ($num_themes > 1) {
+       // If more than 1 is installed output selection box
+       $act = ""; $wht = "";
+       if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
+       if (!empty($GLOBALS['what']))   $wht = SQL_ESCAPE($GLOBALS['what']);
+       $OUT = THEME_SELECTION_BOX("login", $act, $wht, $result_themes);
+} elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
+       // If there's only one just print it's name
+       define('__THEME_NAME', GET_CURR_THEME_NAME());
+       $OUT = LOAD_TEMPLATE("theme_one", true);
+} elseif (IS_ADMIN()) {
+       // If there is no theme installed and there's an admin notify him!
+       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, "<FONT class=\"admin_note\">".ADMIN_NO_THEME_INSTALLED_WARNING."</FONT>");
+}
+
+// Remember
+define('__THEME_SELECTION_CONTENT', $OUT);
+
+// Free memory
+SQL_FREERESULT($result_themes);
+
+// Load final box template
+LOAD_TEMPLATE("theme_select_box");
+
+//
+?>
diff --git a/inc/modules/member/what- b/inc/modules/member/what-
new file mode 100644 (file)
index 0000000..48f496d
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_LOGGED_IN()) {
+       LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-bank_create.php b/inc/modules/member/what-bank_create.php
new file mode 100644 (file)
index 0000000..ccae264
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-bank_deposit.php b/inc/modules/member/what-bank_deposit.php
new file mode 100644 (file)
index 0000000..ccae264
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-bank_infos.php b/inc/modules/member/what-bank_infos.php
new file mode 100644 (file)
index 0000000..ccae264
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-bank_output.php b/inc/modules/member/what-bank_output.php
new file mode 100644 (file)
index 0000000..ccae264
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-bank_withdraw.php b/inc/modules/member/what-bank_withdraw.php
new file mode 100644 (file)
index 0000000..ccae264
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php
new file mode 100644 (file)
index 0000000..278d227
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 01/09/2005 *
+ * ================                             Last change: 01/09/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-beg.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Beg link                                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bettel-Link                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+$uid = $GLOBALS['userid'];
+if (EXT_IS_ACTIVE("nickname"))
+{
+       // Load nickname
+       $data = "nickname";
+}
+ else
+{
+       // Load userid
+       $data = "userid";
+}
+
+// Run SQL command
+$result = SQL_QUERY_ESC("SELECT ".$data.", beg_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__);
+list($uid, $clicks) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// Set User-ID when no nickname was found
+$nickname = true;
+if (empty($uid)) { $uid = $GLOBALS['userid']; $nickname = false; }
+
+// Prepare constants
+define('__BEG_UID'       , $uid);
+define('__BEG_CLICKS'    , $clicks);
+define('__BEG_POINTS'    , TRANSLATE_COMMA($_CONFIG['beg_points']));
+define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max']));
+
+if (function_exists('CREATE_FANCY_TIME'))
+{
+       define('__BEG_TIMEOUT'    , CREATE_FANCY_TIME($_CONFIG['beg_timeout']));
+       define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout']));
+}
+ else
+{
+       define('__BEG_TIMEOUT '   , round($_CONFIG['beg_timeout']     / 60)." ".MINUTES);
+       define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES);
+}
+
+// Load template
+LOAD_TEMPLATE("member_".substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php
new file mode 100644 (file)
index 0000000..a7e131b
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/22/2005 *
+ * ===============                              Last change: 10/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-beg2.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : List all begging members                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle moeglichen Gewinner der Bettel-Rallye aufl. *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php[5~?module=index");
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Autopurge installed?
+$LAST = "%s"; $ONLINE = "";
+if (EXT_IS_ACTIVE("autopurge")) {
+       // Use last online timestamp to keep inactive members away from here
+       $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $ONLINE = $_CONFIG['ap_inactive_since'];
+}
+
+// Let's check if there are some points left we can "pay"...
+$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM "._MYSQL_PREFIX."_user_data
+WHERE beg_points > 0 AND status='CONFIRMED'".$LAST."
+ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s",
+ array($ONLINE, $_CONFIG['beg_ranks']), __FILE__, __LINE__);
+
+// Reset temporary variable and check for users
+$OUT = "";
+if (SQL_NUMROWS($result) > 0)
+{
+       // Load our winners...
+       $SW = 2; $cnt = 1;
+       while(list($uid, $turbo, $last) = SQL_FETCHROW($result))
+       {
+               // Prepare data for the template
+               $content = array(
+                       'sw'     => $SW,
+                       'cnt'    => $cnt,
+                       'uid'    => bigintval($uid),
+                       'points' => TRANSLATE_COMMA($turbo),
+                       'last'   => MAKE_DATETIME($last, "2"),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("member_list_beg_row", true, $content);
+
+               // Count one up and switch colors
+               $cnt++;$SW = 3 - $SW;
+       }
+}
+ else
+{
+       // No one is interested in our "active rallye" ! :-(
+       $OUT = LOAD_TEMPLATE("member_beg_404", true);
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+// Remeber row(s) for the template
+define('__BEG_ROWS', $OUT);
+
+// Load final template
+LOAD_TEMPLATE("member_list_beg");
+
+//
+?>
diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php
new file mode 100644 (file)
index 0000000..ddd819b
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 11/19/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-bonus.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Bonus pages for some extra points                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bonusseiten fuer ein paar Extrapunkte            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php[5~?module=index");
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+if (GET_EXT_VERSION("bonus") >= "0.6.9")
+{
+       // Add more bonus points here
+       $USE = "(0";
+       if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
+       if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
+       if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
+       if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
+       if ($_CONFIG['bonus_ref_yn']   == "Y") $USE .= " + bonus_ref";
+       $USE .= ")";
+}
+ else
+{
+       // Old version ???
+       $USE = "turbo_bonus";
+}
+
+// Autopurge installed?
+$LAST = "%s"; $ONLINE = "";
+if (EXT_IS_ACTIVE("autopurge")) {
+       // Use last online timestamp to keep inactive members away from here
+       $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $ONLINE = $_CONFIG['ap_inactive_since'];
+}
+
+// Let's check if there are some points left we can "pay"...
+$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS active_bonus, last_online FROM "._MYSQL_PREFIX."_user_data
+WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST."
+ORDER BY active_bonus DESC, last_online DESC, userid LIMIT %s",
+ array($ONLINE, $_CONFIG['bonus_ranks']), __FILE__, __LINE__);
+
+// Reset temporary variable and check for users
+$OUT = "";
+if (SQL_NUMROWS($result) > 0)
+{
+       // Load our winners...
+       $SW = 2; $cnt = 1;
+       while(list($uid, $turbo, $last) = SQL_FETCHROW($result))
+       {
+               // Prepare data for the template
+               $content = array(
+                       'sw'     => $SW,
+                       'cnt'    => $cnt,
+                       'uid'    => bigintval($uid),
+                       'points' => TRANSLATE_COMMA($turbo),
+                       'last'   => MAKE_DATETIME($last, "2"),
+               );
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
+
+               // Count one up and switch colors
+               $cnt++;$SW = 3 - $SW;
+       }
+}
+ else
+{
+       // No one is interested in our "active rallye" ! :-(
+       $OUT = LOAD_TEMPLATE("member_bonus_404", true);
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+// Remeber row(s) for the template
+define('__BONUS_ROWS', $OUT);
+
+// Load final template
+LOAD_TEMPLATE("member_bonus");
+
+//
+?>
diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php
new file mode 100644 (file)
index 0000000..c9e9d2f
--- /dev/null
@@ -0,0 +1,170 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-categories.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Select or unselect categories                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Kategorien ab- bzw. anwaehlen                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php[13~?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+$UID = $GLOBALS['userid'];
+$whereStatement = " WHERE visible='Y'";
+if (IS_ADMIN()) $whereStatement = "";
+
+$result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
+$cats = SQL_NUMROWS($result);
+
+if ($cats > 0)
+{
+       $LEAST = false;
+       if (isset($_POST['ok']))
+       {
+               $cnt = 0;
+               foreach ($_POST['cat'] as $cat => $joined)
+               {
+                       if ($joined == "N") $cnt++;
+               }
+               if (($cats - $cnt) < $_CONFIG['least_cats'])
+               {
+                       unset($_POST['ok']);
+                       $LEAST = true;
+               }
+       }
+       if (isset($_POST['ok']))
+       {
+               foreach ($_POST['cat'] as $cat => $joined)
+               {
+                       switch ($joined)
+                       {
+                               case 'Y':
+                                       $sql = "";
+                                       $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
+                                        array($UID, bigintval($cat)), __FILE__, __LINE__);
+
+                                       if (SQL_NUMROWS($result_user) == 0)
+                                       {
+                                               $sql = "INSERT INTO "._MYSQL_PREFIX."_user_cats (userid, cat_id) VALUES ('%s','%s')";
+                                       }
+                                        else
+                                       {
+                                               // Free memory
+                                               SQL_FREERESULT($result_user);
+                                       }
+                                       break;
+
+                               case 'N':
+                                       $sql = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1";
+                                       break;
+                       }
+                       if (!empty($sql))
+                       {
+                               // Run SQL command
+                               $result = SQL_QUERY_ESC(trim($sql), array($UID, bigintval($cat)), __FILE__, __LINE__);
+                       }
+               }
+               // Categories saved...
+               LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_CATS_SAVED);
+       }
+        else
+       {
+               if ($LEAST)
+               {
+                       // Also here we have to secure it... :(
+                       LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".$_CONFIG['least_cats']);
+               }
+               // Put some data into constants for the template
+               define('__ROWS', ($cats*2+4));
+
+               // Load header template
+               LOAD_TEMPLATE("member_cats_header");
+
+               // Start switching colors and load all visible categories
+               $SW = 2;
+               while (list($id, $cat) = SQL_FETCHROW($result))
+               {
+                       // Default he has not joined
+                       $JOINED_N = " checked=\"checked\""; $JOINED_Y = "";
+
+                       // Check category selection
+                       $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
+                        array($UID, bigintval($id)), __FILE__, __LINE__);
+
+                       // When we found an entry don't read it, just change the JOINED_x variables
+                       if (isset($_POST['cat']))
+                       {
+                               if ($_POST['cat'][$id] =='Y') { $JOINED_Y = " checked=\"checked\""; $JOINED_N = ""; }
+                       }
+                        else
+                       {
+                               if (SQL_NUMROWS($result_user) == 1)
+                               {
+                                       $JOINED_Y = " checked=\"checked\""; $JOINED_N = "";
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result_user);
+                       }
+
+                       // Prepare data for the template
+                       $content = array(
+                               'sw'  => $SW,
+                               'id'  => $id,
+                               'cat' => $cat,
+                               'jy'  => $JOINED_Y,
+                               'jn'  => $JOINED_N,
+                       );
+
+                       // Load row template and switch colors
+                       LOAD_TEMPLATE("member_cat_row", false, $content);
+                       $SW = 3 - $SW;
+               }
+
+               // Load footer template
+               LOAD_TEMPLATE("member_cats_footer");
+       }
+}
+ else
+{
+       // No cateogries are defined yet
+       LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_CATS);
+}
+
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/member/what-doubler.php b/inc/modules/member/what-doubler.php
new file mode 100644 (file)
index 0000000..b837946
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/17/2005 *
+ * ================                             Last change: 02/17/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-doubler.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : General doubling informations                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Allgemeine Informationen zum Verdoppen           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php[5~?module=index");
+} elseif (!EXT_IS_ACTIVE("doubler")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "doubler");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Percent values etc.
+define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['doubler_charge'] * 100));
+define('__REF_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_ref'] * 100));
+define('__TOTAL_VALUE' , TRANSLATE_COMMA($_CONFIG['doubler_points']));
+define('__MIN_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_min']));
+define('__MAX_VALUE'   , TRANSLATE_COMMA($_CONFIG['doubler_max']));
+
+// Transfer referral ID
+if (EXT_IS_ACTIVE("nickname"))
+{
+       // Load nickname from DB
+       $nick = NICKNAME_GET_NICK($GLOBALS['userid']);
+
+       if (!empty($nick))
+       {
+               // Set nickname
+               define('__USERID', $nick);
+       }
+        else
+       {
+               // Use direct userid
+               define('__USERID', $GLOBALS['userid']);
+       }
+}
+ else
+{
+       // Use direct userid
+       define('__USERID', $GLOBALS['userid']);
+}
+
+// Usage counter
+define('__DOUBLER_COUNTER', $_CONFIG['doubler_counter']);
+
+// Which mail-send-mode did the admin setup?
+switch ($_CONFIG['doubler_send_mode'])
+{
+case "DIRECT":
+       define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
+       break;
+
+case "RESET":
+       define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_RESET);
+       break;
+}
+
+// Generate table with already payed out doubles
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE($GLOBALS['userid'], "Y", "N", "DESC"));
+
+// Generate table with next-to-run payouts
+define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE($GLOBALS['userid']));
+
+// Generate table with refferal payouts
+define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE($GLOBALS['userid'], "N", "Y", "DESC"));
+
+// Generate timemark
+define('__TIMEOUT_MARK', CREATE_FANCY_TIME($_CONFIG['doubler_timeout']));
+
+// Points left to double
+define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
+
+// Load template
+LOAD_TEMPLATE("member_doubler");
+
+//
+?>
diff --git a/inc/modules/member/what-guest.php b/inc/modules/member/what-guest.php
new file mode 100644 (file)
index 0000000..e687649
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/04/2004 *
+ * ================                             Last change: 04/04/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-guest.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Redirects back to the guest menu                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Simply redirect...
+LOAD_URL (URL."/modules.php?module=index");
+//
+?>
diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php
new file mode 100644 (file)
index 0000000..2d1d268
--- /dev/null
@@ -0,0 +1,270 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 07/24/2004 *
+ * ================                             Last change: 07/31/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-holiday.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Holiday requests                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Urlaubsschaltungen                               *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Check for running mail orders in pool
+$result1 = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_pool
+WHERE sender=%s ORDER BY timestamp DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+
+// Check for sent mail orders in stats
+$result2 = SQL_QUERY_ESC("SELECT timestamp_ordered FROM "._MYSQL_PREFIX."_user_stats
+WHERE userid=%s ORDER BY timestamp_ordered DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+
+if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1))
+{
+       // Mail order found!
+       list($stamp1) = SQL_FETCHROW($result1);
+       list($stamp2) = SQL_FETCHROW($result2);
+       if (empty($stamp1)) $stamp1 = 0;
+       if (empty($stamp2)) $stamp2 = 0;
+
+       if ((($stamp1 + $_CONFIG['holiday_lock']) > time()) || (($stamp2 + $_CONFIG['holiday_lock']) > time()))
+       {
+               // Mail order is to close away!
+               unset($_POST['ok']);
+               unset($_POST['stop']);
+
+               if (($stamp1 + $_CONFIG['holiday_lock']) > time())
+               {
+                       // Mail found in pool
+                       $stamp = $stamp1;
+               }
+                else
+               {
+                       // Mail found in stats
+                       $stamp = $stamp2;
+               }
+
+               // Display message and exit here
+               LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_ORDER_1.MAKE_DATETIME($stamp, "1").HOLIDAY_MEMBER_ORDER_2);
+               return;
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result1);
+SQL_FREERESULT($result2);
+
+if (isset($_POST['ok']))
+{
+       // Check holiday request...
+       $START = mktime(0, 0, 0, $_POST['start_month'], $_POST['start_day'], $_POST['start_year']);
+       $END   = mktime(0, 0, 0, $_POST['end_month']  , $_POST['end_day']  , $_POST['end_year']  );
+
+       // Test both values
+       $TEST = $END - $START;
+       if (($TEST < 0) || ($TEST > ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])) || ($START < time()) || ($END < time()))
+       {
+               // Time test failed
+               unset($_POST['ok']);
+       }
+        else
+       {
+               // Everything went okay so let's store his request and send mails
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_holidays (userid, holiday_start, holiday_end, comments) VALUES ('%s','%s','%s','%s')",
+                array($GLOBALS['userid'], $START, $END, $_POST['comments']), __FILE__, __LINE__);
+
+               // Activate holiday system
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET holiday_active='N', holiday_activated=UNIX_TIMESTAMP()
+WHERE userid=%s LIMIT 1",
+                array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Prepare constants
+               define('_START_DAY'  , $_POST['start_day']);
+               define('_START_MONTH', $MONTH_DESCR[$_POST['start_month']]);
+               define('_START_YEAR' , $_POST['start_year']);
+               define('_END_DAY'    , $_POST['end_day']);
+               define('_END_MONTH'  , $MONTH_DESCR[$_POST['end_month']]);
+               define('_END_YEAR'   , $_POST['end_year']);
+
+               // Send mail to member
+               $msg = LOAD_EMAIL_TEMPLATE("member_holiday_request", $_POST['comments'], $GLOBALS['userid']);
+               SEND_EMAIL($GLOBALS['userid'], HOLIDAY_MEMBER_SUBJECT, $msg);
+
+               // Send mail to all admins
+               SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_SUBJECT, "admin_holiday_request", $_POST['comments'], $GLOBALS['userid']);
+
+               // Create task
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','HOLIDAY_REQUEST','%s','%s', UNIX_TIMESTAMP())",
+                array($GLOBALS['userid'], HOLIDAY_ADMIN_SUBJECT, addslashes($msg)), __FILE__, __LINE__);
+
+               // Display message
+               LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_IS_ACTIVATED_NOW);
+       }
+}
+
+// Holiday shall be ended now
+if (isset($_POST['stop']))
+{
+       // Okay, end the holiday here...
+       $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($active, $locked) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if (($active == "Y") && (($locked + $_CONFIG['holiday_lock']) < time()))
+       {
+               // Load data
+               $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Data was found
+                       list($start, $end) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+
+                       // Prepare it for the template
+                       define('__HOLIDAY_START', MAKE_DATETIME($start, "3"));
+                       define('__HOLIDAY_END'  , MAKE_DATETIME($end  , "3"));
+
+                       // Deactivate it now
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET holiday_active='N', holiday_activated='0'
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+
+                       // Remove entry
+                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+
+                       // Send email to admin
+                       SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_DEAC_SUBJ, "admin_holiday_deactivated", array(), $GLOBALS['userid']);
+
+                       // Display message to user
+                       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_DEACTIVATED_NOW);
+               }
+                else
+               {
+                       // Display message to user
+                       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_CANNOT_DEACTIVATE);
+               }
+       }
+        elseif ($active == "Y")
+       {
+               // To fast!
+               LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_LOCKED);
+       }
+}
+
+// If something is wrong or link in menu is just clicked display form
+if ((!isset($_POST['ok'])) && (!isset($_POST['stop'])))
+{
+       // Check if user is in holiday...
+       $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($active, $locked) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Check for lock
+       if (($locked + $_CONFIG['holiday_lock']) < time())
+       {
+               // User can deactivate his holiday request
+               switch ($active)
+               {
+               case 'Y': // Display deactivation form
+                       // Load starting and ending date
+                       $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Data was found
+                               list($start, $end) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+
+                               // Prepare it for the template
+                               define('__HOLIDAY_START', MAKE_DATETIME($start , "3"));
+                               define('__HOLIDAY_END'  , MAKE_DATETIME($end   , "3"));
+                               define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, "1"));
+
+                               // Load template
+                               LOAD_TEMPLATE("member_holiday_deactivate");
+                       }
+                        else
+                       {
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Remove entry and reload URL
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
+SET holiday_active='N'
+WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+                               LOAD_URL("modules.php?module=login&amp;what=holiday");
+                               return;
+                       }
+                       break;
+
+               case 'N': // Display activation form
+                       // Starting day
+                       define('_START_DAY'  , ADD_SELECTION("day"  , date("d", (time() + $_CONFIG['one_day'])), "start"));
+                       define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + $_CONFIG['one_day'])), "start"));
+                       define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + $_CONFIG['one_day'])), "start"));
+
+                       // Calcualte ending date
+                       $D = date("d", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+                       $M = date("m", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+                       $Y = date('Y', time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+
+                       // Ending day
+                       define('_END_DAY'  , ADD_SELECTION("day"  , $D, "end"));
+                       define('_END_MONTH', ADD_SELECTION("month", $M, "end"));
+                       define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end"));
+
+                       // Copy value from configuration
+                       define('__HOLIDAY_MAX', $_CONFIG['holiday_max']);
+
+                       // Output form
+                       LOAD_TEMPLATE("member_holiday_form");
+                       break;
+               }
+       }
+        else
+       {
+               // To fast!
+               LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_MEMBER_LOCKED);
+       }
+}
+//
+?>
diff --git a/inc/modules/member/what-html_mail.php b/inc/modules/member/what-html_mail.php
new file mode 100644 (file)
index 0000000..7573309
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/25/2004 *
+ * ================                             Last change: 04/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-html_mail.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : HTML mails                                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : HTML-Mails                                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("html_mail")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "html_mail");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Class was found and loaded
+if (isset($_POST['ok']))
+{
+       // Save settings
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET html='%s' WHERE userid=%s LIMIT 1",
+        array($_POST['html'], $GLOBALS['userid']), __FILE__, __LINE__);
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SETTINGS_SAVED);
+}
+ else
+{
+       // Load template for changing settings
+       $result = SQL_QUERY_ESC("SELECT html FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($mode) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       if ($mode == "Y")
+       {
+               define('HTML_Y', " checked=\"checked\"");
+               define('HTML_N', "");
+       }
+        else
+       {
+               define('HTML_N', " checked=\"checked\"");
+               define('HTML_Y', "");
+       }
+       LOAD_TEMPLATE("member_html_mail_settings");
+}
+//
+?>
diff --git a/inc/modules/member/what-logout.php b/inc/modules/member/what-logout.php
new file mode 100644 (file)
index 0000000..00e8344
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/16/2003 *
+ * ===============                              Last change: 04/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-logout.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Logout from member's area                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Aus dem Mitgliesbereich ausloggen                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Base URL for redirection (both cases)
+$URL = URL."/modules.php?module=index";
+
+if (destroy_user_session()) {
+       // Remove theme cookie as well
+       set_session("mxchange_theme", "");
+
+       // Logout completed
+       $URL .= "&msg=".CODE_LOGOUT_DONE;
+
+       // Destroy session here
+       @session_destroy();
+} else {
+       // Cannot logout! :-(
+       $URL .= "&msg=".CODE_LOGOUT_FAILED;
+}
+
+// Load the URL
+LOAD_URL($URL);
+
+//
+?>
diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php
new file mode 100644 (file)
index 0000000..efa643a
--- /dev/null
@@ -0,0 +1,331 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/16/2003 *
+ * ===============                              Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-mydata.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Members can edit their profile data here         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder koennen hier ihre Profildaten aendern *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("mydata")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "mydata");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+define('UID_VALUE', $GLOBALS['userid']); $URL = "";
+
+// Detect what the member wants to do
+$MODE = "show"; // Show his data
+if (!empty($_POST['save']))   $MODE = "save";   // Save entered data
+if (isset($_POST['edit']))   $MODE = "edit";   // Edit data
+if (!empty($_POST['notify'])) $MODE = "notify"; // Switch off notification
+
+switch ($MODE)
+{
+case "show": // Show his data
+       if (EXT_IS_ACTIVE("country", true))
+       {
+               // New way                         0        1         2          3         4     5     6        7           8            9       10      11           12           13
+               $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(UID_VALUE), __FILE__, __LINE__);
+       }
+        else
+       {
+               // Old way                         0        1         2        3      4     5     6        7           8            9       10      11           12           13
+               $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(UID_VALUE), __FILE__, __LINE__);
+       }
+       $DATA = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Translate / add some things
+       $DATA[10] = TRANSLATE_GENDER($DATA[10]);
+       $DATA[13] = MAKE_DATETIME($DATA[13], "0");
+
+       // How far is last change on his profile away from now?
+       if ((($DATA[13] + $_CONFIG['profile_lock']) > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0))
+       {
+               // You cannot change your account
+               define('CHANGE', "<FONT class=\"member_failed\">".MEMBER_PROFILE_LOCKED_1.MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0").MEMBER_PROFILE_LOCKED_2."</FONT>");
+       }
+        else
+       {
+               // He is allowed to change his profile
+               define('CHANGE', LOAD_TEMPLATE("member_mydata_button", true));
+       }
+       if (strlen($DATA[7]) == 1) $DATA[7] = "0".$DATA[7];
+       if (strlen($DATA[8]) == 1) $DATA[8] = "0".$DATA[8];
+       switch (GET_LANGUAGE())
+       {
+               case "de": define('DOB', $DATA[7].".".$DATA[8].".".$DATA[9]); break;
+               default  : define('DOB', $DATA[8]."-".$DATA[7]."-".$DATA[9]); break;
+       }
+
+       if (EXT_IS_ACTIVE("country"))
+       {
+               // Load country's description and code
+               $DATA[3] = COUNTRY_GENERATE_INFO($DATA[3]);
+       }
+
+       // Load template
+       LOAD_TEMPLATE("member_mydata_overview");
+       break;
+
+case "edit": // Edit data
+       if (EXT_IS_ACTIVE("country", true)) {
+               // New way                         0        1         2          3         4     5     6        7           8            9       10      11           12           13
+               $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
+FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(UID_VALUE), __FILE__, __LINE__);
+       } else {
+               // Old way                         0        1         2        3      4     5     6        7           8            9       10      11           12           13
+               $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
+FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array(UID_VALUE), __FILE__, __LINE__);
+       }
+
+       $DATA = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+       $DATA[13] = $DATA[12] + $_CONFIG['profile_lock'];
+
+       // How far is last change on his profile away from now?
+       if (($DATA[13] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0))
+       {
+               $DATA[13] = MAKE_DATETIME($DATA[13] + $_CONFIG['profile_lock'], "0");
+               // You cannot change your account
+               LOAD_TEMPLATE("member_mydata_locked");
+       }
+        else
+       {
+               // He is allowed to change his profile
+               switch ($DATA[10])
+               {
+               case "M":
+                       define('M_DEFAULT', " selected=\"selected\"");
+                       define('F_DEFAULT', "");
+                       define('C_DEFAULT', "");
+                       break;
+
+               case "F":
+                       define('M_DEFAULT', "");
+                       define('F_DEFAULT', " selected=\"selected\"");
+                       define('C_DEFAULT', "");
+                       break;
+
+               case "C":
+                       define('M_DEFAULT', "");
+                       define('F_DEFAULT', "");
+                       define('C_DEFAULT', " selected=\"selected\"");
+                       break;
+               }
+               $DOB = "";
+               switch (GET_LANGUAGE())
+               {
+               case "de": // German date format
+                       // Day
+                       $DOB .= ADD_SELECTION("day", $DATA[7]);
+
+                       // Month
+                       $DOB .= ADD_SELECTION("month", $DATA[8]);
+
+                       // Year
+                       $DOB .= ADD_SELECTION("year", $DATA[9]);
+                       break;
+
+               default: // Default is the US date format... :)
+                       break;
+               }
+               define('DOB', $DOB);
+               define('MAX_REC_LIST', ADD_MAX_RECEIVE_LIST("member", $DATA[11], true));
+
+               if (EXT_IS_ACTIVE("country"))
+               {
+                       // Generate selection box
+                       $OUT  = "<SELECT name=\"country_code\" class=\"member_select\" size=\"1\">\n";
+                       $whereStatement = "WHERE is_active='Y'";
+                       if (IS_ADMIN()) $whereStatement = "";
+                       $OUT .= ADD_OPTION_LINES("countries", "id", "descr", $DATA[3], "code", $whereStatement);
+                       $OUT .= "</SELECT>";
+                       define('__COUNTRY_CONTENT', $OUT);
+               }
+                else
+               {
+                       // Ouput default input box
+                       define('__COUNTRY_CONTENT', "<INPUT type=\"text\" name=\"cntry\" class=\"member_normal\" size=\"2\" maxlength=\"3\" value=\"".$DATA[3]."\">");
+               }
+
+               // Load template
+               LOAD_TEMPLATE("member_mydata_edit");
+       }
+       break;
+
+case "save": // Save entered data
+       // Load old email / password:      0        1          2
+       $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array(UID_VALUE), __FILE__, __LINE__);
+       $DATA = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+       $DATA[3] = $DATA[2] + $_CONFIG['profile_lock'];
+
+       // How far is last change on his profile away from now?
+       if (($DATA[3] > time()) && (!IS_ADMIN()) && ($_CONFIG['profile_lock'] > 0))
+       {
+               $DATA[3] = MAKE_DATETIME($DATA[3] + $_CONFIG['profile_lock'], "0");
+               // You cannot change your account
+               LOAD_TEMPLATE("member_mydata_locked");
+       }
+        elseif (!VALIDATE_EMAIL($_POST['addy']))
+       {
+               // Invalid email address!
+               LOAD_TEMPLATE("admin_settings_saved", false, INVALID_EMAIL_ADDRESS_ENTERED);
+       }
+        else
+       {
+               // Secure every submitted variable
+               foreach ($_POST as $key => $value)
+               {
+                       $_POST[$key] = addslashes($value);
+               }
+
+               $hash = generateHash($_POST['pass1'], substr($DATA[1], 0, -40));
+               if ((($hash == $DATA[1]) || ($_POST['pass1'] == $_POST['pass2'])) && (!empty($_POST['pass1'])))
+               {
+                       // Only on simple changes normal mode is active = no email or password changed
+                       $MODE = "normal"; $AND = "";
+
+                       // Did the user changed the password?
+                       if ($hash != $DATA[1]) { $AND = ", password='".$hash."'"; $MODE = "pass"; }
+
+                       // Or did he changed his password?
+                       if ($_POST['addy'] != $DATA[0])
+                       {
+                               // Jupp
+                               if ($MODE == "normal") { $MODE = "email"; } else { $MODE .= ";email"; }
+                               $_POST['old_addy'] = $DATA[0];
+                       }
+
+                       // Update member's profile
+                       if (EXT_IS_ACTIVE("country"))
+                       {
+                               // New way
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET
+gender='%s', surname='%s', family='%s',
+street_nr='%s',
+country_code=%s, zip=%s, city='%s',
+email='%s',
+birth_day=%s, birth_month=%s, birth_year=%s,
+max_mails=%s,
+last_update=UNIX_TIMESTAMP()".$AND.",
+notified='N',
+last_profile_sent=UNIX_TIMESTAMP()
+WHERE userid=%s AND password='%s' LIMIT 1",
+array(
+       $_POST['gender'],
+       $_POST['surname'],
+       $_POST['family_name'],
+       $_POST['street_nr'],
+       bigintval($_POST['country_code']),
+       bigintval($_POST['zip']),
+       $_POST['city'],
+       $_POST['addy'],
+       bigintval($_POST['day']),
+       bigintval($_POST['month']),
+       bigintval($_POST['year']),
+       bigintval($_POST['max_mails']),
+       UID_VALUE,
+       get_session('u_hash')
+ ), __FILE__, __LINE__);
+                       }
+                        else
+                       {
+                               // Old way
+                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET
+gender='%s', surname='%s', family='%s',
+street_nr='%s',
+country='%s', zip=%s, city='%s',
+email='%s',
+birth_day=%s, birth_month=%s, birth_year=%s,
+max_mails='%s',
+last_update=UNIX_TIMESTAMP()".$AND.",
+notified='N',
+last_profile_sent=UNIX_TIMESTAMP()
+WHERE userid=%s AND password='%s' LIMIT 1",
+array(
+       $_POST['gender'],
+       $_POST['surname'],
+       $_POST['family_name'],
+       $_POST['street_nr'],
+       $_POST['cntry'],
+       bigintval($_POST['zip']),
+       $_POST['city'],
+       $_POST['addy'],
+       bigintval($_POST['day']),
+       bigintval($_POST['month']),
+       bigintval($_POST['year']),
+       bigintval($_POST['max_mails']),
+       UID_VALUE,
+       get_session('u_hash')
+ ), __FILE__, __LINE__);
+                       }
+
+                       // Get all modes ...
+                       $modes = explode(";", $MODE);
+
+                       // ... and run them through
+                       SEND_MODE_MAILS ("mydata", $modes);
+               }
+                else
+               {
+                       // Entered wrong pass for updating profile
+                       LOAD_TEMPLATE("admin_settings_saved", false, MEBER_UPDATE_PWD_WRONG);
+               }
+       }
+       break;
+
+case "notify": // Switch off notfication
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       $URL = URL."/modules.php?module=login&amp;what=welcome&msg=".urlencode(PROFILE_UPDATED);
+       break;
+}
+
+if (!empty($URL)) {
+       // Load generated URL
+       LOAD_URL($URL);
+}
+
+//
+?>
diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php
new file mode 100644 (file)
index 0000000..04cb457
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/12/2004 *
+ * ================                             Last change: 01/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-                                            *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("newsletter")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load status
+$result = SQL_QUERY_ESC("SELECT nl_receive, nl_until, nl_timespan FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+list($status, $until, $span) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// Remember charge value
+define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['nl_charge']));
+
+if ((isset($_POST['ok'])) && ($status == "Y") && ($span == "0"))
+{
+       // Save request
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_timespan='".($_CONFIG['one_day'] * 30)."' WHERE userid=%s LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Load admin message
+       $admin_msg = LOAD_EMAIL_TEMPLATE("admin_newsletter_request", array(), $GLOBALS['userid']);
+
+       // Add task
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, status, task_type, subject, text, task_created, userid)
+VALUES ('0','NEW','NL_UNSUBSCRIBE','".ADMIN_NL_SUBJECT."','".addslashes($admin_msg)."', UNIX_TIMESTAMP(),'%s')", array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Send mail to member
+       $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_request", array(), $GLOBALS['userid']);
+       SEND_EMAIL($GLOBALS['userid'], NL_MEMBER_SUBJECT, $msg);
+
+       // Send mail to all admins
+       SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_request", array(), $GLOBALS['userid']);
+
+       // Display message
+       LOAD_TEMPLATE("admin_settings_saved", false, NL_MEMBER_REQUEST_DONE);
+}
+ elseif ($span > 0)
+{
+       // Already ordered
+       LOAD_TEMPLATE("admin_settings_saved", false, NL_MEMBER_REQUEST_ALREADY);
+}
+ else
+{
+       // Load template for the note
+       define('NL_MEMBER_NOTE', LOAD_TEMPLATE("member_newsletter_note", true));
+
+       // Set status message and submit button
+       switch ($status)
+       {
+       case 'Y': // Receives the newsletter
+               define('__STATUS_VALUE', NL_MEMBER_ON);
+               define('__UNTIL_VALUE', "");
+               define('NL_SUBMIT', NL_MEMBER_SUBMIT_OFF);
+               break;
+
+       case 'N': // Does not receive the newsletter
+               define('__STATUS_VALUE', NL_MEMBER_OFF);
+               define('__UNTIL_VALUE', MAKE_DATETIME($until, "2"));
+               define('NL_SUBMIT', NL_MEMBER_SUBMIT_ON);
+               break;
+       }
+
+       // Load template and member settings
+       LOAD_TEMPLATE("member_newsletter");
+}
+//
+?>
+
diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php
new file mode 100644 (file)
index 0000000..2ddb9a9
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/19/2004 *
+ * ================                             Last change: 07/24/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-nickname.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Nickname instead of the ID                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Nickname anstelle der ID                         *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("nickname")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "nickname");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+$VALID = false;
+
+if (isset($_POST['ok']))
+{
+       // Nickname was submitted so let's check if it is not already in use
+       if (!empty($_POST['nickname']))
+       {
+               // Check if nickname is valid
+               $PATTERN = "[".__NICKNAME_PATTERN."]{".__NICKNAME_LENGTH.",}";
+               if (ereg($PATTERN, $_POST['nickname'], $array))
+               {
+                       // Entered nickname is valid?
+                       if ($array[0] == $_POST['nickname']) $VALID = true;
+               }
+       }
+}
+
+if ($VALID)
+{
+       // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !
+       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' AND userid != '%s' LIMIT 1",
+        array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Nickname not in use, so set it now
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nickname='%s' WHERE userid=%s LIMIT 1",
+                array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
+               $content = NICKNAME_SAVED;
+       }
+        else
+       {
+               // Free result
+               SQL_FREERESULT($result);
+
+               // Nickname already in use!
+               $content = NICKNAME_ALREADY_IN_USE;
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+}
+ else
+{
+       // Load current nickname
+       define('__NICKNAME', NICKNAME_GET_NICK($GLOBALS['userid']));
+
+       // Do we have already submit the form?
+       if (!empty($_POST['nickname']))
+       {
+               OUTPUT_HTML("<STRONG class=\"member_failed\">".NICKNAME_IS_INVALID."</STRONG><P></P>");
+       }
+
+       // Load Template
+       LOAD_TEMPLATE("member_nickname_form");
+}
+//
+?>
diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php
new file mode 100644 (file)
index 0000000..a85be7e
--- /dev/null
@@ -0,0 +1,810 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 08/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-order.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Order mails here                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Hier koennen Ihre Mitglieder Mails buchen        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("order")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+$URL = ""; $id = 0;
+$whereStatement = " WHERE visible='Y'";
+
+// Set undefined array elements
+if (empty($_GET['msg']))       $_GET['msg']       = "";
+if (empty($_POST['zip']))      $_POST['zip']      = "";
+if (empty($_POST['html']))     $_POST['html']     = "";
+if (empty($_POST['receiver'])) $_POST['receiver'] = "";
+if (is_admin()) $whereStatement = "";
+
+// Add slashes to every value
+foreach($_POST as $key => $value)
+{
+       // Skip submit buttons
+       if (($key != "data") && ($key != "frametester")) $_POST[$key] = addslashes($value);
+}
+
+// Minimum mails / order
+define('__MIN_VALUE', $_CONFIG['order_min']);
+
+// Count unconfirmed mails
+$result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+$links = SQL_NUMROWS($result_links);
+SQL_FREERESULT($result_links);
+
+// Does the user has more than 0 mails per day set?
+$HOLIDAY="userid";
+if (GET_EXT_VERSION("holiday") >= "0.1.3")
+{
+       // Fetch also holiday activation data
+       $HOLIDAY = "holiday_active";
+}
+
+$result_mmails = SQL_QUERY_ESC("SELECT userid, receive_mails, mail_orders, ".$HOLIDAY."
+FROM "._MYSQL_PREFIX."_user_data
+WHERE userid=%s AND max_mails > 0 LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+$mmails = SQL_NUMROWS($result_mmails);
+list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails);
+SQL_FREERESULT($result_mmails);
+if ($HOLIDAY == $DMY) $HOLIDAY='N';
+
+$ALLOWED = $MAXI - $ORDERS;
+if ($_CONFIG['order_max_full'] == "MAX") $ALLOWED = $MAXI;
+
+// Check HTML extension
+$HTML_EXT = EXT_IS_ACTIVE("html_mail");
+
+// Now check his points amount
+$result_p = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+$TOTAL = 0;
+if (SQL_NUMROWS($result_p) > 0)
+{
+       // Load points
+       list($TOTAL) = SQL_FETCHROW($result_p);
+       SQL_FREERESULT($result_p);
+
+       // And subtract his used points...
+       $TOTAL -= GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+       // Add (maybe) missing three zeros
+       if (!ereg(".", $TOTAL)) $TOTAL .= ".00000";
+}
+
+if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3"))
+{
+       // Holiday is active!
+       SQL_FREERESULT($result_p);
+       LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_ORDER_NOT_POSSIBLE);
+}
+ elseif ((!empty($_POST['frametester'])) && ($ALLOWED > 0) && ($_POST['receiver'] > 0))
+{
+       // Continue with the frametester, we first need to store the data temporary in the pool
+       //
+       // First we would like to store the data and get it's pool position back...
+       $result = SQL_QUERY_ESC("SELECT id, data_type
+FROM "._MYSQL_PREFIX."_pool
+WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
+        array($GLOBALS['userid'], $_POST['url'], $_CONFIG['url_tlock']), __FILE__, __LINE__);
+
+       $type = "TEMP"; $id = 0;
+       if (SQL_NUMROWS($result) == 1)
+       {
+               list($id, $type) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+       }
+       if ($type == "TEMP")
+       {
+               // No entry found, so we need to check out the stats table as well... :)
+               // We have to add that suff here, now we continue WITHOUT checking and check the text and subject against some filters
+               $URL = "";
+               if ($_CONFIG['test_text'] == "Y")
+               {
+                       // Test submitted text against some filters (length, URLs in text etc.)
+                       if ((strpos(strtolower($_POST['text']), "https://") > -1) || (strpos(strtolower($_POST['text']), "http://") > -1) || (strpos(strtolower($_POST['text']), "www") > -1))
+                       {
+                               // URL found!
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_URL_FOUND;
+                       }
+                       $TEST = str_replace("\n", "", str_replace("\r", "", addslashes($_POST['text'])));
+                       if (strlen($TEST) > $_CONFIG['max_tlength'])
+                       {
+                               // Text is too long!
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_OVERLENGTH;
+                       }
+               }
+               // Shall I test the subject line against URLs?
+               if ($_CONFIG['test_subj'] == "Y")
+               {
+                       // Check the subject line for issues
+                       $_POST['subject'] = str_replace("\\", "[nl]", substr($_POST['subject'], 0, 200));
+                       if ((strpos(strtolower($_POST['subject']), "http://") > -1) || (strpos(strtolower($_POST['subject']), "www") > -1))
+                       {
+                               // URL in subject found
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_SUBJ_URL;
+                       }
+               }
+               // And shall I check that his URL is not in the black list?
+               if ($_CONFIG['url_blacklist'] == "Y")
+               {
+                       // Ok, I do that for you know...
+                       $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_url_blist WHERE url='%s' LIMIT 1",
+                        array($_POST['url']), __FILE__, __LINE__);
+
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Jupp, we got one listed
+                               list($blist) = SQL_FETCHROW($result);
+                               SQL_FREERESULT($result);
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_BLIST_URL."&blist=".$blist;
+                       }
+               }
+               if (($_POST['receiver'] < $_CONFIG['order_min']) && (!IS_ADMIN()))
+               {
+                       // Less than allowed receivers entered!
+                       $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_MORE_RECEIVERS3;
+               }
+
+               // Validate URL
+               if (!VALIDATE_URL($_POST['url']))
+               {
+                       // URL is invalid!
+                       $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_INVALID_URL;
+               }
+
+               // Probe for HTML extension
+               if ($HTML_EXT)
+               {
+                       if ($_POST['html'] == "Y")
+                       {
+                               // Chek for valid HTML tags
+                               $_POST['text'] = HTML_CHECK_TAGS($_POST['text']);
+
+                               // Maybe invalid tags found?
+                               if (empty($_POST['text'])) $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_INVALID_TAGS."&id=".$id;
+                       }
+                        else
+                       {
+                               // Remove any HTML code
+                               $_POST['text'] = str_replace("<", "{OPEN_HTML}", str_replace(">", "{CLOSE_HTML}", $_POST['text']));
+                       }
+               }
+       }
+        elseif (!IS_ADMIN())
+       {
+               // He has already sent a mail within a specific time
+               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_URL_TLOCK."&id=".$id;
+       }
+       if (empty($URL))
+       {
+               // Check if category and number of receivers is okay
+               $ADD = "";
+               if (($_CONFIG['order_multi_page'] == "Y") && (!empty($_POST['zip']))) $ADD = "AND d.zip LIKE '".bigintval($_POST['zip'])."{PER}'";
+
+               // Check for userids
+               $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM "._MYSQL_PREFIX."_user_cats AS c
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON c.userid=d.userid
+WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0
+".$ADD."
+ORDER BY d.%s %s",
+ array(
+       bigintval($_POST['cat']),
+       $GLOBALS['userid'],
+       $_CONFIG['order_select'],
+       $_CONFIG['order_mode'],
+ ), __FILE__, __LINE__);
+
+               // Do we enougth receivers left?
+               if (SQL_NUMROWS($result) >= $_POST['receiver'])
+               {
+                       // Check for holiday extensions
+                       $HOLIDAY = false;
+                       if (GET_EXT_VERSION("holiday") >= "0.1.3")
+                       {
+                               // Include checking for users in holiday
+                               $HOLIDAY = true;
+                       }
+
+                       // Load receivers from database
+                       $TEST = array(); $cnt = 0;
+                       while (list($REC) = SQL_FETCHROW($result))
+                       {
+                               if ($HOLIDAY)
+                               {
+                                       // Check for his holiday status
+                                       $result_holiday = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1",
+ array(bigintval($REC)), __FILE__, __LINE__);
+                                       if (SQL_NUMROWS($result_holiday) == 1) $REC = 0; // Exclude user who are in holiday
+
+                                       // Free memory
+                                       SQL_FREERESULT($result_holiday);
+                               }
+
+                               if ($REC > 0)
+                               {
+                                       // Add receiver
+                                       $TEST[] = $REC;
+                                       $cnt++;
+                               }
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+
+                       // Implode array into string for the sending pool
+                       $RECEIVER = implode($TEST, ";");
+
+                       // Count array for maximum sent
+                       $MAX_SEND = count($TEST);
+
+                       // Update receiver list
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET receive_mails=receive_mails-1 WHERE userid IN (%s) LIMIT %s",
+                        array(str_replace(";", ", ", $RECEIVER), $MAX_SEND), __FILE__, __LINE__);
+
+                       // Is calculated max receivers larger than wanted receivers then reset it
+                       if ($MAX_SEND > $_POST['receiver']) $MAX_SEND = $_POST['receiver'];
+
+                       // Calculate used points
+                       $USED = $MAX_SEND * GET_PAY_POINTS(bigintval($_POST['type']));
+
+                       // Check if he has enougth points for this order and selected more than 0 receivers
+                       if (($USED > 0) && ($USED <= $TOTAL) && ($MAX_SEND > 0))
+                       {
+                               // Gettings points is okay, so we can add $USED later from
+                               $TIME = time();
+                               if (($id == "0") || ($type != "TEMP"))
+                               {
+                                       // New order
+                                       $id = 0;
+                                       if ($HTML_EXT)
+                                       {
+                                               // HTML extension is active
+                                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_pool (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip, html_msg)
+ VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s','%s')",
+array(
+       $GLOBALS['userid'],
+       addslashes($_POST['subject']),
+       addslashes($_POST['text']),
+       $RECEIVER,
+       bigintval($_POST['type']),
+       $TIME,
+       $_POST['url'],
+       bigintval($_POST['cat']),
+       $MAX_SEND,
+       bigintval($_POST['zip']),
+       $_POST['html']
+), __FILE__, __LINE__);
+                                       }
+                                        else
+                                       {
+                                               // No HTML extension is active
+                                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_pool (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip)
+ VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s')",
+array(
+       $GLOBALS['userid'],
+       addslashes($_POST['subject']),
+       addslashes($_POST['text']),
+       $RECEIVER,
+       bigintval($_POST['type']),
+       $TIME,
+       $_POST['url'],
+       bigintval($_POST['cat']),
+       $MAX_SEND,
+       bigintval($_POST['zip']),
+), __FILE__, __LINE__);
+                                       }
+                               }
+                                else
+                               {
+                                       // Change current order
+                                       if ($HTML_EXT)
+                                       {
+                                               // HTML extension is active
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET
+subject='%s',
+text='%s',
+receivers='%s',
+payment_id=%s,
+timestamp=UNIX_TIMESTAMP(),
+url='%s',
+cat_id=%s,
+target_send=%s,
+zip=%s,
+html_msg='%s'
+WHERE id=%s LIMIT 1",
+array(
+       $_POST['subject'],
+       $_POST['text'],
+       $RECEIVER,
+       bigintval($_POST['type']),
+       $_POST['url'],
+       bigintval($_POST['cat']),
+       $MAX_SEND,
+       bigintval($_POST['zip']),
+       $_POST['html'],
+       bigintval($id)
+), __FILE__, __LINE__);
+                                       }
+                                        else
+                                       {
+                                               // No HTML extension is active
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET
+subject='%s',
+text='%s',
+receivers='%s',
+payment_id=%s,
+timestamp=UNIX_TIMESTAMP(),
+url='%s',
+cat_id=%s,
+target_send=%s,
+zip=%s
+WHERE id=%s LIMIT 1",
+array(
+       $_POST['subject'],
+       $_POST['text'],
+       $RECEIVER,
+       bigintval($_POST['type']),
+       $_POST['url'],
+       bigintval($_POST['cat']),
+       $MAX_SEND,
+       bigintval($_POST['zip']),
+       bigintval($id)
+), __FILE__, __LINE__);
+                                       }
+                               }
+
+                               // Do we need to get the ID number?
+                               if ($id == 0) {
+                                       // Order is placed as temporary. We need to get it's id for the frametester
+                                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1",
+                                       array(
+                                               $GLOBALS['userid'],
+                                               $_POST['subject'],
+                                               bigintval($_POST['type']),
+                                               $TIME
+                                       ), __FILE__, __LINE__);
+
+                                       list($id) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+                               }
+
+                               // ID is received so we can redirect the user, used points will be added when he send's out the mail
+                               $URL = URL."/modules.php?module=frametester&amp;order=".$id."";
+                       }
+                        elseif ($MAX_SEND == 0)
+                       {
+                               // Not enougth receivers found which can receive mails
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_MORE_RECEIVERS2;
+                       }
+                        else
+                       {
+                               // No enougth points left!
+                               $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_MORE_POINTS;
+                       }
+               }
+                else
+               {
+                       // Ordered more mails than he can send in this category
+                       $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_NO_RECS_LEFT;
+               }
+       }
+}
+ elseif ($_POST['receiver'] == "0")
+{
+       // Not enougth receivers selected
+       $URL = URL."/modules.php?module=login&amp;what=order&amp;msg=".CODE_MORE_RECEIVERS1;
+}
+ elseif (($ALLOWED == 0) && ($_CONFIG['order_max_full'] == "ORDER"))
+{
+       // No more mail orders allowed
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_ORDER_ALLOWED_EXHAUSTED);
+}
+ elseif (($links < $_CONFIG['unconfirmed']) && ($mmails == "1"))
+{
+       // Display order form
+       $result_cats = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_cats) > 0)
+       {
+               if ($TOTAL > 0)
+               {
+                       // Initialize array...
+                       $CATS = array(
+                               'id'   => array(),
+                               'name' => array(),
+                               'uids' => array()
+                       );
+
+                       // Enable HTML checking
+                       $HTML = ""; $HOLIDAY = false; $HOL_STRING = "";
+                       if (($HTML_EXT) && ($_POST['html'] == "Y")) $HTML = " AND html='Y'";
+                       if (GET_EXT_VERSION("holiday") >= "0.1.3")
+                       {
+                               // Extension's version is fine
+                               $HOLIDAY = true; $HOL_STRING = " AND holiday_active='N'";
+                       }
+
+                       // ... and begin loading stuff
+                       while (list($id, $cat) = SQL_FETCHROW($result_cats))
+                       {
+                               $CATS['id'][]   = bigintval($id);
+                               $CATS['name'][] = $cat;
+
+                               // Select users in current category
+                               $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s AND userid != '%s' ORDER BY userid",
+                                array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__);
+
+                               $uid_cnt = 0;
+                               while (list($ucat) = SQL_FETCHROW($result_uids))
+                               {
+                                       // Check for holiday system
+                                       $HOL_ACTIVE = false;
+                                       if ($HOLIDAY)
+                                       {
+                                               // Check user's holiday status
+                                               $result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM "._MYSQL_PREFIX."_user_data AS d
+LEFT JOIN "._MYSQL_PREFIX."_user_holidays AS h
+ON d.userid=h.userid
+WHERE d.userid=%s AND d.receive_mails > 0 AND d.status='CONFIRMED' AND d.holiday_active='Y'
+AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
+LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
+                                               if (SQL_NUMROWS($result_holiday) == 1)
+                                               {
+                                                       // Holiday is active!
+                                                       $HOL_ACTIVE = true;
+                                               }
+
+                                               // Free memory
+                                               SQL_FREERESULT($result_holiday);
+                                       }
+
+                                       if (!$HOL_ACTIVE)
+                                       {
+                                               // Check if the user want's to receive mails?
+                                               $result_ver = SQL_QUERY_ESC("SELECT zip FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1",
+                                                array(bigintval($ucat)), __FILE__, __LINE__);
+
+                                               if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && ($_CONFIG['order_multi_page'] == "Y"))
+                                               {
+                                                       list($zip) = SQL_FETCHROW($result_ver);
+                                                       SQL_FREERESULT($result_ver);
+                                                       if (substr($zip, 0, strlen($_POST['zip'])) == $_POST['zip'])
+                                                       {
+                                                               // Ok, ZIP part is found
+                                                               $uid_cnt++;
+                                                       }
+                                               }
+                                                else
+                                               {
+                                                       // Count numbers up!
+                                                       $uid_cnt += SQL_NUMROWS($result_ver);
+                                               }
+                                       }
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result_uids);
+                               $CATS['uids'][] = $uid_cnt;
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result_cats);
+
+                       // Now we need to load the mail types...
+                       $result = SQL_QUERY("SELECT id, price, payment, mail_title FROM "._MYSQL_PREFIX."_payments ORDER BY payment", __FILE__, __LINE__);
+
+                       $typeS = array();
+                       if (SQL_NUMROWS($result) > 0)
+                       {
+                               // Check for message ID in URL
+                               $MSG = "";
+                               switch ($_GET['msg'])
+                               {
+                               case CODE_URL_TLOCK:
+                                       $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                                        array(bigintval($_GET['id'])), __FILE__, __LINE__);
+
+                                       // Load timestamp from last order
+                                       list($LORDER) = SQL_FETCHROW($result);
+                                       $LORDER = MAKE_DATETIME($LORDER, "1");
+
+                                       // Free memory
+                                       SQL_FREERESULT($result);
+
+                                       // Calculate hours...
+                                       $STD = round($_CONFIG['url_tlock'] / 60 / 60);
+
+                                       // Minutes...
+                                       $MIN = round(($_CONFIG['url_tlock'] - $STD * 60 * 60) / 60);
+
+                                       // And seconds
+                                       $SEC = $_CONFIG['url_tlock'] - $STD * 60 * 60 - $MIN * 60;
+
+                                       // Finally contruct the message
+                                       $MSG = MEMBER_URL_TIME_LOCK."<br />".CONFIG_URL_TLOCK." ".$STD." ".
+                                               _HOURS.", ".$MIN." "._MINUTES." "._AND." ".$SEC." "._SECONDS."<br />".
+                                               MEMBER_LAST_TLOCK.": ".$LORDER;
+                                       break;
+
+                               case CODE_OVERLENGTH:
+                                       $MSG = MEMBER_TEXT_OVERLENGTH;
+                                       break;
+
+                               case CODE_URL_FOUND:
+                                       $MSG = MEMBER_TEXT_CONTAINS_URL;
+                                       break;
+
+                               case CODE_SUBJ_URL:
+                                       $MSG = MEMBER_SUBJ_CONTAINS_URL;
+                                       break;
+
+                               case CODE_BLIST_URL:
+                                       $MSG = MEMBER_URL_BLACK_LISTED."<br />
+".MEMBER_BLIST_TIME.": ".MAKE_DATETIME($_GET['blist'], "0");
+                                       break;
+
+                               case CODE_NO_RECS_LEFT:
+                                       $MSG = MEMBER_SELECTED_MORE_RECS;
+                                       break;
+
+                               case CODE_INVALID_TAGS:
+                                       $MSG = MEMBER_HTML_INVALID_TAGS;
+                                       break;
+
+                               case CODE_MORE_POINTS:
+                                       $MSG = MEMBER_MORE_POINTS_NEEDED;
+                                       break;
+
+                               case CODE_MORE_RECEIVERS1:
+                                       $MSG = MEMBER_ENTER_MORE_RECEIVERS;
+                                       break;
+
+                               case CODE_MORE_RECEIVERS2:
+                                       $MSG = MEMBER_NO_MORE_RECEIVERS_FOUND;
+                                       break;
+
+                               case CODE_MORE_RECEIVERS3:
+                                       $MSG = MEMBER_ENTER_MORE_MIN_RECEIVERS_1.$_CONFIG['order_min'].MEMBER_ENTER_MORE_MIN_RECEIVERS_2;
+                                       break;
+
+                               case CODE_INVALID_URL:
+                                       $MSG = MEMBER_ENTER_INVALID_URL;
+                                       break;
+
+                               case "": // When no error code is included in the URL we do not need to output an error message as well...
+                                       break;
+
+                               default:
+                                       $MSG = UNKNOWN_CODE_1.$_GET['msg'].UNKNOWN_CODE_2;
+                                       break;
+                               }
+                               if (!empty($MSG))
+                               {
+                                       // We got system message so we drop it out to the user
+                                       LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
+                               }
+
+                               // Load all email types...
+                               while ($typeS[] = SQL_FETCHROW($result))
+                               {
+                                       // Nothing to do here... ;-)
+                               }
+
+                               // Free memory
+                               SQL_FREERESULT($result);
+
+                               // Output user's points
+                               $TOTAL = TRANSLATE_COMMA($TOTAL);
+
+                               // Check how many mail orders he has placed today and how many he's allowed to send
+                               switch ($_CONFIG['order_max_full'])
+                               {
+                               case "MAX": // He is allowed to send as much as possible
+                                       define('ORDER_MAX_VALUE', ORDER_ALLOED_MAX);
+                                       break;
+
+                               case "ORDER": // He is allowed to send as much as he setup the receiving value
+                                       define('ORDER_MAX_VALUE', ORDER_ALLOWED_RECEIVE_1.$ALLOWED.ORDER_ALLOWED_RECEIVE_2.$MAXI.ORDER_ALLOWED_RECEIVE_3);
+                                       break;
+                               }
+
+                               // Load final template
+                               LOAD_TEMPLATE("member_order_points", false, $TOTAL);
+
+                               // Reset variables
+                               $OLD_ORDER = false; $subject = ""; $text = ""; $target = "";
+
+                               // Check if we already have an order placed and make it editable
+                               $result = SQL_QUERY_ESC("SELECT subject, text, payment_id, timestamp, url, target_send, cat_id, zip FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND data_type='TEMP' LIMIT 1",
+                                array($GLOBALS['userid']), __FILE__, __LINE__);
+
+                               if (SQL_NUMROWS($result) == 1)
+                               {
+                                       // Old order found
+                                       list($subject, $text, $payment, $tstamp, $url, $target, $cat, $zip) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+
+                                       // Fix max receivers when it is too much
+                                       if ($target > $CATS['uids'][$cat]) $target = $CATS['uids'][$cat];
+
+                                       // Old order is grabbed
+                                       $OLD_ORDER = true;
+                               }
+                                else
+                               {
+                                       // Default output for that your members don't forget it...
+                                       $url = "http://";
+                               }
+
+                               // 01      2                       21    12                             2    23         443    3          3210
+                               if ((!empty($_POST['data'])) || (($_CONFIG['order_multi_page'] == "N") && ((!IS_ADMIN()) && (!$HTML_EXT))))
+                               {
+                                       // Pre-output categories
+                                       $CAT = "";
+                                       foreach ($CATS['id'] as $key => $value)
+                                       {
+                                               $CAT .= "      <OPTION value=\"".$value."\"";
+                                               if (($OLD_ORDER) && ($cat == $value)) $CAT .= " selected=\"selected\"";
+                                               $CAT .= ">".$CATS['name'][$key]." (".$CATS['uids'][$key]." ".USER_IN_CAT.")</OPTION>\n";
+                                       }
+                                       // Mail type
+                                       $type = "";
+                                       foreach ($typeS as $key => $value)
+                                       {
+                                               $P = TRANSLATE_COMMA($typeS[$key][1]);
+                                               if (is_array($value))
+                                               {
+                                                       // Output option line
+                                                       $type .= "      <OPTION value=\"".$typeS[$key][0]."\"";
+                                                       if (($OLD_ORDER) && ($payment == $typeS[$key][0])) $type .= " selected=\"selected\"";
+                                                       $type .= ">".$P." ".PER_MAIL." - ".$typeS[$key][3]." - ".round($typeS[$key][2])." ".PAYMENT."</OPTION>\n";
+                                               }
+                                       }
+
+                                       // Put all in constants for the template
+                                       define('CATEGORY_SELECTION', $CAT);
+                                       define('TYPE_SELECTION', $type);
+                                       define('TARGET', $target);
+                                       define('SUBJECT', $subject);
+                                       define('TEXT', COMPILE_CODE($text));
+                                       define('T_URL', $url);
+
+                                       if (!empty($_POST['zip']))
+                                       {
+                                               // Output entered ZIP code
+                                               define('ZIP_OUTPUT', LOAD_TEMPLATE("member_order-zip2", true, $_POST['zip']));
+                                       }
+                                        else
+                                       {
+                                               define('ZIP_OUTPUT', "<TR><TD colspan=\"5\" height=\"5\" class=\"seperator\">&nbsp;</TD></TR>");
+                                       }
+                                       // HTML extension
+                                       if (($HTML_EXT) && ($_POST['html'] == "Y"))
+                                       {
+                                               // Extension is active so output valid HTML tags
+                                               define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_ext", true, HTML_ADD_VALID_TAGS()));
+                                       }
+                                        else
+                                       {
+                                               // Extension not active and/or class not uploaded
+                                               define('MEMBER_HTML_EXTENSION', "<TR><TD colspan=\"5\"><INPUT type=\"hidden\" name=\"html\" value=\"N\"></TD></TR>");
+                                       }
+
+                                       // Output form for page 2
+                                       LOAD_TEMPLATE("member_order_page2");
+                               }
+                                else
+                               {
+                                       // Remember maybe entered ZIP code in constant
+                                       $ADD = "";
+                                       if ($HTML_EXT)
+                                       {
+                                               // Add some content when html extension is active
+                                               if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN())) $ADD = "<TR><TD colspan=\"2\" class=\"seperator bottom2\" height=\"5\">&nbsp;</TD></TR>\n";
+                                               define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_intro", true));
+                                       }
+                                        else
+                                       {
+                                               // No HTML extension installed
+                                               define('MEMBER_HTML_EXTENSION', "<TR><TD colspan=\"2\"><INPUT type=\"hidden\" name=\"html\" value=\"N\"></TD></TR>");
+                                       }
+                                       // Do we want ZIP code or not?
+                                       if (($_CONFIG['order_multi_page'] == "Y") || (IS_ADMIN()))
+                                       {
+                                               // Yes
+                                               $content = array(
+                                                       'zip' => $_POST['zip'],
+                                                       'add' => $ADD
+                                               );
+                                               define('MEMBER_ZIP_CONTENT', LOAD_TEMPLATE("member_order-zip1", true, $content));
+                                       }
+                                        else
+                                       {
+                                               // No
+                                               define('MEMBER_ZIP_CONTENT', "");
+                                       }
+
+                                       // Output form for page 1 (ZIP code or HTML)
+                                       LOAD_TEMPLATE("member_order_page1");
+                               }
+                       }
+                        else
+                       {
+                               // No mail types defined
+                               OUTPUT_HTML("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_PAYMENTS."</SPAN></STRONG>");
+                       }
+               }
+                else
+               {
+                       // No points left!
+                       OUTPUT_HTML("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_POINTS."</SPAN></STRONG>");
+               }
+       }
+        else
+       {
+               // No cateogries are defined yet
+               OUTPUT_HTML("<STRONG><SPAN class=\"member_failed\">".MEMBER_NO_CATS."</SPAN></STRONG>");
+       }
+}
+ elseif ($mmails == "0")
+{
+       // Please set more than 0 mails per day!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_HAS_ZERO_MMAILS);
+}
+ else
+{
+       // Please confirm some mails first!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.$_CONFIG['unconfirmed'].MEMBER_LINKS_LEFT_3);
+}
+
+if (!empty($URL))
+{
+       // Redirect to requested URL
+       LOAD_URL($URL);
+}
+
+//
+?>
diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php
new file mode 100644 (file)
index 0000000..b49491e
--- /dev/null
@@ -0,0 +1,289 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/12/2004 *
+ * ================                             Last change: 12/01/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-payout.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Payout requests                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungsanfragen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       // Don't call this directly!
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // Not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("payout")) && (!IS_ADMIN())) {
+       // Extension "payout" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "payout");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+$result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
+$TPTS = 0;
+while (list($lvl, $per) = SQL_FETCHROW($result_depths))
+{
+       // Load referral points
+       $result_points = SQL_QUERY_ESC("SELECT points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1",
+        array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_points) == 1)
+       {
+               list($points) = SQL_FETCHROW($result_points);
+               SQL_FREERESULT($result_points);
+               $TPTS += $points;
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result_depths);
+
+// Get used points
+$USED = GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+// Translate point into comma
+$TPTS = TRANSLATE_COMMA($TPTS - $USED);
+
+// Sanity check...
+if (empty($TPTS)) $TPTS = "0.00000";
+
+if (empty($_GET['payout']))
+{
+       // Load payout types
+       $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points, allow_url
+FROM "._MYSQL_PREFIX."_payout_types
+WHERE %s >= min_points
+ORDER BY type", array(str_replace(",", ".", $TPTS)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Check for his payouts
+               $result_payouts = SQL_QUERY_ESC("SELECT DISTINCT p.id, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text AS alt, p.banner_url AS bannerm
+FROM "._MYSQL_PREFIX."_user_payouts AS p
+LEFT JOIN "._MYSQL_PREFIX."_payout_types AS t
+ON p.payout_id = t.id
+WHERE p.userid = %s
+ORDER BY p.payout_timestamp DESC",
+                array($GLOBALS['userid']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result_payouts) > 0)
+               {
+                       // List all his requests
+                       $SW = 2; $OUT = "";
+                       while (list($pid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result_payouts))
+                       {
+                               // Translate status
+                               $evl = "\$status = PAYOUT_MEMBER_STATUS_".strtoupper($status).";";
+                               eval($evl);
+                               $status = "<FONT class=\"member_failed\">".$status."</FONT>";
+
+                               // Nothing entered must be secured in member/what-payputs.php !
+                               if ($allow == "Y")
+                               {
+                                       // Banner/Textlink views/clicks request
+                                       if (!empty($banner))
+                                       {
+                                               // Banner
+                                               $account = "<IMG src=\"".$banner."\" alt=\"".$alt."\" title=\"".$alt."\" border=\"0\">";
+                                       }
+                                        else
+                                       {
+                                               // Textlink
+                                               $account = $alt;
+                                       }
+                                       $bank = "<A href=\"".DEREFERER($url)."\" target=\"_blank\">".CLICK_HERE."</A>";
+                               }
+                                else
+                               {
+                                       // e-currency payout request
+                                       if (empty($account)) $account = "---";
+                                       if (empty($bank))    $bank    = "---";
+                               }
+
+                               // Prepare data for the template
+                               $content = array(
+                                       'sw'     => $SW,
+                                       'acc'    => $account,
+                                       'points' => TRANSLATE_COMMA($total)." ".COMPILE_CODE($type),
+                                       'bank'   => $bank,
+                                       'stamp'  => MAKE_DATETIME($tstamp, "2"),
+                                       'status' => $status
+                               );
+                               // Load row template and switch colors
+                               $OUT .= LOAD_TEMPLATE("member_payout_row", true, $content);
+                               $SW = 3 - $SW;
+                       }
+
+                       // Remember rows in constant
+                       define('__PAYOUT_ROWS', $OUT);
+
+                       // Load template
+                       LOAD_TEMPLATE("member_payout");
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_payouts);
+
+               // Output payout list
+               PAYOUT_OUTPUT_PAYOUT_LIST($TPTS);
+       }
+}
+ else
+{
+       // Chedk if he can get paid by selected type
+       $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
+        array(bigintval($_GET['payout'])), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // ID is valid
+               list($type, $rate, $min, $allow) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Calculate maximum value
+               $max = round($TPTS * $rate - 0.5);
+
+               // Calulcate points from submitted amount
+               $PAYOUT = 0;
+               if (!empty($_POST['payout']))
+               {
+                       $PAYOUT  = bigintval($_POST['payout']) / $rate;
+                       $PAY_MAX = $max / $rate;
+               }
+
+               // Move variables into constants for templates
+               define('PAYOUT_MAX_VALUE' , $max);
+               define('PAYOUT_TYPE_VALUE', COMPILE_CODE($type));
+
+               if (str_replace(",", ".", $TPTS) >= $min)
+               {
+                       // Ok, he can get be paid
+                       if ((isset($_POST['ok'])) && ($PAYOUT <= $PAY_MAX) && ($PAYOUT >= $min))
+                       {
+                               // Calculate exact value
+                               define('PAYOUT_POINTS_VALUE', $PAYOUT);
+
+                               // Subtract points from member's account
+                               SUB_POINTS($GLOBALS['userid'], $PAYOUT);
+
+                               // Add entry to his tranfer history
+                               if ($allow == "Y")
+                               {
+                                       // Banner/textlink ordered
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_payouts (userid, payout_total, payout_id, payout_timestamp, status, target_url, link_text, banner_url)
+VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')",
+ array(
+       $GLOBALS['userid'],
+       bigintval($_POST['payout']),
+       bigintval($_GET['payout']),
+       $_POST['turl'],
+       $_POST['alt'],
+       $_POST['banner']
+), __FILE__, __LINE__);
+
+                                       // Load templates
+                                       $msg_mem = LOAD_EMAIL_TEMPLATE("member_payout_request_banner", array(), $GLOBALS['userid']);
+                                       if (GET_EXT_VERSION("admins") >= "0.4.1")
+                                       {
+                                               $adm_tpl = "admin_payout_request_banner";
+                                       }
+                                        else
+                                       {
+                                               $msg_adm = addslashes(LOAD_EMAIL_TEMPLATE("admin_payout_request_banner", array(), $GLOBALS['userid']));
+                                       }
+                               }
+                                else
+                               {
+                                       // e-currency payout requested
+                                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_payouts (userid, payout_total, target_account, target_bank, payout_id, payout_timestamp, status, password)
+VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
+ array(
+       $GLOBALS['userid'],
+       bigintval($_POST['payout']),
+       bigintval($_POST['account']),
+       $_POST['bank'],
+       bigintval($_GET['payout']),
+       $_POST['pass']
+), __FILE__, __LINE__);
+
+                                       // Load templates
+                                       $msg_mem = LOAD_EMAIL_TEMPLATE("member_payout_request", array(), $GLOBALS['userid']);
+                                       $msg_adm = addslashes(LOAD_EMAIL_TEMPLATE("admin_payout_request", array(), $GLOBALS['userid']));
+                                       $admin_tpl = "";
+                                       if (GET_EXT_VERSION("admins") >= "0.4.1")
+                                       {
+                                               $admin_tpl = "admin_payout_request";
+                                       }
+                               }
+
+                               // Generate task
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, status, task_type, subject, text, task_created, userid)
+VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] ".PAYOUT_REQUEST_ADMIN."','%s', UNIX_TIMESTAMP(), %s)",
+ array(
+       $msg_adm,
+       $GLOBALS['userid']
+), __FILE__, __LINE__);
+
+                               // Send out mails
+                               SEND_EMAIL($GLOBALS['userid'], PAYOUT_REQUEST_MEMBER, $msg_mem);
+
+                               // To admin(s)
+                               SEND_ADMIN_NOTIFICATION(PAYOUT_REQUEST_ADMIN, $admin_tpl, array(), $GLOBALS['userid']);
+
+                               // Load template and output it
+                               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_REQUEST_SENT);
+                       }
+                        elseif ($allow == "Y")
+                       {
+                               // Generate banner order form
+                               LOAD_TEMPLATE("member_payout_form_banner");
+                       }
+                        else
+                       {
+                               // Generate normal form
+                               LOAD_TEMPLATE("member_payout_form");
+                       }
+               }
+                else
+               {
+                       // Not enougth points
+                       LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_POINTS_NOT_ENOUGTH);
+               }
+       }
+        else
+       {
+               // ID is invalid
+               LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_ID_INVALID);
+       }
+}
+//
+?>
diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php
new file mode 100644 (file)
index 0000000..ec7275b
--- /dev/null
@@ -0,0 +1,206 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 11/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-points.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : All your collected points...                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle Ihrer gesammelten Punkte                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+$result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
+$depths = SQL_NUMROWS($result_depths);
+
+// Add many more rows for the login/turbo/ref/order bonus
+if (!EXT_IS_ACTIVE("bonus")) $depths += 1;
+if (GET_EXT_VERSION("bonus") >= "0.2.2") $depths += 6;
+if (GET_EXT_VERSION("bonus") >= "0.4.4") $depths += 4;
+
+// Remember row count in constant
+define('__ROWS_VALUE', ($depths*2+15));
+
+// Init some vars...
+$TPTS = 0; $TREF = 0; $TLOCK = 0; $OUT = "";
+
+// Load ref levels
+while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
+       // Initialize ref-count
+       $REFS = 0;
+
+       // Load referral points
+       $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_points) == 1) {
+               list($points, $locked) = SQL_FETCHROW($result_points);
+               SQL_FREERESULT($result_points);
+               // Also count locked points
+               $TPTS += $points; $TLOCK += $locked;
+       } else {
+               $points = "0.00000"; $locked = "0.00000";
+       }
+
+       // Load referral counts
+       $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level='%s' LIMIT 1",
+               array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_refs) == 1) {
+               list($REFS) = SQL_FETCHROW($result_refs);
+               SQL_FREERESULT($result_refs);
+               $TREF += $REFS;
+       } else {
+               $REFS = 0;
+       }
+
+       // Transfer data to array for template
+       $content = array(
+               'lvl'    => $lvl,
+               'per'    => TRANSLATE_COMMA($per),
+               'points' => TRANSLATE_COMMA($points),
+               'refs'   => TRANSLATE_COMMA($REFS),
+       );
+
+       // Output row
+       $OUT .= LOAD_TEMPLATE("member_points_row", true, $content);
+}
+
+// Free memory
+SQL_FREERESULT($result_depths);
+
+// Put rows to constant for the main template
+define('__REF_LEVEL_ROWS', $OUT);
+
+$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+list($USED, $PAY) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+// Initialize variables
+$CONFIRMED = "---"; $SENT = "---"; $RECEIVED = "---";
+
+// Only user >= v0.1.2: Fetch confirmed mails counter
+if (GET_EXT_VERSION("user") >= "0.1.2") {
+       $ADD = "";
+       if (GET_EXT_VERSION("user") >= "0.1.4") {
+               $ADD = ", emails_sent, emails_received";
+       }
+       $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($CONFIRMED, $SENT, $RECEIVED) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Please update the user extension if you see 3 dashes
+       if (empty($SENT))     $SENT     = "---";
+       if (empty($RECEIVED)) $RECEIVED = "---";
+} else {
+       // Please update!
+       $CONFIRMED = "---";
+}
+
+// If TLOCK is 0 add 3 zeros for floating
+if ($TLOCK == "0") $TLOCK = "0.00000";
+
+// Remember several values in constants
+define('__USED_VALUE' , TRANSLATE_COMMA($USED));
+define('__TPTS_VALUE' , TRANSLATE_COMMA($TPTS - $USED));
+define('__TREF_VALUE' , $TREF);
+define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK));
+
+// Fixes a bug when there is no bonus extension installed
+if (EXT_VERSION_IS_OLDER("bonus", "0.4.4")) $_CONFIG['bonus_active'] = "X";
+
+// Display login bonus and turbo-click bonus
+if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == "Y")) {
+       $ADD = ", 0, 0, 0";
+       if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats";
+
+       // Load data
+       $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // We don't add this points now. This will be done after each month
+       list($login, $turbo, $ref, $order, $stats) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Prepare constants
+       define('__TURBO_VALUE',  TRANSLATE_COMMA($turbo));
+       define('__LOGIN_VALUE',  TRANSLATE_COMMA($login));
+
+       if (GET_EXT_VERSION("bonus") >= "0.4.4") {
+               // Add referral, stats and order bonys
+               define('__REF_VALUE'  ,  TRANSLATE_COMMA($ref));
+               define('__ORDER_VALUE',  TRANSLATE_COMMA($order));
+               define('__STATS_VALUE',  TRANSLATE_COMMA($stats));
+       }
+
+       // Total bonus points
+       define('__TTOTAL_VALUE', TRANSLATE_COMMA($turbo + $login + $ref + $order + $stats));
+
+       // Output rows
+       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true));
+} elseif ($_CONFIG['bonus_active'] == "N") {
+       // Bonus active rallye deactivated
+       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true));
+} elseif ((IS_ADMIN()) && (EXT_VERSION_IS_OLDER("bonus", "0.2.2")) && (EXT_IS_ACTIVE("bonus"))) {
+       // Please upgrade your bonus extension to v0.2.2 or newer!
+       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_upgrade"));
+} else {
+       // Members shall see no special rows here
+       define('__SPECIAL_ROWS', "");
+}
+
+// Remeber values for the final template
+define('__PAY_VALUE'      , $PAY);
+define('__CONFIRMED_VALUE', $CONFIRMED);
+define('__RECEIVE_VALUE'  , $RECEIVED);
+define('__SENT_VALUE'     , $SENT);
+
+// Load final template
+if (EXT_IS_ACTIVE("user")) {
+       // Load template when required extension is there
+       LOAD_TEMPLATE("member_points");
+} elseif (IS_ADMIN()) {
+       // Missing extension
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "user"));
+} else {
+       // Message for user
+       LOAD_TEMPLATE("admin_settings_saved", false, PROBLEM_POINTS_OVERVIEW_UNAVAILABLE);
+}
+
+if (EXT_IS_ACTIVE("payout")) {
+       // Payput extension is installed and active so we can check if the user has enougth points
+       PAYOUT_OUTPUT_PAYOUT_LIST(str_replace(",", ".", ($TPTS - $USED)));
+}
+
+//
+?>
diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php
new file mode 100644 (file)
index 0000000..c5062c2
--- /dev/null
@@ -0,0 +1,231 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-primera.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Wernis requests                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungsanfragen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // User is not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("primera")) && (!IS_ADMIN())) {
+       // Extension "primera" is not activated
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "primera");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Check if the admin has entered the data
+if ((empty($_CONFIG['primera_api_name'])) || (empty($_CONFIG['primera_api_md5']))) {
+       // Something important is missing...
+       LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_API_DATA_MISSING);
+       return;
+}
+
+// Init the content array and points
+$content = array(); $points = false;
+
+// Is the mode set (payout only)
+if (!isset($_GET['mode'])) {
+       // Get referral id
+       $content['refid'] = bigintval($_CONFIG['primera_refid']);
+
+       // Get Primus id
+       $result = SQL_QUERY_ESC("SELECT primera_userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch ID
+               list($content['primus_nickname']) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Is there an ID?
+       if ((!empty($content['primus_nickname'])) && (!isset($_GET['mode']))) {
+               // Then use an other "mode"
+               $_GET['mode'] = "list";
+
+               // And load all rows!
+               $result = SQL_QUERY_ESC("SELECT `id`, `primera_account`, `primera_amount`, `primera_timestamp`, `primera_type` FROM "._MYSQL_PREFIX."_user_primera WHERE `userid` = %s ORDER BY `primera_timestamp` DESC",
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Load all rows
+               $content['rows'] = ""; $SW = 2;
+               while ($data = SQL_FETCHARRAY($result)) {
+                       // Prepare data for output
+                       $rowContent = array(
+                               'stamp'                 => MAKE_DATETIME($data['primera_timestamp'], "2"),
+                               'points'                => TRANSLATE_COMMA($data['primera_amount']),
+                               'acc'                   => SQL_ESCAPE($data['primera_account']),
+                               'status'                => PRIMERA_TRANSFER_STATUS($data['primera_type']),
+                               'raw_type'              => strtolower($data['primera_type']),
+                               'sw'                    => $SW,
+                       );
+
+                       // Load row template
+                       $content['rows'] .= LOAD_TEMPLATE("member_primera_mode_list_row", true, $rowContent);
+                       $SW = 3 - $SW;
+               }
+
+               // Free result
+               SQL_FREERESULT($result);
+       } else {
+               // Mode pay
+               $_GET['mode'] = "pay";
+       }
+} // END - if
+if ($_GET['mode'] == "pay") {
+       // Get total points and check if the user can request a payout
+       $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+       // No dots here...
+       $points = explode(".", $points);
+       $points = bigintval($points[0]);
+
+       // Remove the registration fee
+       $points = $points - $_CONFIG['points_register'];
+
+       // Is this enougth for a payout?
+       if ($points < $_CONFIG['primera_min_payout']) {
+               // No, then abort here
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT, TRANSLATE_COMMA($_CONFIG['primera_min_payout'])));
+               return;
+       }
+
+       // Add points to content array
+       $content['points']              = $points;
+       $content['min_points']  = TRANSLATE_COMMA($_CONFIG['primera_min_payout']);
+
+       // Get Primera id
+       $content['primus_nickname'] = "";
+       $result = SQL_QUERY_ESC("SELECT primera_userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch ID
+               list($content['primus_nickname']) = SQL_FETCHROW($result);
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+} else {
+       // Invalid mode!
+       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode'])));
+       return;
+}
+
+// Is the formular sent?
+if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
+       // Check input data depending on the mode and execute the requested mode
+       switch ($_GET['mode']) {
+               case "pay": // Payout this exchange -> Primus
+                       // Is the user ID and password set?
+                       if (empty($_POST['primus_nickname'])) {
+                               // Nothing entered in Primus nickname
+                               LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_USERNAME);
+                               OUTPUT_HTML("<br />");
+                       } elseif (empty($_POST['primera_password'])) {
+                               // Nothing entered in Primera password
+                               LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_PASSWORD);
+                               OUTPUT_HTML("<br />");
+                       } elseif (empty($_POST['amount'])) {
+                               // Nothing entered in amount
+                               LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_AMOUNT);
+                               OUTPUT_HTML("<br />");
+                       } elseif ($_POST['amount'] != bigintval($_POST['amount'])) {
+                               // Only numbers in amount!
+                               LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_INVALID_AMOUNT);
+                               OUTPUT_HTML("<br />");
+                       } elseif ($_POST['amount'] < $_CONFIG['primera_min_payout']) {
+                               // Not enougth entered!
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['primera_min_payout'])));
+                               OUTPUT_HTML("<br />");
+                       } elseif ($_POST['amount'] > $points) {
+                               // Not enougth points left!
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_PAYOUT_POINTS_DEPLETED, bigintval($_POST['amount']), bigintval($points)));
+                               OUTPUT_HTML("<br />");
+                       } else {
+                               // All is fine here so do the payout
+                               $success = PRIMERA_EXECUTE_PAYOUT($_POST['primus_nickname'], md5($_POST['primera_password']), $_POST['amount']);
+                               if ($success) {
+                                       // Default is locked!
+                                       $locked = true;
+
+                                       // Shall I "pay" the referral points imidiately?
+                                       if ($_CONFIG['ref_payout'] == "0") {
+                                               // Yes, "pay" it now
+                                               $locked = false;
+                                       } // END - if
+
+                                       // Remove points from account
+                                       SUB_POINTS($GLOBALS['userid'], $_POST['amount']);
+
+                                       // Update primera nickname
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `primera_userid`=%s WHERE userid=%s LIMIT 1",
+                                               array($_POST['primus_nickname'], $GLOBALS['userid']), __FILE__, __LINE__);
+
+                                       // All done!
+                                       LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_PAYOUT_DONE);
+                                       return;
+                               } elseif ((GET_PRIMERA_ERROR_CODE() == "user_failed") || (GET_PRIMERA_ERROR_CODE() == "own_failed") || (GET_PRIMERA_ERROR_CODE() == "amount_failed") || (GET_PRIMERA_ERROR_CODE() == "api_amount_failed")) {
+                                       // Wrong login data
+                                       LOAD_TEMPLATE("admin_settings_saved", false, GET_PRIMERA_ERROR_MESSAGE());
+                                       OUTPUT_HTML("<br />");
+                               } else {
+                                       // Something went wrong
+                                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_PAYOUT_FAILED, GET_PRIMERA_ERROR_MESSAGE()));
+                                       OUTPUT_HTML("<br />");
+                               }
+                       }
+                       break;
+
+               default: // Invalid mode!
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode'])));
+                       return;
+       }
+}
+
+// Prepare mode for template name
+$mode = sprintf("member_primera_mode_%s", SQL_ESCAPE($_GET['mode']));
+
+// Load the template
+LOAD_TEMPLATE($mode, false, $content);
+
+//
+?>
diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php
new file mode 100644 (file)
index 0000000..b86019f
--- /dev/null
@@ -0,0 +1,147 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 06/29/2004 *
+ * ================                             Last change: 08/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-rallyes.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Ref rallyes                                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Ref-Rallyes                                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("rallye")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "rallye");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+OUTPUT_HTML("<DIV align=\"center\">");
+
+// Check for possible running rallyes
+$ADMIN = " AND d.is_active='Y'";
+if (IS_ADMIN()) $ADMIN = "";
+$result = SQL_QUERY("SELECT DISTINCT d.id, d.admin_id, a.login, d.title, d.descr, d.template, d.start_time, d.end_time, d.min_users, d.min_prices
+ FROM "._MYSQL_PREFIX."_rallye_data AS d, "._MYSQL_PREFIX."_admins AS a
+ WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y'
+ ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) == 1)
+{
+       // Found some (normally one...
+       list($id, $aid, $login, $title, $descr, $templ, $start, $end, $min_users, $min_prices) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       $expired = false;
+       if ($end < time())
+       {
+               // Rallye is expired
+               define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
+               $expired = true;
+       }
+        elseif (time() >= ($end - $_CONFIG['one_day']))
+       {
+               // Rallye will expire in less one day!
+               define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
+       }
+        else
+       {
+               define('__RALLYE_EXTRAS', "<A href=\"".URL."/modules.php?module=login&amp;what=reflinks\">".RALLYE_GET_REFLINK."</A>");
+       }
+       // Set admin line (currently set to impressum, later to contact form)
+       define('__RALLYE_ADMIN', "<A href=\"".URL."/modules.php?module=index&amp;what=impressum&amp;admin=".$aid."\">".$login."</A>");
+
+       // Set title
+       define('__RALLYE_TITLE', COMPILE_CODE($title));
+
+       // Handle description...
+       if ((empty($descr)) && (!empty($templ)))
+       {
+               // Use description from template
+               define('__RALLYE_DESCR', LOAD_TEMPLATE("rallye_".$templ, true));
+       }
+        else
+       {
+               // Use description from database
+               define('__RALLYE_DESCR', COMPILE_CODE($descr));
+       }
+
+       if ($min_users == 0)
+       {
+               // Rallye ends without user limitation
+               define('__RALLYE_MAX_USERS', RALLYE_END_NO_USER_LIMITATION);
+       }
+        else
+       {
+               // Rallye ends when X members are totally in your exchange
+               define('__RALLYE_MAX_USERS', RALLYE_END_USERS_1." ".$min_users." ".RALLYE_END_USERS_2);
+       }
+       if ($min_prices == 0)
+       {
+               // Rallye ends without user limitation
+               define('__RALLYE_MIN_PRICES', RALLYE_END_NO_PRICE_LIMITATION);
+       }
+        else
+       {
+               // Rallye ends when X members are totally in your exchange
+               define('__RALLYE_MIN_PRICES', RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2);
+       }
+
+       // Set start and end time
+       define('__RALLYE_START', MAKE_DATETIME($start, "1"));
+       define('__RALLYE_END'  , MAKE_DATETIME($end  , "1"));
+
+       if ($expired)
+       {
+               define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
+               define('__RALLYE_TOP_USERS', "<DIV align=\"center\" class=\"big\">".__RALLYE_EXTRAS."</DIV>");
+               define('__RALLYE_CAN_WIN_THIS', RALLYE_OUR_WINNERS_ARE);
+       }
+        else
+       {
+               define('__RALLYE_PRICES', RALLYE_ADD_PRICES($id, "html"));
+               define('__RALLYE_TOP_USERS', RALLYE_ADD_TOPUSERS($id, $GLOBALS['userid']));
+               define('__RALLYE_CAN_WIN_THIS', RALLYE_YOU_CAN_WIN);
+       }
+
+       // And load final template
+       LOAD_TEMPLATE("guest_rallye_show");
+}
+ else
+{
+       // No rallye found so far
+       LOAD_TEMPLATE("guest_no_rallyes");
+}
+//
+OUTPUT_HTML("</DIV>");
+//
+?>
diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php
new file mode 100644 (file)
index 0000000..280aba6
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-refback.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Refback setup                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Refback-Einstellungen                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // User is not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("refback")) && (!IS_ADMIN())) {
+       // Extension "refback" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "refback");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Was the form submitted?
+if ((isset($_POST['edit'])) && (isset($_POST['id']))) {
+       // Okay, has the user entered some values?
+       if (isset($_POST['percents'])) {
+               // Change ref-back for this direct id
+               $status = REFBACK_CHANGE_MEMBER_PERCENTS($_POST['id'], $_POST['percents']);
+
+               // Check status
+               if (isset($status['ok'])) {
+                       // No message found
+                       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE);
+               } elseif (isset($status['message'])) {
+                       // Something went wrong with error message
+                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message']));
+               } else {
+                       // No message found
+                       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE);
+               }
+
+               // Insert line
+               OUTPUT_HTML("<br />");
+       } else {
+               // Read data from refback table
+               $content = GET_USER_REF_ENTRY($_POST['id']);
+
+               // Translate comma
+               $content['refback'] = TRANSLATE_COMMA($content['refback']);
+
+               // Load form for editing
+               LOAD_TEMPLATE("member_refback_edit", false, $content);
+       }
+} // END - if
+
+// Load all referal levels
+$result = SQL_QUERY_ESC("SELECT r.level, r.percents
+FROM "._MYSQL_PREFIX."_refdepths AS r
+WHERE r.level > 0
+ORDER BY r.level ASC",
+       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+// Are there some entries? (Shall be!)
+if (SQL_NUMROWS($result) > 0) {
+       // List all levels
+       $OUT = "";
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Init variables
+               $rows = "";
+               $counter = 0;
+               $SW = 2;
+
+               // Check for users ref in this level
+               foreach (GET_USER_REFS($GLOBALS['userid'], $content['level']) as $refRow) {
+                       // Not-deleted account is default
+                       $deleted = false;
+                       if (is_null($refRow['status'])) $deleted = true;
+
+                       // Add/"translate" more content
+                       $refRow['sw']      = $SW;
+                       $refRow['points']  = TRANSLATE_COMMA($refRow['points']);
+                       $refRow['refback'] = TRANSLATE_COMMA($refRow['refback']);
+                       $refRow['status']  = TRANSLATE_STATUS($refRow['status']);
+                       if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
+
+                       // Load row template
+                       if ($deleted) {
+                               $rows .= LOAD_TEMPLATE("member_refback_list_row_deleted", true, $refRow);
+                       } else {
+                               $rows .= LOAD_TEMPLATE("member_refback_list_row", true, $refRow);
+                       }
+
+                       // Count this ref and switch color
+                       $counter++;
+                       $SW = 3 - $SW;
+               } // END - foreach
+
+               // Remember the content
+               $content['counter']  = TRANSLATE_COMMA($counter);
+               $content['percents'] = TRANSLATE_COMMA($content['percents']);
+               $content['rows']     = $rows;
+
+               // Load level template
+               $OUT .= LOAD_TEMPLATE("member_refback_list_level", true, $content);
+       } // END - while
+
+       // Load main template
+       LOAD_TEMPLATE("member_refback_list", false, $OUT);
+} else {
+       // No entries
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php
new file mode 100644 (file)
index 0000000..3234e51
--- /dev/null
@@ -0,0 +1,136 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 09/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-reflinks.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Referral links                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Referral-Links                                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load current referral clicks
+$result = SQL_QUERY_ESC("SELECT ref_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+list($c) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+OUTPUT_HTML("<FONT class=\"tiny\">".YOUR_PERSONAL_REFLINK.":<br />
+<STRONG><A href=\"".URL."/ref.php?refid=".$GLOBALS['userid']."\" target=\"_blank\">".URL."/ref.php?ref=".$GLOBALS['userid']."</A></STRONG><br />
+<br />");
+
+if (EXT_IS_ACTIVE("nickname"))
+{
+       // Add nickname link when nickname is entered
+       $nick = NICKNAME_GET_NICK($GLOBALS['userid']);
+
+       if (!empty($nick))
+       {
+               // Display nickname link
+               OUTPUT_HTML(NICKNAME_YOUR_REFLINK.":<br />
+<STRONG><A href=\"".URL."/ref.php?ref=".$nick."\" target=\"_blank\">".URL."/ref.php?ref=".$nick."</A></STRONG><br />
+<br />");
+       }
+        else
+       {
+               // Display link to nickname form
+               OUTPUT_HTML("<STRONG class=\"guest_note\">".NO_NICKNAME_SET."</STRONG><br />
+<A class=\"tiny\" href=\"".URL."/modules.php?module=login&amp;what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</A>");
+       }
+}
+
+// Clicks on your reflink
+OUTPUT_HTML(YOUR_REFCLICKS.": <STRONG>".$c."</STRONG> ".CLICKS."</FONT><br /><br />");
+$whereStatement = " WHERE visible='Y'";
+if (IS_ADMIN()) $whereStatement = "";
+$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM "._MYSQL_PREFIX."_refbanner", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // List available ref banners
+       $SW = 2; $OUT = "";
+       while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result))
+       {
+               $test = str_replace(URL, PATH, $url); $size = 0;
+               if ($test == $url)
+               {
+                       // Download banner (I hope you keep the banner on same server???)
+                       $fp = @file($url); $file = "";
+                       if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0))
+                       {
+                               // Loads only found banner, when there is a 404 error this foreach() command
+                               // will cause an "Invalid argument supplied for foreach()" error
+                               foreach ($fp as $f)
+                               {
+                                       $file .= $f;
+                               }
+                       }
+                       $size = strlen($file);
+               } elseif (FILE_READABLE($test)) {
+                       $size = filesize($test);
+               }
+               if ($size > 0) $alt .= " (".TRANSLATE_COMMA(round($size/102.4)/10)." ".KBYTES.")";
+
+               // Load banner data
+               $content = array(
+                       'sw'  => $SW,
+                       'url' => $url,
+                       'alt' => $alt,
+                       'cnt' => $count,
+                       'cks' => $clks,
+                       'uid' => $GLOBALS['userid'],
+                       'id'  => $id,
+               );
+
+               // Add row
+               $OUT .= LOAD_TEMPLATE("member_reflinks_row", true, $content);
+
+               // Switchcolors
+               $SW = 3 - $SW;
+       }
+
+       define('__REFLINKS_ROWS', $OUT);
+
+       // Load final template
+       LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/member/what-sponsor.php b/inc/modules/member/what-sponsor.php
new file mode 100644 (file)
index 0000000..22cbc52
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/10/2005 *
+ * ===============                              Last change: 05/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-sponsor.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Introduce our sponsors                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Unsere Sponsoren vorstellen                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Loads the name-matching template
+LOAD_TEMPLATE(substr(basename(__FILE__), 5, -4));
+
+//
+?>
diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php
new file mode 100644 (file)
index 0000000..4816ad8
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/09/2003 *
+ * ===============                              Last change: 04/21/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-stats.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Statistics over send mails                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Statistik ueber gesendete Mails                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Init output
+$main_content = array();
+
+// Load waiting/pending orders
+$result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp, target_send, data_type, zip
+FROM "._MYSQL_PREFIX."_pool
+WHERE sender=%s AND data_type != 'SEND'
+ORDER BY timestamp DESC",
+       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+// Are there mails left in pool?
+if (SQL_NUMROWS($result) > 0) {
+       // Load all orders
+       $OUT = ""; $SW = 2;
+       while ($data = SQL_FETCHARRAY($result)) {
+               // Is the ZIP code set? If not, set dashes
+               if (empty($data['zip'])) $data['zip'] =  "---";
+
+               // Prepare content for output
+               $content = array(
+                       'sw'    => $SW,
+                       'id'    => $data['id'],
+                       'cat'   => GET_CATEGORY($data['cat_id']),
+                       'pay'   => GET_PAYMENT($data['payment_id']),
+                       'subj'  => COMPILE_CODE($data['subject']),
+                       'url'   => DEREFERER($data['url']),
+                       'stamp' => MAKE_DATETIME($data['timestamp'], "2"),
+                       'recs'  => $data['target_send'],
+                       'type'  => TRANSLATE_POOL_TYPE($data['data_type']),
+                       'zip'   => $data['zip']
+               );
+
+               // Load template
+               $OUT .= LOAD_TEMPLATE("member_pool_row", true, $content);
+
+               // Switch color
+               $SW = 3 - $SW;
+       } // END - if
+
+       // Load main template
+       $main_content['pool'] = LOAD_TEMPLATE("member_pool_table", true, $OUT);
+} else {
+       // No mails in pool!
+       $main_content['pool'] = LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_MAILS_IN_POOL);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+// Load sent orders
+//                               0     1         2         3      4            5            6            7           8
+$result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp_ordered, max_rec, timestamp_send, clicks
+FROM "._MYSQL_PREFIX."_user_stats
+WHERE userid=%s
+ORDER BY timestamp_ordered DESC",
+       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0) {
+       // Mail orders are in pool so we can display them
+       $SW = 2; $OUT = "";
+       while ($data = SQL_FETCHROW($result)) {
+               // Prepare data for the template
+               $content = array(
+                       'sw'    => $SW,
+                       'cat'   => GET_CATEGORY($data[1]),
+                       'pay'   => GET_PAYMENT($data[2]),
+                       'subj'  => COMPILE_CODE($data[3]),
+                       'url'   => DEREFERER($data[4]),
+                       'stamp' => MAKE_DATETIME($data[5], "2"),
+                       'recs'  => $data[6],
+                       'sent'  => MAKE_DATETIME($data[7], "2"),
+                       'clix'  => $data[8],
+                       'perc'  => COMPILE_CODE($data[8] / $data[6] * 100)."%",
+               );
+
+               // Load row template and switch colors
+               $OUT .= LOAD_TEMPLATE("member_stats_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Load main template
+       $main_content['stats'] = LOAD_TEMPLATE("member_stats_table", true, $OUT);
+} else {
+       // No mail orders fond
+       $main_content['stats'] = LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_MAILS_IN_STATS);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+// Load main template
+LOAD_TEMPLATE("member_stats_pool", false, $main_content);
+
+//
+?>
diff --git a/inc/modules/member/what-support.php b/inc/modules/member/what-support.php
new file mode 100644 (file)
index 0000000..bfed002
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/29/2004 *
+ * ================                             Last change: 04/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-support.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Contact support                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Support kontaktieren                             *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}  elseif (!IS_MEMBER()){
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("support")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "support");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+if ((!isset($_POST['ok'])) || (empty($_POST['qsummary'])))
+{
+       // Output form
+       LOAD_TEMPLATE("member_support_form");
+}
+ else
+{
+       // Load mail template based on your member's decision
+       if (GET_EXT_VERSION("admins") >= "0.4.1") {
+               $a_tpl = "admin_support-".$_POST['qsummary'];
+       } else {
+               $msg_a = LOAD_EMAIL_TEMPLATE("admin_support-".$_POST['qsummary'], $_POST['qdetails'], $GLOBALS['userid']);
+       }
+       $msg_m = LOAD_EMAIL_TEMPLATE("member_support-".$_POST['qsummary'], $_POST['qdetails'], $GLOBALS['userid']);
+
+       // Select right subject
+       switch ($_POST['qsummary'])
+       {
+               case "ordr"       : $subj_a = SUPPORT_SUBJ_ADMIN_ORDER;       $subj_m = SUPPORT_SUBJ_MEMBER_ORDER;       break;
+               case "reflink"    : $subj_a = SUPPORT_SUBJ_ADMIN_REFLINK;     $subj_m = SUPPORT_SUBJ_MEMBER_REFLINK;     break;
+               case "unconfirmed": $subj_a = SUPPORT_SUBJ_ADMIN_UNCONFIRMED; $subj_m = SUPPORT_SUBJ_MEMBER_UNCONFIRMED; break;
+       }
+
+       // Send mail to admin
+       SEND_ADMIN_NOTIFICATION($subj_a, $a_tpl, $_POST['qdetails'], $GLOBALS['userid']);
+
+       // Send mail to user
+       SEND_EMAIL($GLOBALS['userid'], $subj_m, $msg_m);
+
+       // Drop a message in the admin's area
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())",
+        array($GLOBALS['userid'], addslashes($subj_a), addslashes($_POST['qsummary'].":".$_POST['qdetails'])), __FILE__, __LINE__);
+
+       // Form sent
+       LOAD_TEMPLATE("member_support_contcted");
+}
+//
+?>
diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php
new file mode 100644 (file)
index 0000000..ec4d19b
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ================                             Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_book.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Members can book new URLs here                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Mitglieder koennen URLs buchen                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // Redirect
+       LOAD_URL(URL."/modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
+       // Extension "surfbar" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Still allowed to book more URLs?
+if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
+       // No more URLs allowed to book!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_MORE_ALLOWED);
+} elseif (isset($_POST['ok'])) {
+       // Is limitation "no" and "limit" is > 0?
+       if (($_POST['limited'] == "N") && ((isset($_POST['limit'])) && ($_POST['limit'] > 0)) || (!isset($_POST['limit']))) {
+               // Set it to unlimited
+               $_POST['limit'] = 0;
+       } // END - if
+
+       // Register the new URL
+       $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url'], $_POST['limit']);
+
+       // Was this fine?
+       if ($insertId > 0) {
+               // URL added and waiting for unlock
+               $msg = MEMBER_SURFBAR_URL_ADDED;
+       } else {
+               // Something went wrong!
+               $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
+       }
+
+       // Load message template
+       LOAD_TEMPLATE("admin_settings_saved", false, $msg);
+} else {
+       // Prepare some content
+       $content = array(
+               'reward'     => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
+               'costs'      => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
+               'max_order'  => $_CONFIG['surfbar_max_order'],
+               'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
+       );
+
+       // Load surfbar order form
+       LOAD_TEMPLATE(sprintf("member_surfbar_book_%s", strtolower($_CONFIG['surfbar_pay_model'])), false, $content);
+}
+
+//
+?>
diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php
new file mode 100644 (file)
index 0000000..8879d19
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/17/2008 *
+ * ================                             Last change: 09/17/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_list.php                            *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar URL statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Surfbar-Statistiken                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load user URLs
+$URLs = SURFBAR_GET_USER_URLS();
+
+// Are there entries or form is submitted?
+if ((isset($_POST['ok'])) && (isset($_POST['action'])) && (isset($_POST['id']))) {
+       // Process the form
+       if (SURFBAR_MEMBER_DO_FORM($_POST, $URLs)) {
+               // Action performed
+               LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_ACTION_DONE);
+       } else {
+               // Something went wrong
+               LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_ACTION_FAILED);
+       }
+} elseif (count($URLs) > 0) {
+       // List all URLs
+       $OUT = ""; $SW = 2;
+       foreach ($URLs as $id => $content) {
+               // "Translate"/insert data
+               $content['sw'] = $SW;
+               $content['url'] = DEREFERER($content['url']);
+               if ($content['views_total'] > 0) {
+                       // Include link to stats
+                       $content['views_total'] = "[<a href=\"".URL."/modules.php?module=login&amp;what=surfbar_list\">".TRANSLATE_COMMA($content['views_total'])."</a>]";
+               } // END - if
+               $content['registered']  = MAKE_DATETIME($content['registered'], "2");
+               $content['last_locked'] = MAKE_DATETIME($content['last_locked'], "2");
+               $content['actions']     = SURFBAR_MEMBER_ACTIONS($content['id'], $content['status']);
+               $content['status']      = SURFBAR_TRANSLATE_STATUS($content['status']);
+               if (empty($content['lock_reason'])) {
+                       // Fixes some HTML problems with empty cells
+                       $content['lock_reason'] = "---";
+               } // END - if
+
+               // Load row template
+               $OUT .= LOAD_TEMPLATE("member_surfbar_list_row", true, $content);
+
+               // Switch color
+               $SW = 3 - $SW;
+       } // END - if
+
+       // Load main template
+       LOAD_TEMPLATE("member_surfbar_list", false, $OUT);
+} else {
+       // No URLs booked so far
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_URLS_FOUND);
+}
+
+//
+?>
diff --git a/inc/modules/member/what-surfbar_start.php b/inc/modules/member/what-surfbar_start.php
new file mode 100644 (file)
index 0000000..5730b73
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2008 *
+ * ================                             Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_start.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Gives some infos to the surfbar and launch link  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gibt ein paar Infos zur Surfbar und Startlink    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // Not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
+       // Extension "surfbar" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Prepare content for output
+$content = array(
+       'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
+       'surfbar_static_time'   => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time']),
+       'surfbar_static_lock'   => CREATE_FANCY_TIME($_CONFIG['surfbar_static_lock']),
+);
+
+// In dynamic mode we need some more data
+if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") {
+       // Total URLs
+       $content = array(
+               'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
+               'surfbar_total_urls'      => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"),
+               'surfbar_user_urls'       => SURFBAR_GET_TOTAL_USER_URLS(),
+               'surfbar_total_online'    => SURFBAR_DETERMINE_TOTAL_ONLINE(),
+               'surfbar_total_users'     => TRANSLATE_COMMA(GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true)),
+               'surfbar_min_reward'      => TRANSLATE_COMMA(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
+               'surfbar_max_reward'      => TRANSLATE_COMMA(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
+               'surfbar_min_time'        => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
+               'surfbar_max_time'        => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
+               'surfbar_dynamic_lock'    => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_LOCK()),
+               'surfbar_static_reward'   => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
+               'surfbar_static_time'     => CREATE_FANCY_TIME($_CONFIG['surfbar_static_time'])
+       );
+} // END - if
+
+// Load the template
+LOAD_TEMPLATE("member_surfbar_start_".strtolower($_CONFIG['surfbar_pay_model']), false, $content);
+
+// Load surfbar link template
+LOAD_TEMPLATE("member_surfbar_link");
+
+//
+?>
diff --git a/inc/modules/member/what-surfbar_stats.php b/inc/modules/member/what-surfbar_stats.php
new file mode 100644 (file)
index 0000000..41110ed
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/10/2008 *
+ * ================                             Last change: 09/10/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_stats.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar URL statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Surfbar-Statistiken                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL(URL."/modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+//
+?>
diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php
new file mode 100644 (file)
index 0000000..14c40c1
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/20/2005 *
+ * ================                             Last change: 03/20/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-themes.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme selection for members                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Design-Auswahl fuer Mitglieder                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+if (!empty($_POST['member_theme'])) {
+       // Save theme to member's profile
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET curr_theme='%s' WHERE userid=%s LIMIT 1",
+         array($_POST['member_theme'], $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Set new theme for guests
+       $newTheme = SQL_ESCAPE($_POST['member_theme']);
+
+       // Change to new theme
+       set_session("mxchange_theme", $newTheme);
+
+       // Theme saved!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_THEME_SAVED);
+}
+
+// Initialize array
+$THEMES = array(
+       'theme_unix'   => array(), // Unix name from filesystem
+       'theme_name'   => array(), // Title
+       'theme_author' => array(), // Theme author's name
+       'theme_email'  => array(), // Author's email address
+       'theme_url'    => array(), // URL were you can download it from
+       'theme_ver'    => array(), // Version number of theme
+);
+
+// Read directory "themes"
+$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
+while ($entry = readdir($handle)) {
+       // Construct absolute theme.php file name
+       $theme = sprintf("%stheme/%s/theme.php", PATH, $entry);
+
+       if (($entry != ".") && ($entry != "..") && (FILE_READABLE($theme)) && (THEME_IS_ACTIVE($entry))) {
+               // Found a valid directory so let's load it's theme.php file
+               include($theme);
+
+               // Add found theme to array
+               $THEMES['theme_unix'][]   = $entry;
+               $THEMES['theme_name'][]   = $THEME_NAME;
+               $THEMES['theme_author'][] = $THEME_AUTHOR;
+               $THEMES['theme_email'][]  = $THEME_EMAIL;
+               $THEMES['theme_url'][]    = $THEME_URL;
+               $THEMES['theme_ver'][]    = $THEME_VERSION;
+       } // END - if
+} // END - while
+
+// Close directory
+closedir($handle);
+
+// Sort array by Uni* name
+array_pk_sort($THEMES, array("theme_name"));
+
+// Generate output lines for the template
+$OUT = ""; $SW = 2;
+foreach ($THEMES['theme_unix'] as $key => $unix) {
+       $default = "";
+       if (get_session('mxchange_theme') == $unix) $default = " checked selected";
+
+       // Add row
+       $OUT .= "<TR>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\" height=\"30\">
+    <INPUT type=\"radio\" name=\"member_theme\" class=\"member_normal\" value=\"".$unix."\"".$default.">
+  </TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">".$THEMES['theme_name'][$key]."</TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
+    <A href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")"."\">".$THEMES['theme_author'][$key]."</A>
+  </TD>
+  <TD class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
+    <A href=\"".DEREFERER($THEMES['theme_url'][$key])."\" target=\"_blank\">".$THEMES['theme_url'][$key]."</A>
+  </TD>
+  <TD class=\"switch_sw".$SW." bottom2\" align=\"center\">v".$THEMES['theme_ver'][$key]."</TD>
+</TR>\n";
+       $SW = 3 - $SW;
+}
+
+if (empty($OUT)) {
+       // No themes found???
+       $OUT = "<TR>
+  <TD colspan=\"5\" class=\"bottom2\" height=\"80\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_THEMES_FOUND)."
+  </TD>
+</TR>\n";
+}
+define('__THEME_LIST', $OUT);
+
+// Load template
+LOAD_TEMPLATE("member_themes");
+
+//
+?>
diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php
new file mode 100644 (file)
index 0000000..b546599
--- /dev/null
@@ -0,0 +1,608 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/07/2004 *
+ * ================                             Last change: 10/07/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-transfer.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Point transfers                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Punktetransfers                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("transfer")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "transfer");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Load data
+$result = SQL_QUERY_ESC("SELECT opt_in FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+list($opt_in) = SQL_FETCHROW($result);
+
+// Free memory
+SQL_FREERESULT($result);
+
+$MODE = "";
+if (!empty($_GET['mode'])) $MODE = $_GET['mode'];
+
+// Check for "faker"
+if (($opt_in == "N") && ($MODE == "new")) $MODE = "";
+
+switch ($MODE)
+{
+case "new": // Start new transfer
+       // Get total points and subtract the balance amount from it = maximum transferable points
+       $result = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND points > 0",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($total) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Get totally used points and password
+       $result = SQL_QUERY_ESC("SELECT used_points, password FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($used, $pass) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Remember maximum value for template
+       define('__TRANSFER_MAX_VALUE', round($total - $used - $_CONFIG['transfer_balance'] - 0.5));
+
+       if (isset($_POST['ok']))
+       {
+               // Add new transfer
+               if ($_CONFIG['transfer_code'] > 0)
+               {
+                       // Check for code
+                       $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $_POST['code_chk'], $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
+                       $valid_code = ($code == $_POST['code']);
+               }
+                else
+               {
+                       // Zero length (= disabled) is always valid!
+                       $valid_code = true;
+               }
+
+               // Test password
+               $valid_pass = ($pass == generateHash($_POST['password'], $pass));
+
+               // Test transfer amount
+               $valid_amount = ((!empty($_POST['points'])) && ($_POST['points'] <= __TRANSFER_MAX_VALUE));
+
+               // Test reason for transfer
+               $valid_reason = (!empty($_POST['reason']));
+
+               // Test if a recipient is selected
+               $valid_recipient = ($_POST['to_uid'] > 0);
+
+               // Check for nickname extension and set additional data
+               $nick = false; $ADD = ", userid";
+               if (EXT_IS_ACTIVE("nickname"))
+               {
+                       $ADD = ", nickname";
+                       $nick = true;
+               }
+               // Re-check receivers and own personal data
+               $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid IN ('%s','%s') AND status='CONFIRMED' ORDER BY userid LIMIT 2",
+                array($GLOBALS['userid'], bigintval($_POST['to_uid'])), __FILE__, __LINE__);
+               $valid_data = (SQL_NUMROWS($result) == 2);
+
+               if ($valid_code && $valid_pass && $valid_amount && $valid_reason && $valid_recipient)
+               {
+                       // Let's start the transfer and load user data
+                       list($uid1, $gender1, $sname1, $fname1, $email1, $nick1) = SQL_FETCHROW($result);
+                       list($uid2, $gender2, $sname2, $fname2, $email2, $nick2) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       if ($uid1 == $GLOBALS['userid'])
+                       {
+                               // Data row 1 is sender's data
+                               define('__SENDER_GENDER'     , TRANSLATE_GENDER($gender1));
+                               define('__SENDER_NICK'    , $nick1);
+                               define('__SENDER_SNAME'   , $sname1);
+                               define('__SENDER_FNAME'   , $fname1);
+                               define('__SENDER_EMAIL'   , $email1);
+                               // Data row 2 is recpient's data
+                               define('__RECIPIENT_GENDER'  , TRANSLATE_GENDER($gender2));
+                               define('__RECIPIENT_NICK' , $nick2);
+                               define('__RECIPIENT_SNAME', $sname2);
+                               define('__RECIPIENT_FNAME', $fname2);
+                               define('__RECIPIENT_EMAIL', $email2);
+
+                               // Prepare variables for testing
+                               $TEST_NICK_SENDER = $nick1;
+                               $TEST_NICK_REC = $nick2;
+                       }
+                        else
+                       {
+                               // Data row 2 is sender's data
+                               define('__SENDER_GENDER'     , TRANSLATE_GENDER($gender2));
+                               define('__SENDER_NICK'    , $nick2);
+                               define('__SENDER_SNAME'   , $sname2);
+                               define('__SENDER_FNAME'   , $fname2);
+                               define('__SENDER_EMAIL'   , $email2);
+                               // Data row 1 is recpient's data
+                               define('__RECIPIENT_GENDER'  , TRANSLATE_GENDER($gender1));
+                               define('__RECIPIENT_NICK' , $nick1);
+                               define('__RECIPIENT_SNAME', $sname1);
+                               define('__RECIPIENT_FNAME', $fname1);
+                               define('__RECIPIENT_EMAIL', $email1);
+
+                               // Prepare variables for testing
+                               $TEST_NICK_SENDER = $nick2;
+                               $TEST_NICK_REC = $nick1;
+                       }
+                       // Sender's UID is always currently stored in cookie userid...
+                       define('__SENDER_UID'     , $GLOBALS['userid']);
+                       define('__RECIPIENT_UID'  , $_POST['to_uid']);
+
+                       $SENDER = __SENDER_UID;
+                       $RECIPIENT = __RECIPIENT_UID;
+                       if ($nick)
+                       {
+                               if (($TEST_NICK_SENDER != __SENDER_UID) && (!empty($TEST_NICK_SENDER)))
+                               {
+                                       $SENDER = __SENDER_NICK;
+                               }
+                               if (($TEST_NICK_REC != __RECIPIENT_UID) && (!empty($TEST_NICK_REC)))
+                               {
+                                       $RECIPIENT = __RECIPIENT_NICK;
+                               }
+                       }
+
+                       // Remember transfer reason and fancy date/time in constants
+                       define('__TRANSFER_REASON', $_POST['reason']);
+                       if (function_exists('CREATE_FANCY_TIME'))
+                       {
+                               define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME($_CONFIG['transfer_age']));
+                       }
+                        else
+                       {
+                               define('__TRANSFER_EXPIRES', round($_CONFIG['transfer_age']/60/60/24)." ".DAYS);
+                       }
+
+                       // Generate tranafer id
+                       define('__TRANS_ID', bigintval(GEN_RANDOM_CODE("10", rand(0, 99999), $GLOBALS['userid'], $_POST['reason'])));
+
+                       // Add entries to both tables
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_transfers_in (userid, from_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+                        array(bigintval($_POST['to_uid']), $GLOBALS['userid'], bigintval($_POST['points']), addslashes($_POST['reason']), __TRANS_ID),
+                        __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_transfers_out (userid, to_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+                        array($GLOBALS['userid'], bigintval($_POST['to_uid']), bigintval($_POST['points']), addslashes($_POST['reason']), __TRANS_ID),
+                        __FILE__, __LINE__);
+
+                       // Add points to account *directly* ...
+                       ADD_POINTS_REFSYSTEM(bigintval($_POST['to_uid']), bigintval($_POST['points']), false, "0", false, "direct");
+
+                       // ... and add it to current user's used points
+                       SUB_POINTS($GLOBALS['userid'], $_POST['points']);
+
+                       // First send email to recipient
+                       $msg = LOAD_EMAIL_TEMPLATE("member_transfer_recipient", "", __RECIPIENT_UID);
+                       SEND_EMAIL(__RECIPIENT_EMAIL, TRANSFER_MEMBER_RECIPIENT_SUBJ.": ".$SENDER, $msg);
+
+                       // Second send email to sender
+                       $msg = LOAD_EMAIL_TEMPLATE("member_transfer_sender", "", __SENDER_UID);
+                       SEND_EMAIL(__SENDER_EMAIL, TRANSFER_MEMBER_SENDER_SUBJ.": ".$RECIPIENT, $msg);
+
+                       // At last send admin mail(s)
+                       $ADMIN_SUBJ = sprintf("%s (%s->%s)", TRANSFER_ADMIN_SUBJECT, $SENDER, $RECIPIENT);
+                       SEND_ADMIN_NOTIFICATION($ADMIN_SUBJ, "admin_transfer_points");
+
+                       // Transfer is completed
+                       LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."<br /><A href=\"".URL."/modules.php?module=login&amp;what=transfer\">".TRANSFER_CONTINUE_OVERVIEW."</A>");
+               }
+                elseif (!$valid_code)
+               {
+                       // Invalid Touring code!
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_CODE."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+                elseif (!$valid_pass)
+               {
+                       // Wrong password entered
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_PASSWORD."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+                elseif (!$valid_amount)
+               {
+                       // Too much points entered
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_POINTS."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+                elseif (!$valid_reason)
+               {
+                       // No transfer reason entered
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_REASON."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+                elseif (!$valid_recipient)
+               {
+                       // No recipient selected
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_RECIPIENT."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+                elseif (!$valid_data)
+               {
+                       // No recipient selected
+                       OUTPUT_HTML("<P><STRONG class=\"member_note\">".TRANSFER_INVALID_DATA."</STRONG></P>");
+                       unset($_POST['ok']);
+               }
+       }
+       if (!isset($_POST['ok']))
+       {
+               // Load member list
+               if (EXT_IS_ACTIVE("nickname"))
+               {
+                       // Load userid and nickname
+                       $result = SQL_QUERY_ESC("SELECT userid, nickname FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid",
+                        array($GLOBALS['userid']), __FILE__, __LINE__);
+               }
+                else
+               {
+                       // Load only userid
+                       $result = SQL_QUERY_ESC("SELECT userid, userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid",
+                        array($GLOBALS['userid']), __FILE__, __LINE__);
+               }
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       // Load list
+                       $OUT  = "<SELECT name=\"to_uid\" size=\"1\" class=\"member_select\">
+  <OPTION value=\"0\">".SELECT_NONE."</OPTION>\n";
+                       while (list($uid, $nick) = SQL_FETCHROW($result))
+                       {
+                               $OUT .= "<OPTION value=\"".$uid."\"";
+                               if ((isset($_POST['to_uid'])) && ($_POST['to_uid'] == $uid)) $OUT .= " selected=\"selected\"";
+                               $OUT .= ">";
+                               if (($nick != $uid) && (!empty($nick)))
+                               {
+                                       // Output nickname
+                                       $OUT .= $nick;
+                               }
+                                else
+                               {
+                                       // Output userid
+                                       $OUT .= $uid;
+                               }
+                               $OUT .= "</OPTION>\n";
+                       }
+                       $OUT .= "</SELECT>\n";
+                       define('__TRANSFER_TO_DISABLED', "");
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               }
+                else
+               {
+                       // No one else is opt-in
+                       $OUT = TRANSFER_NO_ONE_ELSE_OPT_IN;
+                       define('__TRANSFER_TO_DISABLED', " disabled");
+               }
+               // Transfer output to constant for the template
+               define('__TRANSFER_USERID_SELECTION', $OUT);
+
+               // Generate Code
+               if ($_CONFIG['transfer_code'] > 0)
+               {
+                       $rand = rand(0, 99999);
+                       $code = GEN_RANDOM_CODE($_CONFIG['transfer_code'], $rand, $GLOBALS['userid'], __TRANSFER_MAX_VALUE);
+                       $img = GENERATE_IMAGE($code, false);
+                       define('__TRANSFER_IMAGE_INPUT', "<INPUT type=\"hidden\" name=\"code_chk\" value=\"".$rand."\"><INPUT type=\"text\" name=\"code\" class=\"member_normal\" size=\"5\" maxlength=\"7\"".__TRANSFER_TO_DISABLED.">&nbsp;".$img);
+               }
+                else
+               {
+                       $code = "00000";
+                       define('__TRANSFER_IMAGE_INPUT', TRANSFER_NO_CODE);
+               }
+
+               // Transfer maybe already entered valued'
+               if (isset($_GET['ok'])) {
+                       // Get values from form
+                       define('__TRANSFER_POINTS_VALUE', bigintval($_POST['points']));
+                       define('__TRANSFER_REASON_VALUE', strip_tags($_POST['reason']));
+               } else {
+                       // Set empty values
+                       define('__TRANSFER_POINTS_VALUE', "");
+                       define('__TRANSFER_REASON_VALUE', "");
+               }
+
+               // Output form
+               LOAD_TEMPLATE("member_transfer_new");
+       }
+       break;
+
+case "list_in": // List only incoming transactions
+case "list_out": // List only outgoing transactions
+       // As you can see I put list_in and list_out together. I now do a switch() again on it for the right SQL command
+       switch ($MODE)
+       {
+       case "list_in":
+               $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max'];
+               $NOTHING = TRANSFER_NO_INCOMING_TRANSFERS;
+               define('__TRANSFER_SUM', TRANSFER_TOTAL_INCOMING);
+               define('__TRANSFER_TITLE', TRANSFER_LIST_INCOMING);
+               break;
+
+       case "list_out":
+               $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY time_trans DESC LIMIT ".$_CONFIG['transfer_max'];
+               $NOTHING = TRANSFER_NO_OUTGOING_TRANSFERS;
+               define('__TRANSFER_SUM', TRANSFER_TOTAL_OUTGOING);
+               define('__TRANSFER_TITLE', TRANSFER_LIST_OUTGOING);
+               break;
+       }
+
+       // Run the SQL command
+       $total = 0;
+       $result = SQL_QUERY_ESC($SQL, array($GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               $OUT = ""; $SW = 2;
+               while (list($tid, $uid, $points, $reason, $stamp) = SQL_FETCHROW($result))
+               {
+                       if ($type == "OUT") $points = "$points-";
+                       $OUT .= "<TR>
+  <TD class=\"transfer_row1 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row1\">".$tid."</FONT>
+  </TD>
+  <TD class=\"transfer_row2 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row2\">".MAKE_DATETIME($stamp, "3")."</FONT>
+  </TD>
+  <TD class=\"transfer_row3 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row3\">".$uid."</FONT>
+  </TD>
+  <TD class=\"transfer_row4 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row4\">".$reason."</FONT>
+  </TD>
+  <TD class=\"transfer_row5 switch_sw".$SW." bottom2\">
+    <FONT class=\"transfer_row5\">".$points."</FONT>
+  </TD>
+</TR>\n";
+                       $total += $points;
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // Nothing for in or out
+               $OUT = "<TR>
+  <TD colspan=\"5\" align=\"center\" class=\"bottom2\" height=\"70\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, $NOTHING)."
+  </TD>
+</TR>";
+       }
+
+       // ... and add them to a constant for the template
+       define('__TRANSFER_ROWS', $OUT);
+
+       // Remeber total amount
+       define('__TRANSFER_TOTAL_VALUE', $total);
+
+       // Load final template
+       LOAD_TEMPLATE("member_transfer_list");
+       break;
+
+case "list_all": // List all transactions
+       // We fill a temporary table with data from both tables. This is much easier
+       // to code and unstand by you as sub-SELECT queries. I know this is not the
+       // fastest way but it shall be fine for now.
+       //
+       // First of all create the temporary table
+       $result = SQL_QUERY("CREATE TEMPORARY TABLE "._MYSQL_PREFIX."_transfers_tmp (
+trans_id VARCHAR(12) NOT NULL DEFAULT '',
+party_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+reason VARCHAR(255) NOT NULL DEFAULT '',
+time_trans VARCHAR(10) NOT NULL DEFAULT '0',
+trans_type ENUM('IN','OUT') NOT NULL DEFAULT 'IN',
+KEY(party_uid)
+) TYPE=HEAP", __FILE__, __LINE__);
+
+       // Let's begin with the incoming list
+       $result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s ORDER BY id LIMIT %s",
+array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__);
+       while ($DATA = SQL_FETCHROW($result))
+       {
+               $DATA[] = "IN";
+               $DATA = implode("','", $DATA);
+               $res_temp = SQL_QUERY("INSERT INTO "._MYSQL_PREFIX."_transfers_tmp (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // As the last table transfer data from outgoing table to temporary
+       $result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s ORDER BY id LIMIT %s",
+array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__);
+       while ($DATA = SQL_FETCHROW($result))
+       {
+               $DATA[] = "OUT";
+               $DATA = implode("','", $DATA);
+               $res_temp = SQL_QUERY("INSERT INTO "._MYSQL_PREFIX."_transfers_tmp (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       $total = 0;
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Output rows
+               $OUT = ""; $SW = 2;
+               $result = SQL_QUERY("SELECT party_uid, trans_id, points, reason, time_trans, trans_type FROM "._MYSQL_PREFIX."_transfers_tmp ORDER BY time_trans DESC", __FILE__, __LINE__);
+               while(list($uid, $idx, $points, $reason, $stamp, $type) = SQL_FETCHROW($result))
+               {
+                       if ($type == "OUT") $points = "-$points";
+                       $OUT .= "<TR>
+  <TD class=\"transfer_row1 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row1\">".$idx."</FONT>
+  </TD>
+  <TD class=\"transfer_row2 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row2\">".MAKE_DATETIME($stamp, "3")."</FONT>
+  </TD>
+  <TD class=\"transfer_row3 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row3\">".$uid."</FONT>
+  </TD>
+  <TD class=\"transfer_row4 switch_sw".$SW." bottom2 right2\">
+    <FONT class=\"transfer_row4\">".$reason."</FONT>
+  </TD>
+  <TD class=\"transfer_row5 switch_sw".$SW." bottom2\">
+    <FONT class=\"transfer_row5\">".$points."</FONT>
+  </TD>
+</TR>\n";
+                       $total += $points;
+                       $SW = 3 - $SW;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+        else
+       {
+               // Nothing for in and out
+               $OUT = "<TR>
+  <TD colspan=\"5\" align=\"center\" class=\"bottom2\" height=\"70\">
+    ".LOAD_TEMPLATE("admin_settings_saved", true, TRANSFER_NO_INOUT_TRANSFERS)."
+  </TD>
+</TR>";
+       }
+
+       // ... and add them to a constant for the template
+       define('__TRANSFER_ROWS', $OUT);
+
+       // Remeber total amount
+       define('__TRANSFER_TOTAL_VALUE', $total);
+
+       // Set title
+       define('__TRANSFER_TITLE', TRANSFER_LIST_ALL);
+
+       // Set "balance" word
+       define('__TRANSFER_SUM', TRANSFER_TOTAL_BALANCE);
+
+       // Load final template
+       LOAD_TEMPLATE("member_transfer_list");
+
+       // At the end we don't need a temporary table in memory
+       $result = SQL_QUERY("DROP TABLE IF EXISTS "._MYSQL_PREFIX."_transfers_tmp", __FILE__, __LINE__);
+
+       // Free some memory...
+       SQL_FREERESULT($result);
+       break;
+
+case "": // Overview page
+       // Check incoming transfers
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_user_transfers_in WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($dmy) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       $total=$dmy;
+       if ($dmy > 0)
+       {
+               define('__TRANSFER_IN_LINK', "<A href=\"".URL."/modules.php?module=login&amp;what=transfer&amp;mode=list_in\">".$dmy."</A>");
+       }
+        else
+       {
+               define('__TRANSFER_IN_LINK', $dmy);
+       }
+
+       // Check outgoing transfers
+       $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_user_transfers_out WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($dmy) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       $total+=$dmy;
+       if ($dmy > 0)
+       {
+               define('__TRANSFER_OUT_LINK', "<A href=\"".URL."/modules.php?module=login&amp;what=transfer&amp;mode=list_out\">".$dmy."</A>");
+       }
+        else
+       {
+               define('__TRANSFER_OUT_LINK', $dmy);
+       }
+
+       // Total transactions
+       if ($total > 0)
+       {
+               define('__TRANSFER_ALL_LINK', "<A href=\"".URL."/modules.php?module=login&amp;what=transfer&amp;mode=list_all\">".$total."</A>");
+       }
+        else
+       {
+               define('__TRANSFER_ALL_LINK', $total);
+       }
+
+       if (isset($_POST['ok'])) {
+               // Save settings
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET opt_in='%s' WHERE userid=%s LIMIT 1",
+                array($_POST['opt_in'], $GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Rember for next switch() command
+               $opt_in = $_POST['opt_in'];
+
+               // "Settings saved..."
+               OUTPUT_HTML("<P><STRONG class=\"member_done\">".SETTINGS_SAVED."</STRONG></P>");
+       }
+
+       switch ($opt_in)
+       {
+       case 'Y':
+               define('__TRANSFER_ALLOW_Y', " checked=\"checked\"");
+               define('__TRANSFER_ALLOW_N', "");
+               define('__TRANSFER_NEW_LINK', "<A href=\"".URL."/modules.php?module=login&amp;what=transfer&amp;mode=new\">".TRANSFER_NOW_LINK."</A>");
+               break;
+
+       case 'N':
+               define('__TRANSFER_ALLOW_Y', "");
+               define('__TRANSFER_ALLOW_N', " checked=\"checked\"");
+               define('__TRANSFER_NEW_LINK', TRANSFER_PLEASE_ALLOW_OPT_IN);
+               break;
+       }
+
+       // Check for latest out-transfers
+       $result = SQL_QUERY_ESC("SELECT time_trans FROM "._MYSQL_PREFIX."_user_transfers_out WHERE time_trans > (UNIX_TIMESTAMP() - ".$_CONFIG['transfer_timeout'].") AND userid=%s ORDER BY time_trans DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Load template
+               define('__TRANSFER_SETTINGS_CONTENT', LOAD_TEMPLATE("member_transfer_settings", true));
+       } else {
+               // Load newest transaction
+               list($newest) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+               define('__TRANSFER_SETTINGS_CONTENT', TRANSFER_LATEST_IS_1.MAKE_DATETIME($newest, "3").TRANSFER_LATEST_IS_2);
+       }
+
+       // Load template
+       LOAD_TEMPLATE("member_transfer_overview");
+       break;
+}
+//
+?>
diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php
new file mode 100644 (file)
index 0000000..f6879b2
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 07/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-unconfirmed.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Unconfirmed mails                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Unbestaetigte Mails                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("mailid")) {
+       LOAD_URL("modules.php?module=login");
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+if (EXT_IS_ACTIVE("bonus")) {
+       // Load bonus ID
+       $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY bonus_id DESC",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+} else {
+       // Don't load bonus ID
+       $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY stats_id DESC",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+}
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // Please confirm these mails!
+       $sum = 0; $SW = 2; $OUT = "";
+       while (list($id, $id2, $type) = SQL_FETCHROW($result))
+       {
+               // Load data from stats table...
+               $cat = "";
+               switch ($type)
+               {
+               case "NORMAL":
+                       $result_data = SQL_QUERY_ESC("SELECT subject, subject, timestamp_ordered, cat_id, payment_id, pool_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
+                        array(bigintval($id)), __FILE__, __LINE__);
+                       $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
+                       break;
+
+               case "BONUS":
+                       $result_data = SQL_QUERY_ESC("SELECT subject, text, timestamp, cat_id, points, id FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+                        array(bigintval($id2)), __FILE__, __LINE__);
+                       $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
+                       break;
+               }
+
+               if (SQL_NUMROWS($result_data) == 1)
+               {
+                       // Mail was found!
+                       list($subject, $text, $timestamp, $cat, $pay, $pool) = SQL_FETCHROW($result_data);
+                       SQL_FREERESULT($result_data);
+                       if ($type == "NORMAL")
+                       {
+                               $pay = GET_PAY_POINTS($pay, "payment");
+                               $result_text = SQL_QUERY_ESC("SELECT text FROM "._MYSQL_PREFIX."_pool WHERE id=%s LIMIT 1",
+                                array(bigintval($pool)), __FILE__, __LINE__);
+                               list($text) = SQL_FETCHROW($result_text);
+                               SQL_FREERESULT($result_text);
+                       }
+                       if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE;
+                       if (empty($text))    $text    = "---";
+                       $subject = COMPILE_CODE($subject);
+
+                       // Prepare data for template
+                       $content = array(
+                               'sw'     => $SW,
+                               'uid'    => $GLOBALS['userid'],
+                               'data'   => $DATA,
+                               'type'   => $type,
+                               'subj'   => $subject,
+                               'text'   => COMPILE_CODE($text),
+                               'stamp'  => MAKE_DATETIME($timestamp, "0"),
+                               'cat'    => GET_CATEGORY($cat),
+                               'points' => TRANSLATE_COMMA($pay),
+                       );
+
+                       // Load row template and count points
+                       $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
+                       $sum += $pay;
+               }
+                else
+               {
+                       // Prepare data for template
+                       $content = array(
+                               'sw'    => $SW,
+                               'data'  => $DATA,
+                               'probl' => $PROBLEM,
+                       );
+
+                       // Problem with mail detected
+                       $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
+               }
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Remember total points
+       define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));
+
+       // Remember all generated rows in constant for the template
+       define('__UNCONFIRMED_ROWS', $OUT);
+
+       // Load main template
+       LOAD_TEMPLATE("member_unconfirmed_table");
+}
+ else
+{
+       // No mails left to confirm... :)
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM);
+}
+
+//
+?>
diff --git a/inc/modules/member/what-welcome.php b/inc/modules/member/what-welcome.php
new file mode 100644 (file)
index 0000000..ce5e843
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/16/2003 *
+ * ===============                              Last change: 07/26/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-welcome.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Welcome to the login area!                       *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Willkommen zum Login-Bereich!                    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       LOAD_URL("modules.php?module=index");
+}
+
+// Add description as navigation point
+ADD_DESCR ("member", basename(__FILE__));
+
+// Export data for template
+define('_LAST_ONLINE_VALUE', MAKE_DATETIME($LAST['online']));
+define('_LAST_MODULE_VALUE', GET_MOD_DESCR("member", $LAST['module']));
+
+// Load header template
+LOAD_TEMPLATE("member_welcome_header");
+
+// Chedk if he is returning from a profile update notification
+$result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE notified='Y' AND userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE("profile")))
+{
+       // Yes, he is so let's place him his wanted buttons
+       LOAD_TEMPLATE("profile-update");
+}
+ else
+{
+       // Load the template below this default data
+       LOAD_TEMPLATE("member_welcome");
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+// Load footer template
+LOAD_TEMPLATE("member_welcome_footer");
+
+//
+?>
diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php
new file mode 100644 (file)
index 0000000..a2d9e43
--- /dev/null
@@ -0,0 +1,306 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/12/2004 *
+ * ================                             Last change: 11/16/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-wernis.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Wernis requests                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlungsanfragen                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!IS_MEMBER()) {
+       // User is not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif ((!EXT_IS_ACTIVE("wernis")) && (!IS_ADMIN())) {
+       // Extension "wernis" is not activated
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "wernis");
+       return;
+}
+
+// Add description as navigation point
+ADD_DESCR("member", basename(__FILE__));
+
+// Check if the admin has entered the data
+if ((empty($_CONFIG['wernis_api_id'])) || (empty($_CONFIG['wernis_api_md5']))) {
+       // Something important is missing...
+       LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_API_DATA_MISSING);
+       return;
+} // END - if
+
+// Init the content array and points
+$content = array(); $points = false;
+
+// Is the mode set (withdraw or payout)
+if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) {
+       // Let the user choose what he wants to do
+       $content['refid']    = bigintval($_CONFIG['wernis_refid']);
+       $content['wds66_id'] = 0;
+
+       // Get WDS66 id
+       $result = SQL_QUERY_ESC("SELECT wernis_userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch ID
+               list($content['wds66_id']) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Is there an ID?
+       if ((!empty($content['wds66_id'])) && (!isset($_GET['mode']))) {
+               // Then use an other "mode"
+               $_GET['mode'] = "list";
+
+               // And load all rows!
+               $result = SQL_QUERY_ESC("SELECT `id`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type` FROM "._MYSQL_PREFIX."_user_wernis WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC",
+                       array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // Load all rows
+               $content['rows'] = ""; $SW = 2;
+               while ($data = SQL_FETCHARRAY($result)) {
+                       // Prepare data for output
+                       $rowContent = array(
+                               'stamp'    => MAKE_DATETIME($data['wernis_timestamp'], "2"),
+                               'points'   => TRANSLATE_COMMA($data['wernis_amount']),
+                               'acc'      => bigintval($data['wernis_account']),
+                               'status'   => WERNIS_TRANSFER_STATUS($data['wernis_type']),
+                               'raw_type' => strtolower($data['wernis_type']),
+                               'sw'       => $SW,
+                       );
+
+                       // Load row template
+                       $content['rows'] .= LOAD_TEMPLATE("member_wernis_mode_list_row", true, $rowContent);
+                       $SW = 3 - $SW;
+               }
+
+               // Free result
+               SQL_FREERESULT($result);
+       } else {
+               // Default links are not active!
+               $content['payout_link']   = "<em>".WERNIS_MEMBER_PAYOUT_DISABLED."</em>";
+               $content['withdraw_link'] = "<em>".WERNIS_MEMBER_WITHDRAW_DISABLED."</em>";
+
+               // Is the payout mode active?
+               if ($_CONFIG['wernis_payout_active'] == "Y") {
+                       // Add link
+                       $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&amp;what=wernis&amp;mode=payout\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_PAYOUT."</div></a>";
+               } // END - if
+
+               // Is the withdraw mode active?
+               if ($_CONFIG['wernis_withdraw_active'] == "Y") {
+                       // Add link
+                       $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&amp;what=wernis&amp;mode=withdraw\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_WITHDRAW."</div></a>";
+               } // END - if
+
+               // Mode chooser! ;-)
+               $_GET['mode'] = "choose";
+       }
+} elseif (($_GET['mode'] == "payout") && ($_CONFIG['wernis_payout_active'] == "Y")) {
+       // Get total points and check if the user can request a payout
+       $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+       // Remove the registration fee
+       $points = $points - $_CONFIG['points_register'];
+
+       // Is there a percentage or fixed fee?
+       $points = WERNIS_TAKE_FEE($points, "payout");
+
+       // Is this enougth for a payout?
+       if ($points < $_CONFIG['wernis_min_payout']) {
+               // No, then abort here
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MIN_PAYOUT, TRANSLATE_COMMA($_CONFIG['wernis_min_payout'])));
+               return;
+       } // END - if
+
+       // No dots here...
+       $points = explode(".", $points);
+       $points = bigintval($points[0]);
+
+       // Add points to content array
+       $content['points']     = TRANSLATE_COMMA($points);
+       $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_payout']);
+
+       // Add fees to array
+       WERNIS_ADD_FEES_TO_ARRAY($content);
+
+       // Get WDS66 id
+       $content['wds66_id'] = "";
+       $result = SQL_QUERY_ESC("SELECT wernis_userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch ID
+               list($content['wds66_id']) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+} elseif (($_GET['mode'] == "withdraw") && ($_CONFIG['wernis_withdraw_active'] == "Y")) {
+       // Get total points for just displaying them
+       $points = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
+
+       // Prepare data for the template
+       $content['points']     = TRANSLATE_COMMA($points);
+       $content['min_points'] = TRANSLATE_COMMA($_CONFIG['wernis_min_withdraw']);
+       $content['wds66_id']   = "";
+
+       // Add fees to array
+       WERNIS_ADD_FEES_TO_ARRAY($content);
+
+       // Get WDS66 id
+       $result = SQL_QUERY_ESC("SELECT wernis_userid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array($GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Are there some entries?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch ID
+               list($content['wds66_id']) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+} else {
+       // Invalid mode!
+       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode'])));
+       return;
+}
+
+// Is the formular sent?
+if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
+       // Is the user ID and password set?
+       if (empty($_POST['wds66_id'])) {
+               // Nothing entered in WDS66 user ID
+               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_USERNAME);
+               OUTPUT_HTML("<br />");
+       } elseif (empty($_POST['wds66_password'])) {
+               // Nothing entered in WDS66 password
+               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_PASSWORD);
+               OUTPUT_HTML("<br />");
+       } elseif (empty($_POST['amount'])) {
+               // Nothing entered in amount
+               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_AMOUNT);
+               OUTPUT_HTML("<br />");
+       } elseif ($_POST['wds66_id'] != bigintval($_POST['wds66_id'])) {
+               // Only numbers in account ID!
+               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_INVALID_USERNAME);
+               OUTPUT_HTML("<br />");
+       } elseif ($_POST['amount'] != bigintval($_POST['amount'])) {
+               // Only numbers in amount!
+               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_INVALID_AMOUNT);
+               OUTPUT_HTML("<br />");
+       } else {
+               // Check input data depending on the mode and execute the requested mode
+               switch ($_GET['mode']) {
+                       case "withdraw": // Widthdraws WDS66 -> This exchange
+                               if ($_POST['amount'] < $_CONFIG['wernis_min_withdraw']) {
+                                       // Not enougth entered!
+                                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_withdraw'])));
+                                       OUTPUT_HTML("<br />");
+                               } else {
+                                       // All is fine here so do the withdraw
+                                       $success = WERNIS_EXECUTE_WITHDRAW($_POST['wds66_id'], md5($_POST['wds66_password']), $_POST['amount']);
+                                       if ($success) {
+                                               // Add it to this amount
+                                               $DEPTH = 0;
+                                               ADD_POINTS_REFSYSTEM($GLOBALS['userid'], bigintval($_POST['amount']), false, 0, false, "direct");
+
+                                               // Update the user data as well..
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
+                                                       array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
+
+                                               // All done!
+                                               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_WITHDRAW_DONE);
+                                               return;
+                                       } elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed")) {
+                                               // Wrong login data
+                                               LOAD_TEMPLATE("admin_settings_saved", false, GET_WERNIS_ERROR_MESSAGE());
+                                               OUTPUT_HTML("<br />");
+                                       } else {
+                                               // Something went wrong
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_WITHDRAW_FAILED, GET_WERNIS_ERROR_MESSAGE()));
+                                               OUTPUT_HTML("<br />");
+                                       }
+                               }
+                               break;
+
+                       case "payout": // Payout this exchange -> WDS66
+                               if ($_POST['amount'] < $_CONFIG['wernis_min_payout']) {
+                                       // Not enougth entered!
+                                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval($_CONFIG['wernis_min_payout'])));
+                                       OUTPUT_HTML("<br />");
+                               } elseif ($_POST['amount'] > $points) {
+                                       // Not enougth points left!
+                                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_PAYOUT_POINTS_DEPLETED, bigintval($_POST['amount']), bigintval($points)));
+                                       OUTPUT_HTML("<br />");
+                               } else {
+                                       // All is fine here so do the withdraw
+                                       $success = WERNIS_EXECUTE_PAYOUT($_POST['wds66_id'], md5($_POST['wds66_password']), $_POST['amount']);
+                                       if ($success) {
+                                               // Sub points
+                                               SUB_POINTS($GLOBALS['userid'], $_POST['amount']);
+
+                                               // Update WDS66 id
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
+                                                       array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
+
+                                               // All done!
+                                               LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_PAYOUT_DONE);
+                                               return;
+                                       } elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed") || (GET_WERNIS_ERROR_CODE() == "api_amount_failed")) {
+                                               // Wrong login data
+                                               LOAD_TEMPLATE("admin_settings_saved", false, GET_WERNIS_ERROR_MESSAGE());
+                                               OUTPUT_HTML("<br />");
+                                       } else {
+                                               // Something went wrong
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_WITHDRAW_FAILED, GET_WERNIS_ERROR_MESSAGE()));
+                                               OUTPUT_HTML("<br />");
+                                       }
+                               }
+                               break;
+
+                       default: // Invalid mode!
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode'])));
+                               return;
+               }
+       }
+}
+
+// Prepare mode for template name
+$mode = sprintf("member_wernis_mode_%s", SQL_ESCAPE($_GET['mode']));
+
+// Load the template
+LOAD_TEMPLATE($mode, false, $content);
+
+//
+?>
diff --git a/inc/modules/order.php b/inc/modules/order.php
new file mode 100644 (file)
index 0000000..d320cbd
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/29/2003 *
+ * ===============                              Last change: 01/06/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : order.php                                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Submits your order to the administrators         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sendet die Buchung an die Administratoren        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+$URL = "";
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order");
+       return;
+} elseif (!IS_MEMBER()) {
+       // Sorry, no guest access!
+       $URL = URL."/modules.php?module=index";
+} elseif (empty($_GET['order'])) {
+       // You cannot call this module directly!
+       $URL = URL."/modules.php?module=login&amp;what=order";
+}
+
+// When URL is empty nothing bad happend here
+if (empty($URL)) {
+       // Is the auto-send mechanism active or inactive?
+       if ($_CONFIG['autosend_active'] == "Y") {
+               // Auto-send is active
+               define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE));
+               define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE));
+               $type = "NEW";
+       } else {
+               // Auto-send is inactive
+               define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_INACTIVE));
+               define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_INACTIVE));
+               $type = "ADMIN";
+       }
+
+       // Update sending pool
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='%s' WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
+        array($type, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
+
+       // Finally is the entry valid?
+       if (SQL_AFFECTEDROWS() == 1) {
+               // Load personal data...
+               $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array($GLOBALS['userid']), __FILE__, __LINE__);
+               list($gender, $sname, $fname, $email) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Load mail again...              0       1        2           3          4      5      6         7
+               $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM "._MYSQL_PREFIX."_pool WHERE id=%s AND sender=%s LIMIT 1",
+                array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
+               $DATA = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+               if (empty($DATA[0])) $DATA[0] = DEFAULT_SUBJECT_LINE;
+
+               // Calculate used points
+               $USED = $DATA[7] * GET_PAY_POINTS($DATA[3]);
+
+               // Update used points
+               $ADD = "";
+               if ($_CONFIG['order_max_full'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
+               SUB_POINTS($GLOBALS['userid'], $USED);
+
+               // Prepare content
+               $content = array(
+                       'blocks'   => $_CONFIG['max_send'],
+                       'subject'  => $DATA[0],
+                       'text'     => $DATA[1],
+                       'payment'  => GET_PAYMENT($DATA[3]),
+                       'category' => GET_CATEGORY($DATA[6]),
+                       'url'      => $DATA[5]
+               );
+
+               // Send an email to the user
+               $msg_mem = LOAD_EMAIL_TEMPLATE("order-member", $content, $GLOBALS['userid']);
+               SEND_EMAIL($email, MEMBER_NEW_QUEUE, $msg_mem);
+
+               // Notify admins about this
+               SEND_ADMIN_NOTIFICATION(ADMIN_NEW_QUEUE, "order-admin", $content, $GLOBALS['userid']);
+
+               // Output back bottom
+               LOAD_TEMPLATE("member_order-back", false);
+       } else {
+               // Matching line not found or already "placed" in send queue
+               $URL = URL."/modules.php?module=login";
+               LOAD_URL($URL);
+       }
+} else {
+       // Redirect...
+       LOAD_URL($URL);
+}
+//
+?>
diff --git a/inc/modules/sponsor.php b/inc/modules/sponsor.php
new file mode 100644 (file)
index 0000000..f045092
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/02/2005 *
+ * ===============                              Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : sponsor.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor area                                     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sponsorenbereich                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+} elseif (!IS_SPONSOR()) {
+       // No sponsor!
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       return;
+} elseif (empty($GLOBALS['what'])) {
+       // Empty what value detected!
+       $GLOBALS['what'] = "welcome";
+}
+
+// A valid sponsor login and we are allowed to enter this module so let's
+// update his cookies and online time
+UPDATE_SPONSOR_LOGIN();
+
+// Generate menu
+define('__SPONSOR_MENU', GENERATE_SPONSOR_MENU($GLOBALS['what']));
+
+// Generate right-side output
+define('__SPONSOR_CONTENT', GENERATE_SPONSOR_CONTENT($GLOBALS['what']));
+
+// Load header template
+define('__SPONSOR_HEADER', LOAD_TEMPLATE("sponsor_header", true));
+
+// Load footer template
+define('__SPONSOR_FOOTER', LOAD_TEMPLATE("sponsor_footer", true));
+
+// "You are here" navigation
+define('__SPONSOR_YOURE_HERE', ADD_DESCR("sponsor", $GLOBALS['what'], false, false));
+
+// Load main sponsor template
+LOAD_TEMPLATE("sponsor_main");
+
+//
+?>
diff --git a/inc/modules/sponsor/.htaccess b/inc/modules/sponsor/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/modules/sponsor/.php b/inc/modules/sponsor/.php
new file mode 100644 (file)
index 0000000..27fcb6f
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 05/19/2008 *
+ * ===============                              Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              :                                                  *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+} elseif (!IS_SPONSOR()) {
+       // No sponsor!
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       return;
+}
+
+// Put all HTML code into $OUT!
+// E.g.: $OUT = LOAD_TEMPLATE("sponsor_template", true);
+?>
diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php
new file mode 100644 (file)
index 0000000..5032c96
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/30/2005 *
+ * ===============                              Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : account.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor can manage his account                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Der Sponsor kann sein Account verwalten          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+} elseif (!IS_SPONSOR()) {
+       // No sponsor!
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       return;
+}
+
+// Data for the formular
+$result = SQL_QUERY_ESC("SELECT company, position, tax_ident,
+gender, surname, family, street_nr1, street_nr2, zip, city, country,
+phone, fax, cell, email, url,
+status, receive_warnings
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' AND password='%s' LIMIT 1",
+ array(bigintval($_COOKIE['sponsorid']), $_COOKIE['sponsorpass']), __FILE__, __LINE__);
+if (SQL_NUMROWS($result) == 1) {
+       // Load sponsor data
+       $content = SQL_FETCHARRAY($result);
+       if ($content['status'] == "CONFIRMED") {
+               // Check if form was submitted or not
+               if (!empty($_POST['ok'])) {
+                       // Check passwords
+                       if (empty($_POST['pass_old'])) {
+                               // No current password entered
+                               $MSG = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
+                       } elseif (md5($_POST['pass_old']) != $_COOKIE['sponsorpass']) {
+                               // Entered password didn't match password in DB
+                               $MSG = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB;
+                       } elseif ((!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] != $_POST['pass2'])) {
+                               // Both new passwords did not match
+                               $MSG = SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH;
+                       } elseif ((empty($_POST['pass1'])) && (!empty($_POST['pass2']))) {
+                               // No password one entered
+                               $MSG = SPONSOR_PASSWORD_ONE_EMPTY;
+                       } elseif ((!empty($_POST['pass1'])) && (empty($_POST['pass2']))) {
+                               // No password two entered
+                               $MSG = SPONSOR_PASSWORD_TWO_EMPTY;
+                       } elseif ((!empty($_POST['pass1'])) && (strlen($_POST['pass1']) < $_CONFIG['pass_len'])) {
+                               // Too short password
+                               $MSG = SPONSOR_PASSWORD_TOO_SHORT_1.$_CONFIG['pass_len'].SPONSOR_PASSWORD_TOO_SHORT_2;
+                       } else {
+                               // Default is we don't want to change password!
+                               $PASS_AND = ""; $PASS_DATA = "";
+
+                               // Check if we want to change password or not
+                               if (($_POST['pass1'] == $_POST['pass2']) && (!empty($_POST['pass1'])) && ($_POST['pass1'] != $_POST['pass_old'])) {
+                                       // Change current password
+                                       $PASS_AND  = ", password='%s'";
+                                       $PASS_DATA = md5($_POST['pass1']);
+                               }
+
+                               // Unsecure data which we don't want here
+                                       $UNSAFE = array('receive_warnings', 'warning_interval');
+
+                               // Remove all (maybe spoofed) unsafe data from array
+                               foreach ($UNSAFE as $remove) {
+                                       unset($_POST[$remove]);
+                               }
+
+                               // Set last change timestamp
+                               $_POST['last_change'] = time();
+
+                               // Save data
+                               $MSG = SPONSOR_SAVE_DATA($_POST, $content);
+                       }
+
+                       if (!empty($MSG)) {
+                               // Output message
+                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $MSG);
+                       } else {
+                               // No message generated
+                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_MESSAGE_GENERATED);
+                       }
+               } else {
+                       // Check for gender selection
+                       switch ($content['gender'])
+                       {
+                       case "M": // Male
+                               define('__GENDER_M', " selected=\"selected\"");
+                               define('__GENDER_F', "");
+                               define('__GENDER_C', "");
+                               break;
+
+                       case "F": // Female
+                               define('__GENDER_M', "");
+                               define('__GENDER_F', " selected=\"selected\"");
+                               define('__GENDER_C', "");
+                               break;
+
+                       case "C": // Company
+                               define('__GENDER_M', "");
+                               define('__GENDER_F', "");
+                               define('__GENDER_C', " selected=\"selected\"");
+                               break;
+                       }
+
+                       // Output formular
+                       $OUT = LOAD_TEMPLATE("sponsor_account_form", true, $content);
+               }
+       } else {
+               // Locked or so?
+               $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
+               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_FAILED_1.$STATUS.SPONSOR_ACCOUNT_FAILED_2);
+       }
+} else {
+       // Sponsor account not found!
+       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_404_1.$_COOKIE['sponsorid'].SPONSOR_ACCOUNT_404_2);
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php
new file mode 100644 (file)
index 0000000..d8b04c9
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/11/2005 *
+ * ===============                              Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : settings.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Sponsor can manage his settings                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Der Sponsor kann seine Einstellungen aendern     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+} elseif (!IS_SPONSOR()) {
+       // No sponsor!
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       return;
+}
+
+// Data for the formular
+$result = SQL_QUERY_ESC("SELECT status, receive_warnings, warning_interval, email, surname, family, gender
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' AND password='%s' LIMIT 1",
+ array(bigintval($_COOKIE['sponsorid']), $_COOKIE['sponsorpass']), __FILE__, __LINE__);
+if (SQL_NUMROWS($result) == 1) {
+       // Load sponsor data
+       $content = SQL_FETCHARRAY($result);
+       if ($content['status'] == "CONFIRMED") {
+               // Check if form was submitted or not
+               if (!empty($_POST['ok'])) {
+                       // Check passwords
+                       if (empty($_POST['password'])) {
+                               // No current password entered
+                               $MSG = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
+                       } elseif (md5($_POST['password']) != $_COOKIE['sponsorpass']) {
+                               // Entered password didn't match password in DB
+                               $MSG = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB;
+                       } else {
+                               // Unsecure data which we don't want here
+                               $UNSAFE = array('company', 'position', 'tax_ident', 'gender', 'surname', 'family',
+                                               'street_nr1', 'street_nr2', 'zip', 'city', 'country', 'phone', 'fax', 'cell',
+                                               'email', 'url');
+
+                               // Remove all (maybe spoofed) unsafe data from array
+                               foreach ($UNSAFE as $remove) {
+                                       unset($_POST[$remove]);
+                               }
+
+                               // Set last change timestamp
+                               $_POST['last_change'] = time();
+
+                               // Save data
+                               $MSG = SPONSOR_SAVE_DATA($_POST, $content);
+                       }
+
+                       if (!empty($MSG)) {
+                               // Output message
+                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $MSG);
+                       } else {
+                               // No message generated
+                               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_MESSAGE_GENERATED);
+                       }
+               } else {
+                       // Make yes/no selection
+                       switch ($content['receive_warnings']) {
+                               case "Y":
+                                       define('__YES', " checked=\"checked\"");
+                                       define('__NO', "");
+                                       break;
+
+                               case "N":
+                                       define('__YES', "");
+                                       define('__NO', " checked=\"checked\"");
+                                       break;
+                       }
+
+                       // Translate current interval into fancy string
+                       define('__CURRENT', CREATE_FANCY_TIME($content['warning_interval']));
+
+                       // Output formular
+                       $OUT = LOAD_TEMPLATE("sponsor_settings_form", true, $content);
+               }
+       } else {
+               // Locked or so?
+               $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
+               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_FAILED_1.$STATUS.SPONSOR_ACCOUNT_FAILED_2);
+       }
+} else {
+       // Sponsor account not found!
+       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_ACCOUNT_404_1.$_COOKIE['sponsorid'].SPONSOR_ACCOUNT_404_2);
+}
+
+// Free memory
+SQL_FREERESULT($result);
+
+//
+?>
diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php
new file mode 100644 (file)
index 0000000..95f0a3a
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/17/2005 *
+ * ===============                              Last change: 05/19/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : welcome.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Welcome page for sponsor area                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Willkommensseite des Sponsorenbereiches          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software. You can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License.       *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+} elseif (!IS_SPONSOR()) {
+       // No sponsor!
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
+       return;
+}
+
+// Load some data
+$result = SQL_QUERY_ESC("SELECT gender, surname, family, (points_amount - points_used) AS points
+FROM "._MYSQL_PREFIX."_sponsor_data
+WHERE id='%s' AND password='%s' LIMIT 1",
+ array(bigintval($_COOKIE['sponsorid']), $_COOKIE['sponsorpass']), __FILE__, __LINE__);
+list($gender, $surname, $family, $points) = SQL_FETCHROW($result);
+
+// Free memory
+SQL_FREERESULT($result);
+
+// Prepare data for the template
+define('__GENDER'  , TRANSLATE_GENDER($gender));
+define('__SURNAME', $surname);
+define('__FAMILY' , $family);
+define('__POINTS' , TRANSLATE_COMMA($points));
+
+// Load main template
+$OUT = LOAD_TEMPLATE("sponsor_welcome", true);
+
+//
+?>
diff --git a/inc/modules/welcome.php b/inc/modules/welcome.php
new file mode 100644 (file)
index 0000000..ce50f5b
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2004 *
+ * ===============                              Last change: 09/05/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : welcome.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Welcome entry points                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Willkommensseite                                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+?>
diff --git a/inc/monthly/.htaccess b/inc/monthly/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/monthly/monthly_ b/inc/monthly/monthly_
new file mode 100644 (file)
index 0000000..729b3b8
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/04/2005 *
+ * ===============                              Last change: 03/04/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_                                         *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+//
+?>
diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php
new file mode 100644 (file)
index 0000000..35e6211
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/22/2005 *
+ * ===============                              Last change: 10/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_beg.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Monthly begging rallye                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Monatliche Bettelrallye                          *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
+
+// Get current month (2 digits)
+$curr = date("m", time());
+
+// Check if month is done
+if (($curr != $_CONFIG['last_month']) && ($_CONFIG['last_month'] > 0) && ($_CONFIG['beg_ranks'] > 0) && ($CSS != 1))
+{
+       // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
+       $whereStatement1 = "";
+       $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
+
+       // Let's check if there are some points left we can "pay"...
+       if (EXT_IS_ACTIVE("autopurge"))
+       {
+               // Use last online stamp only when autopurge for inactive members is activated
+               if (($_CONFIG['ap_inactive_since'] > 0) && ($_CONFIG['beg_active'] == "Y"))
+               {
+                       // Okay, include last online timestamp
+                       $whereStatement1 = sprintf("AND last_online >= (UNIX_TIMESTAMP() - %s)", bigintval($_CONFIG['ap_inactive_since']));;
+                       $whereStatement2 = bigintval($_CONFIG['beg_ranks']);
+               }
+       }
+
+       // SQL string to check for accounts
+       $result_main = SQL_QUERY_ESC("SELECT userid, email, beg_points
+FROM "._MYSQL_PREFIX."_user_data
+WHERE status='CONFIRMED' ".$whereStatement1." AND beg_points > 0
+ORDER BY beg_points DESC, userid
+LIMIT %s",
+               array($whereStatement2), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result_main) > 0) {
+               // Load our winners...
+               $UIDs = "";
+               while(list($uid, $email, $points) = SQL_FETCHROW($result_main)) {
+                       // Add points to user's account directly
+                       $result_data = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points
+SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1",
+ array($points, bigintval($uid)), __FILE__, __LINE__);
+
+                       // Update mediadata as well
+                       if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
+                               // Update database
+                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points);
+                       }
+
+                       // Load email template and email it away
+                       $msg = LOAD_EMAIL_TEMPLATE("member_beg", $points, bigintval($uid));
+                       SEND_EMAIL($email, BEG_MONTHLY_RALLYE, $msg);
+               }
+
+               // Remove first commata
+               $UIDs = substr($UIDs, 1);
+
+               // Get current month
+               $curr = date("m", time());
+               if (strlen($curr) == 1) $curr = "0".$curr;
+               if ($curr == "00") $curr = "12";
+
+               // Reset accounts
+               $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=0.00000 WHERE beg_points > 0", __FILE__, __LINE__);
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_main);
+}
+
+//
+?>
diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php
new file mode 100644 (file)
index 0000000..42cfdeb
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/14/2004 *
+ * ===============                              Last change: 11/19/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_bonus.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Monthly bonus from click-bonus                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Monatlicher Bonus von Klick-Verguetung           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+// Get current month (2 digits)
+$curr = date("m", time());
+
+if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS != 1))
+{
+       // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
+       $whereStatement1 = "WHERE status='CONFIRMED'";
+       $whereStatement2 = bigintval($_CONFIG['bonus_ranks']);
+
+       // Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
+       if (EXT_IS_ACTIVE("autopurge"))
+       {
+               // Use last online stamp only when autopurge for inactive members is activated
+               if ($_CONFIG['ap_inactive_since'] > 0)
+               {
+                       // Okay, include last online timestamp
+                       $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']);
+                       $whereStatement2 = bigintval($_CONFIG['bonus_ranks']);
+               }
+       }
+
+       // Add more bonus points here
+       $ADD = "";
+       if ($_CONFIG['bonus_click_yn'] == "Y") $ADD .= " + turbo_bonus";
+       if ($_CONFIG['bonus_login_yn'] == "Y") $ADD .= " + login_bonus";
+       if ($_CONFIG['bonus_order_yn'] == "Y") $ADD .= " + bonus_order";
+       if ($_CONFIG['bonus_stats_yn'] == "Y") $ADD .= " + bonus_stats";
+       if ($_CONFIG['bonus_ref_yn']   == "Y") $ADD .= " + bonus_ref";
+
+       if (!empty($ADD)) {
+               $ADD .= "AND (0".$ADD.") > 0";
+       } // END - if
+
+       // SQL string to check for accounts
+       $result_main = SQL_QUERY_ESC("SELECT userid, email, (turbo_bonus + login_bonus + bonus_order + bonus_stats + bonus_ref) AS active_bonus
+FROM "._MYSQL_PREFIX."_user_data
+".$whereStatement1." %s".$ADD."
+ORDER BY active_bonus DESC, userid LIMIT %s",
+ array($whereStatement2), __FILE__, __LINE__);
+
+       if (SQL_NUMROWS($result_main) > 0)
+       {
+               // Load our winners...
+               $UIDs = "";
+               while(list($uid, $email, $points) = SQL_FETCHROW($result_main))
+               {
+                       // Add userids in a row
+                       $UIDs .= ",'".$uid."'";
+
+                       // Add points to user's account directly
+                       $result_data = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points
+SET points=points+%s WHERE ref_depth=0 AND userid=%s LIMIT 1",
+ array($points, bigintval($uid)), __FILE__, __LINE__);
+
+                       // Update mediadata as well
+                       if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+                       {
+                               // Update database
+                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $points);
+                       }
+
+                       // Load email template and email it away
+                       $msg = LOAD_EMAIL_TEMPLATE("member_bonus", $points, bigintval($uid));
+                       SEND_EMAIL($email, BONUS_MONTHLY_ONLINE_BONUS, $msg);
+               }
+               // Remove first commata
+               $UIDs = substr($UIDs, 1);
+
+               // Get current month
+               $curr = date("m", time());
+               if (strlen($curr) == 1) $curr = "0".$curr;
+               if ($curr == "00") $curr = "12";
+
+               // Reset accounts
+               $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data
+SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __FILE__, __LINE__);
+
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_main);
+}
+
+//
+?>
diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php
new file mode 100644 (file)
index 0000000..3e1ab66
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/04/2005 *
+ * ===============                              Last change: 03/04/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_newsletter.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Monthly check for newsletter unsubscriptions     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Monatlicher Test auf Newsletter-Abmeldungen      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+// Get current month (2 digits)
+$curr = date("m", time());
+
+if ($_CONFIG['last_month'] != $curr)
+{
+       // Check for unsubscribed members
+       $result = SQL_QUERY("SELECT userid, nl_until FROM "._MYSQL_PREFIX."_user_data WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // Some unsubscriptions are found so we reset them to receive newsletters
+               while(list($uid, $until) = SQL_FETCHROW($result))
+               {
+                       // Update account
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_receive='Y', nl_until='0' WHERE userid=%s LIMIT 1",
+                        array(bigintval($uid)), __FILE__, __LINE__);
+
+                       // Send email to him
+                       $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_reset", true, bigintval($uid));
+                       SEND_EMAIL($uid, NL_MEMBER_RESET_SUBJECT, $msg);
+
+                       // Send email to admin
+                       SEND_ADMIN_NOTIFICATION(NL_ADMIN_SUBJECT, "admin_newsletter_reset", array(), $GLOBALS['userid']);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+}
+
+//
+?>
diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php
new file mode 100644 (file)
index 0000000..4b23ca9
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : monthly_surfbar.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+// Reset surfbar counter
+UPDATE_CONFIG("surfbar_monthly_counter", "0");
+$_CONFIG['surfbar_monthly_counter'] = 0;
+
+//
+?>
diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php
new file mode 100644 (file)
index 0000000..57230cf
--- /dev/null
@@ -0,0 +1,264 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/16/2003 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mysql-connect.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Connects to your database                        *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verbindet zu Ihrer Datenbank                     *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
+define('DEBUG_SQL', false);
+
+// Default is not a frameset
+global $isFrameset;
+$isFrameset = false;
+
+// Load library
+require_once(PATH."inc/db/lib.php");
+
+// Load general functions
+require_once(PATH."inc/functions.php");  // Non-database functions
+
+// Load more include files
+require_once(PATH."inc/mysql-manager.php"); // Functions which interact with the database
+
+// Load extensions and language
+require_once(PATH."inc/extensions.php");
+
+// Init error handler
+function __errorHandler ($errno, $errstr, $errfile, $errline) {
+       $msg = sprintf("errno=%s,errstr=%s,errfile=%s,errline=%s",
+               $errno,
+               $errstr,
+               basename($errfile),
+               $errline
+       );
+       DEBUG_LOG(__FUNCTION__.":".$msg, true);
+       print "Please report this error at <a href=\"http://forum.mxchange.org\" target=\"_blank\">forum.mxchange.org</a>:<pre>";
+       debug_print_backtrace();
+       die("</pre>Thanks for your help finding bugs.");
+}
+
+// Set error handler
+set_error_handler('__errorHandler');
+
+// Check if the user setups his MySQL stuff...
+if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+       // No login entered and outside installation mode
+       echo "<STRONG>".LANG_WARNING.":</STRONG> ";
+       if (isBooleanConstantAndTrue('mxchange_installed')) {
+               // You have changed my configuration file!
+               die(DIE_CONFIG_CHANGED_YOU);
+       } else {
+               // Please run the installation script (maybe again)
+               die(DIE_RUN_INSTALL_MYSQL);
+       }
+} elseif ((!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+       // No database password entered!!!
+       echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
+}
+
+// Check if this file is writeable or read-only and warn the user
+if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+       // Check for write-permission for config.php and inc directory
+       if (empty($GLOBALS['module'])) $GLOBALS['module'] = "index";
+
+       // CSS array
+       $EXT_CSS_FILES = array();
+
+       if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
+               // Connect to DB
+               global $link;
+               $link = SQL_CONNECT($MySQL['host'], $MySQL['login'], $MySQL['password'], __FILE__, __LINE__);
+
+               // Is the link valid?
+               if (is_resource($link)) {
+                       // Choose the database
+                       global $db;
+                       $db = SQL_SELECT_DB($MySQL['dbase'], $link, __FILE__, __LINE__);
+
+                       // Is it a valid resource?
+                       if ($db === true) {
+                               // Remove MySQL array from namespace
+                               unset($MySQL);
+
+                               // Load configuration stuff
+                               $_CONFIG = LOAD_CONFIG();
+
+                               // Initialize include-file-pool
+                               $INC_POOL = array();
+
+                               // Load "databases" aka static arrays
+                               require_once(PATH."inc/databases.php");
+
+                               // Loading patching system is required here...
+                               require_once(PATH."inc/patch-system.php"); // Initialize patch system
+
+                               // Functions which are related to themes
+                               require_once(PATH."inc/theme-manager.php");
+
+                               // Run daily reset
+                               require_once(PATH."inc/check-reset.php");
+
+                               // Load admin include file if he is admin
+                               if (IS_ADMIN()) {
+                                       // Administrative functions
+                                       require_once(PATH."inc/modules/admin/admin-inc.php");
+                               } // END - if
+                               //* DEBUG: */ ADD_POINTS_REFSYSTEM(36,1000);
+                               //* DEBUG: */ die();
+
+                               // Get all values
+                               if (($CSS != 1) && ($CSS != -1)) {
+                                       if (empty($GLOBALS['module']))  $GLOBALS['module'] = "empty";
+                                       if (empty($GLOBALS['what']))    $GLOBALS['what']   = GET_WHAT($GLOBALS['module']);
+                                       if (empty($GLOBALS['action']))  $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                               } else {
+                                       // Set action/what to empty
+                                       $GLOBALS['action'] = "";
+                                       $GLOBALS['what']   = "";
+                               }
+
+                               // Secure and validate user ID from cookie
+                               UPDATE_LOGIN_DATA();
+
+                               // Update online list
+                               UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
+
+                               // Set default 'what' value
+                               //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
+                               if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) {
+                                       if ($GLOBALS['module'] == "admin") {
+                                               // Set 'action' value to 'login' in admin menu
+                                               $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                                       } elseif (($GLOBALS['module'] == "index") || ($GLOBALS['module'] == "login")) {
+                                               // Set 'what' value to 'welcome' in guest and member menu
+                                               $GLOBALS['what'] = "welcome";
+                                               if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+                                       } else {
+                                               // Anything else like begging link
+                                               $GLOBALS['what'] = "";
+                                       }
+                               } // END - if
+
+                               // Update sending pool
+                               if (($CSS != "1") && ($CSS != "-1")) require_once(PATH."inc/pool-update.php"); // Sends out mails in configureable steps
+
+                               // Load all active extension including language files when not upgrading.
+                               // Check module for testing and count one click
+                               $dummy = CHECK_MODULE($GLOBALS['module']);
+                               if ($dummy == "done") COUNT_MODULE($GLOBALS['module']);
+                               unset($dummy);
+
+                               // Shall we activate the exchange?
+                               if ($_CONFIG['activate_xchange'] > 0) activateExchange();
+
+                               // Is the extension sql_patches installed and at least 0.3.6?
+                               if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
+                                       // Generate random number
+                                       if (isset($GLOBALS['userid'])) {
+                                               define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), $GLOBALS['userid'], ""));
+                                       } else {
+                                               define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), 0, ""));
+                                       }
+                               } else {
+                                       // Generate weak (!!!) code
+                                       define('RAND_NUMBER', mt_rand(1000000, 9999999));
+                               }
+                       } else {
+                               // Wrong database?
+                               ADD_FATAL(WRONG_DB_SELECTED);
+                       }
+               } else {
+                       // No link to database!
+                       ADD_FATAL(NO_DB_LINK);
+                       $db = false;
+               }
+       } else {
+               // Maybe you forgot to enter your MySQL data?
+               ADD_FATAL(MYSQL_DATA_MISSING);
+       }
+} else {
+       ///////////////////////////////////////////////////
+       // Include neccessary functions for installation //
+       ///////////////////////////////////////////////////
+
+       // Set CONFIG array
+       $_CONFIG = array(
+               'code_length' => 0
+       );
+
+       // Set other missing variables
+       $link = false; // No database link by default
+
+       // Include required files
+       require_once(PATH."inc/databases.php");
+       require_once(PATH."inc/theme-manager.php");
+
+       // Check if we are in installation routine
+       $installPhp = basename($_SERVER['PHP_SELF']);
+       if (($installPhp != "install.php") && ($CSS != "1") && ($CSS != -1)) {
+               // Redirect to the installation system
+               LOAD_URL("install.php");
+       } // END - if
+
+       // Double-check installation mode
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+               // Check for file permissions
+               if (!is_INCWritable("config")) {
+                       ADD_FATAL(CONFIG_IS_WRITE_PROTECTED);
+               }
+               if (!is_INCWritable("dummy")) {
+                       ADD_FATAL(DUMMY_IS_WRITE_PROTECTED);
+               }
+               if (!is_INCWritable(".secret/dummy")) {
+                       ADD_FATAL(SECRET_IS_WRITE_PROTECTED);
+               }
+       } // END - if
+}
+
+// Any fatal messages?
+if (!is_array($FATAL)) $FATAL = array();
+if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1"))
+{
+       // One or more fatal error(s) occur during connect...
+       include (PATH."inc/header.php");
+       include (PATH."inc/fatal_errors.php");
+       unset($FATAL);
+       include (PATH."inc/footer.php");
+       exit;
+}
+
+//
+?>
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
new file mode 100644 (file)
index 0000000..3ef6dee
--- /dev/null
@@ -0,0 +1,1924 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/26/2003 *
+ * ===============                              Last change: 11/29/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mysql-manager.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : All MySQL-related functions                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle MySQL-Relevanten Funktionen                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+function ADD_MODULE_TITLE($mod) {
+       global $cacheArray, $_CONFIG;
+       $name = ""; $result = false;
+
+       // Is the script installed?
+       if (isBooleanConstantAndTrue('mxchange_installed')) {
+               // Check if cache is valid
+               if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (in_array($mod, $cacheArray['modules']['module']))) {
+                       // Load from cache
+                       $name = $cacheArray['modules']['title'][$mod];
+
+                       // Update cache hits
+                       $_CONFIG['cache_hits']++;
+               } else {
+                       // Load from database
+                       $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__);
+                       list($name) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+               }
+       } // END - if
+
+       // Trim name
+       $name = trim($name);
+
+       // Still no luck or empty title?
+       if (empty($name)) {
+               // No name found
+               $name = LANG_UNKNOWN_MODULE." (".$mod.")";
+               if (SQL_NUMROWS($result) == 0) {
+                       // Add module to database
+                       $dummy = CHECK_MODULE($mod);
+               } // END - if
+       } // END - if
+
+       // Return name
+       return $name;
+}
+
+// Check validity of a given module name (no file extension)
+function CHECK_MODULE($mod) {
+       // We need them now here...
+       global $cacheArray, $_CONFIG, $cacheInstance;
+
+       // Filter module name (names with low chars and underlines are fine!)
+       $mod = preg_replace("/[^a-z_]/", "", $mod);
+
+       // Check for prefix is a extension...
+       $modSplit = explode("_", $mod);
+       $extension = ""; $mod_chk = $mod;
+       //* DEBUG: */ echo __LINE__."*".count($modSplit)."*/".$mod."*<br />";
+       if (count($modSplit) == 2) {
+               // Okay, there is a seperator (_) in the name so is the first part a module?
+               //* DEBUG: */ echo __LINE__."*".$modSplit[0]."*<br />";
+               if (EXT_IS_ACTIVE($modSplit[0])) {
+                       // The prefix is an extension's name, so let's set it
+                       $extension = $modSplit[0]; $mod = $modSplit[1];
+               }
+       }
+
+       // Major error in module registry is the default
+       $ret = "major";
+
+       // Check if script is installed if not return a "done" to prevent some errors
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
+
+       // Check if cache is latest version
+       $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
+       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (is_array($cacheArray['modules']['module']))) {
+               // Is the module cached?
+               if (isset($cacheArray['modules']['locked'][$mod_chk])) {
+                       // Check cache
+                       $locked = $cacheArray['modules']['locked'][$mod_chk];
+                       $hidden = $cacheArray['modules']['hidden'][$mod_chk];
+                       $admin  = $cacheArray['modules']['admin_only'][$mod_chk];
+                       $mem    = $cacheArray['modules']['mem_only'][$mod_chk];
+
+                       // Update cache hits
+                       $_CONFIG['cache_hits']++;
+                       $found = true;
+               } else {
+                       // No, then we have to update it!
+                       $ret = "cache_miss";
+               }
+       } else {
+               // Check for module in database
+               $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1", array($mod_chk), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Read data
+                       list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
+                       SQL_FREERESULT($result);
+                       $found = true;
+               }
+       }
+
+       // Check returned values against current access permissions
+       //
+       //  Admin access            ----- Guest access -----           --- Guest   or   member? ---
+       if ((IS_ADMIN()) || (($locked == "N") && ($admin == "N") && (($mem == "N") || (IS_MEMBER())))) {
+               // If you are admin you are welcome for everything!
+               $ret = "done";
+       } elseif ($locked == "Y") {
+               // Module is locked
+               $ret = "locked";
+       } elseif (($mem == "Y") && (!IS_MEMBER())) {
+               // You have to login first!
+               $ret = "mem_only";
+       } elseif (($admin == "Y") && (!IS_ADMIN())) {
+               // Only the Admin is allowed to enter this module!
+               $ret = "admin_only";
+       }
+
+       // Still no luck or not found?
+       if (($ret == "major") || ($ret == "cache_miss") || (!$found)) {
+               //              ----- Legacy module -----                                   ---- Module in base folder  ----                       --- Module with extension's name ---
+               if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", PATH, $extension, $mod)))) {
+                       // Data is missing so we add it
+                       if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
+                               // Since 0.3.6 we have a has_menu column, this took me a half hour
+                               // to find a loop here... *sigh*
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_mod_reg
+(module, locked, hidden, mem_only, admin_only, has_menu) VALUES
+('%s','Y','N','N','N','N')", array($mod_chk), __FILE__, __LINE__);
+                       } else {
+                               // Wrong/missing sql_patches!
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_mod_reg
+(module, locked, hidden, mem_only, admin_only) VALUES
+('%s','Y','N','N','N')", array($mod_chk), __FILE__, __LINE__);
+                       }
+
+                       // Everthing is fine?
+                       if (SQL_AFFECTEDROWS() < 1) {
+                               // Something bad happend!
+                               return "major";
+                       } // END - if
+
+                       // Destroy cache here
+                       REBUILD_CACHE("mod_reg", "modreg");
+
+                       // And reload data
+                       $ret = CHECK_MODULE($mod_chk);
+               } else {
+                       // Module not found we don't add it to the database
+                       $ret = "404";
+               }
+       } // END - if
+
+       // Return the value
+       return $ret;
+}
+
+// Add menu description pending on given file name (without path!)
+function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
+       global $DEPTH, $_CONFIG;
+       $LINK_ADD = ""; $OUT = ""; $AND = "";
+       // First we have to do some analysis...
+       if (ereg("action-", $file)) {
+               // This is an action file!
+               $type = "action";
+               $search = substr($file, 7);
+               switch ($ACC_LVL)
+               {
+               case "admin":
+                       $MOD_CHECK = "admin";
+                       break;
+
+               case "sponsor":
+               case "guest":
+               case "member":
+                       $MOD_CHECK = $GLOBALS['module'];
+                       break;
+               }
+               $AND = " AND (what='' OR what IS NULL)";
+       } elseif (ereg("what-", $file)) {
+               // This is an admin what file!
+               $type = "what";
+               $search = substr($file, 5);
+               $AND = "";
+               switch ($ACC_LVL)
+               {
+               case "admin":
+                       $MOD_CHECK = "admin";
+                       break;
+
+               case "guest":
+               case "member":
+                       $MOD_CHECK = $GLOBALS['module'];
+                       if (!IS_ADMIN()) {
+                               $AND = " AND visible='Y' AND locked='N'";
+                       }
+                       break;
+               }
+               $dummy = substr($search, 0, -4);
+               $AND .= " AND action='".GET_ACTION($ACC_LVL, $dummy)."'";
+       } elseif (($ACC_LVL == "sponsor") || ($ACC_LVL == "engine")) {
+               // Sponsor / engine menu
+               $type = "what";
+               $search = $file;
+               $MOD_CHECK = $GLOBALS['module'];
+               $AND = "";
+       } else {
+               // Other
+               $type = "menu";
+               $search = $file;
+               $MOD_CHECK = $GLOBALS['module'];
+               $AND = "";
+       }
+       if ((!isset($DEPTH)) && (!$return)) {
+               $DEPTH = 0;
+               $prefix = "<DIV class=\"you_are_here\">".YOU_ARE_HERE."&nbsp;<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</A></STRONG>";
+       } else {
+               if (!$return) $DEPTH++;
+               $prefix = "";
+       }
+
+       $prefix .= "&nbsp;-&gt;&nbsp;";
+
+       // We need to remove .php and the end
+       if (substr($search, -4, 4) == ".php") {
+               // Remove the .php
+               $search = substr($search, 0, -4);
+       } // END - i
+
+       // Get the title from menu
+       $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_%s_menu WHERE %s='%s' ".$AND." LIMIT 1",
+        array($ACC_LVL, $type, $search), __FILE__, __LINE__);
+
+       // Menu found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Load title
+               list($ret) = SQL_FETCHROW($result);
+
+               // Shall we return it?
+               if ($return) {
+                       // Return title
+                       return $ret;
+               } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) {
+                       // Output HTML code
+                       $OUT = $prefix."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$MOD_CHECK."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
+
+                       // Can we close the you-are-here navigation?
+                       //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
+                       //* DEBUG: */ die("<pre>".print_r($_CONFIG, true)."</pre>");
+                       if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
+                               //* DEBUG: */ echo __LINE__."+".$type."+<br />\n";
+                               $OUT .= "</div>\n";
+
+                               // Extension removeip activated?
+                               if ((EXT_IS_ACTIVE("removeip")) && (isset($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'])) && ($_CONFIG['removeip_'.strtolower($ACC_LVL).'_show'] == "Y")) {
+                                       // Add anoymity/privacy infos
+                                       $OUT .= REMOVEIP_ADD_INFOS();
+                               } // END - if
+
+                               // Add line-break tag
+                               $OUT .= "<br />\n";
+                               $DEPTH = "0";
+
+                               // Handle failed logins here if not in guest
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$type},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$ACC_LVL}<br />\n";
+                               if ((($type == "what") || ($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == $_CONFIG['index_home']))) && ($ACC_LVL != "guest") && ((GET_EXT_VERSION("sql_patches") >= "0.4.7") || (GET_EXT_VERSION("admins") >= "0.7.0"))) {
+                                       // Handle failture
+                                       $OUT .= HANDLE_LOGIN_FAILTURES($ACC_LVL);
+                               } // END - if
+                       } // END - if
+               }
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return or output HTML code?
+       if ($output) {
+               // Output HTML code here
+               OUTPUT_HTML($OUT);
+       } else {
+               // Return HTML code
+               return $OUT;
+       }
+}
+//
+function ADD_MENU($MODE, $act, $wht) {
+       global $_CONFIG;
+
+       // Init some variables
+       $main_cnt = 0;
+       $AND = "";
+       $main_action = "";
+       $sub_what = "";
+
+       if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) return CODE_MENU_NOT_VALID;
+
+       // Non-admin shall not see all menus
+       if (!IS_ADMIN()) {
+               $AND = "AND visible='Y' AND locked='N'";
+       }
+
+       // Load SQL data and add the menu to the output stream...
+       $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort",
+        array($MODE), __FILE__, __LINE__);
+       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+       if (SQL_NUMROWS($result_main) > 0) {
+               OUTPUT_HTML("<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$MODE."_menu\">");
+               // There are menus available, so we simply display them... :)
+               while (list($main_title, $main_action) = SQL_FETCHROW($result_main)) {
+                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                       // Init variables
+                       $BLOCK_MODE = false; $act = $main_action;
+
+                       // Prepare content
+                       $content = array(
+                               'action' => $main_action,
+                               'title'  => $main_title
+                       );
+
+                       // Load menu header template
+                       LOAD_TEMPLATE($MODE."_menu_title", false, $content);
+
+                       $result_sub = SQL_QUERY_ESC("SELECT title, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ".$AND." ORDER BY sort",
+                        array($MODE, $main_action), __FILE__, __LINE__);
+                       $ctl = SQL_NUMROWS($result_sub);
+                       if ($ctl > 0) {
+                               $cnt=0;
+                               while (list($sub_title, $sub_what) = SQL_FETCHROW($result_sub)) {
+                                       // Init content
+                                       $content = "";
+
+                                       // Full file name for checking menu
+                                       //* DEBUG: */ echo __LINE__.":!!!!".$sub_what."!!!<br />\n";
+                                       $test_inc = sprintf("%sinc/modules/%s/what-%s.php", PATH, $MODE, $sub_what);
+                                       $test = (FILE_READABLE($test_inc));
+                                       if ($test) {
+                                               if ((!empty($wht)) && (($wht == $sub_what))) {
+                                                       $content = "<STRONG>";
+                                               }
+
+                                               // Navigation link
+                                               $content .= "<A name=\"menu\" class=\"menu_blur\" href=\"".URL."/modules.php?module=".$GLOBALS['module']."&amp;what=".$sub_what.ADD_URL_DATA("")."\" target=\"_self\">";
+                                       } else {
+                                               $content .= "<I>";
+                                       }
+
+                                       // Menu title
+                                       $content .= $_CONFIG['menu_blur_spacer'].$sub_title;
+
+                                       if ($test) {
+                                               $content .= "</A>";
+                                       } else {
+                                               $content .= "</I>";
+                                       }
+
+                                       if ((!empty($wht)) && (($wht == $sub_what))) {
+                                               $content .= "</STRONG>";
+                                       }
+                                       $wht = $sub_what; $cnt++;
+                                       // Prepare array
+                                       $content =  array(
+                                               'menu' => $content,
+                                               'what' => $sub_what
+                                       );
+
+                                       // Add regular menu row or bottom row?
+                                       if ($cnt < $ctl) {
+                                               LOAD_TEMPLATE($MODE."_menu_row", false, $content);
+                                       } else {
+                                               LOAD_TEMPLATE($MODE."_menu_bottom", false, $content);
+                                       }
+                               }
+                       } else {
+                               // This is a menu block... ;-)
+                               $BLOCK_MODE = true;
+                               $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
+                               if (FILE_READABLE($INC_BLOCK)) {
+                                       // Load include file
+                                       if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("<TR>
+  <TD class=\"".$MODE."_menu_whats\">");
+                                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                                       include ($INC_BLOCK);
+                                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                                       if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("  </TD>
+</TR>");
+                               }
+                               //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                       }
+                       $main_cnt++;
+                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                       if (SQL_NUMROWS($result_main) > $main_cnt)      OUTPUT_HTML("<TR><TD class=\"".$MODE."_menu_seperator\"></TD></TR>");
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_main);
+
+               // Close table
+               //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+               OUTPUT_HTML("</TABLE>");
+       }
+}
+// This patched function will reduce many SELECT queries for the specified or current admin login
+function IS_ADMIN($admin="")
+{
+       global $cacheArray, $_CONFIG;
+       $ret = false; $passCookie = ""; $valPass = "";
+       //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
+
+       // If admin login is not given take current from cookies...
+       if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
+               // Get admin login and password from session/cookies
+               $admin = get_session('admin_login');
+               $passCookie = get_session('admin_md5');
+       }
+       //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
+
+       // Search in array for entry
+       if (isset($cacheArray['admin_hash'])) {
+               // Use cached string
+               $valPass = $cacheArray['admin_hash'];
+       } elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) {
+               // Count cache hits
+               $_CONFIG['cache_hits']++;
+
+               // Login data is valid or not?
+               $valPass = generatePassString($cacheArray['admins']['password'][$admin]);
+
+               // Cache it away
+               $cacheArray['admin_hash'] = $valPass;
+       } elseif (!empty($admin)) {
+               // Search for admin
+               $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+                array($admin), __FILE__, __LINE__);
+
+               // Is he admin?
+               $passDB = "";
+               if (SQL_NUMROWS($result) == 1) {
+                       // Admin login was found so let's load password from DB
+                       list($passDB) = SQL_FETCHROW($result);
+
+                       // Temporary cache it
+                       $cacheArray['admins']['password'][$admin] = $passDB;
+
+                       // Generate password hash
+                       $valPass = generatePassString($passDB);
+               } // END - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+
+       if (!empty($valPass)) {
+               // Check if password is valid
+               //* DEBUG: */ print __FUNCTION__."*".$valPass."/".$passCookie."*<br />\n";
+               $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE("cache"))));
+       }
+
+       // Return result of comparision
+       //* DEBUG: */ if (!$ret) echo __LINE__."OK!<br />";
+       return $ret;
+}
+//
+function ADD_MAX_RECEIVE_LIST($MODE, $default="", $return=false)
+{
+       global $_POST;
+       $OUT = "";
+       switch ($MODE)
+       {
+       case "guest":
+               // Guests (in the registration form) are not allowed to select 0 mails per day.
+               $result = SQL_QUERY("SELECT value, comment FROM "._MYSQL_PREFIX."_max_receive WHERE value > 0 ORDER BY value", __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       $OUT = "";
+                       while (list($value, $comment) = SQL_FETCHROW($result))
+                       {
+                               $OUT .= "      <OPTION value=\"".$value."\"";
+                               if ($_POST['max_mails'] == $value) $OUT .= " selected=\"selected\"";
+                               $OUT .= ">".$value." ".PER_DAY;
+                               if (!empty($comment)) $OUT .= " (".$comment.")";
+                               $OUT .= "</OPTION>\n";
+                       }
+                       define('__MAX_RECEIVE_OPTIONS', $OUT);
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+                       $OUT = LOAD_TEMPLATE("guest_receive_table", true);
+               }
+                else
+               {
+                       // Maybe the admin has to setup some maximum values?
+               }
+               break;
+
+       case "member":
+               // Members are allowed to set to zero mails per day (we will change this soon!)
+               $result = SQL_QUERY("SELECT value, comment FROM "._MYSQL_PREFIX."_max_receive ORDER BY value", __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0)
+               {
+                       $OUT = "";
+                       while (list($value, $comment) = SQL_FETCHROW($result))
+                       {
+                               $OUT .= "      <OPTION value=\"".$value."\"";
+                               if ($default == $value) $OUT .= " selected=\"selected\"";
+                               $OUT .= ">".$value." ".PER_DAY;
+                               if (!empty($comment)) $OUT .= " (".$comment.")";
+                               $OUT .= "</OPTION>\n";
+                       }
+                       define('__MAX_RECEIVE_OPTIONS', $OUT);
+                       SQL_FREERESULT($result);
+                       $OUT = LOAD_TEMPLATE("member_receive_table", true);
+               }
+                else
+               {
+                       // Maybe the admin has to setup some maximum values?
+                       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, NO_MAX_VALUES);
+               }
+               break;
+       }
+       if ($return)
+       {
+               // Return generated HTML code
+               return $OUT;
+       }
+        else
+       {
+               // Output directly (default)
+               OUTPUT_HTML($OUT);
+       }
+}
+//
+function SEARCH_EMAIL_USERTAB($email)
+{
+       $ret = false;
+       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE email LIKE '{PER}%s{PER}' LIMIT 1", array($email), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) $ret = true;
+       SQL_FREERESULT($result);
+       return $ret;
+}
+//
+function WHAT_IS_VALID($act, $wht, $type="guest")
+{
+       if (IS_ADMIN())
+       {
+               // Everything is valid to the admin :-)
+               return true;
+       }
+        else
+       {
+               $ret = false;
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what='%s' AND locked='N' LIMIT 1", array($type, $act, $wht), __FILE__, __LINE__);
+               // Is "what" valid?
+               if (SQL_NUMROWS($result) == 1) $ret = true;
+               SQL_FREERESULT($result);
+               return $ret;
+       }
+}
+//
+function IS_MEMBER()
+{
+       global $status, $LAST, $cacheArray;
+       if (!is_array($LAST)) $LAST = array();
+       $ret = false;
+
+       // is the cache entry there?
+       if (isset($cacheArray['is_member'])) {
+               // Then return it
+               return $cacheArray['is_member'];
+       } // END - if
+
+       // Fix "deleted" cookies first
+       FIX_DELETED_COOKIES(array('userid','u_hash','lifetime'));
+
+       // Are cookies set?
+       if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash')) && (isSessionVariableSet('lifetime')) && (defined('COOKIE_PATH')))
+       {
+               // Cookies are set with values, but are they valid?
+               $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                array($GLOBALS['userid']), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1)
+               {
+                       // Load data from cookies
+                       list($password, $status, $mod, $onl) = SQL_FETCHROW($result);
+
+                       // Validate password by created the difference of it and the secret key
+                       $valPass = generatePassString($password);
+
+                       // Transfer last module and online time
+                       if ((!empty($mod)) && (empty($LAST['module']))) { $LAST['module'] = $mod; $LAST['online'] = $onl; }
+
+                       // So did we now have valid data and an unlocked user?
+                       //* DEBUG: */ echo $valPass."<br />".get_session('u_hash')."<br />";
+                       if (($status == "CONFIRMED") && ($valPass == get_session('u_hash'))) {
+                               // Account is confirmed and all cookie data is valid so he is definely logged in! :-)
+                               $ret = true;
+                       } else {
+                               // Maybe got locked etc.
+                               //* DEBUG: */ echo __LINE__."!!!<br />";
+                               destroy_user_session();
+
+                               // Reset userid
+                               $GLOBALS['userid'] = 0;
+                       }
+               } else {
+                       // Cookie data is invalid!
+                       //* DEBUG: */ echo __LINE__."***<br />";
+                       destroy_user_session();
+
+                       // Reset userid
+                       $GLOBALS['userid'] = 0;
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } else {
+               // Cookie data is invalid!
+               //* DEBUG: */ echo __LINE__."///<br />";
+               destroy_user_session();
+
+               // Reset userid
+               $GLOBALS['userid'] = 0;
+       }
+
+       // Cache status
+       $cacheArray['is_member'] = $ret;
+
+       // Return status
+       return $ret;
+}
+//
+function UPDATE_LOGIN_DATA () {
+       global $LAST, $_CONFIG;
+       if (!is_array($LAST)) $LAST = array();
+
+       // Recheck if logged in
+       if (!IS_MEMBER()) return false;
+
+       // Secure user ID
+       $GLOBALS['userid'] = bigintval(get_session('userid'));
+
+       // Extract last online time (life) and how long is auto-login valid (time)
+       $newl = time() + bigintval(get_session('lifetime'));
+
+       // Load last module and last online time
+       $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Load last module and online time
+               list($mod, $onl) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Maybe first login time?
+               if (empty($mod)) $mod = "login";
+
+               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
+                       // This will be displayed on welcome page! :-)
+                       if (empty($LAST['module'])) {
+                               $LAST['module'] = $mod; $LAST['online'] = $onl;
+                       } // END - if
+
+                       // "what" not set?
+                       if (empty($GLOBALS['what'])) {
+                               // Fix it to default
+                               $GLOBALS['what'] = "welcome";
+                               if (!empty($_CONFIG['index_home'])) $GLOBALS['what'] = $_CONFIG['index_home'];
+                       } // END - if
+
+                       // Update last module / online time
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
+                        array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
+               }
+       }  else {
+               // Destroy session, we cannot update!
+               destroy_user_session();
+       }
+}
+//
+function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false)
+{
+       $ret = false;
+       $ADD = "";
+       if ((!IS_ADMIN()) && ($MODE != "admin")) $ADD = " AND locked='N'";
+       //* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*<br />\n";
+       if (($MODE != "admin") && ($UPDATE))
+       {
+               // Update guest or member menu
+               $SQL = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_%s_menu SET counter=counter+1 WHERE action='%s' AND what='%s'".$ADD." LIMIT 1",
+                array($MODE, $act, $wht), __FILE__, __LINE__, false);
+       }
+        elseif ($wht != "overview")
+       {
+               // Other actions
+               $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s'".$ADD." ORDER BY action DESC LIMIT 1",
+                array($MODE, $act), __FILE__, __LINE__, false);
+       }
+        else
+       {
+               // Admin login overview
+               $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND (what='' OR what IS NULL)".$ADD." ORDER BY action DESC LIMIT 1",
+                array($MODE, $act), __FILE__, __LINE__, false);
+       }
+
+       // Run SQL command
+       $result = SQL_QUERY($SQL, __FILE__, __LINE__);
+       if ($UPDATE)
+       {
+               if (SQL_AFFECTEDROWS() == 1) $ret = true;
+               //* DEBUG: */ debug_print_backtrace();
+       }
+        else
+       {
+               if (SQL_NUMROWS($result) == 1) {
+                       list($id, $wht2) = SQL_FETCHROW($result);
+                       //* DEBUG: */ echo __LINE__."+".$SQL."+<br />\n";
+                       //* DEBUG: */ echo __LINE__."*".$id."/".$wht."/".$wht2."*<br />\n";
+                       $ret = true;
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $ret;
+}
+//
+function GET_MOD_DESCR($MODE, $wht, $column="what")
+{
+       // Fix empty "what"
+       if (empty($wht)) {
+               $wht = "welcome";
+               if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home'];
+       } // END - if
+
+       // Default is not found
+       $ret = "??? (".$wht.")";
+
+       // Look for title
+       $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_%s_menu WHERE %s='%s' LIMIT 1",
+               array($MODE, $column, $wht), __FILE__, __LINE__);
+
+       // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch the title
+               list($ret) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+       return $ret;
+}
+//
+function SEND_MODE_MAILS($mod, $modes)
+{
+       global $_CONFIG, $DATA;
+
+       // Load hash
+       $result_main = SQL_QUERY_ESC("SELECT password FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result_main) == 1) {
+               // Load hash from database
+               list($hashDB) = SQL_FETCHROW($result_main);
+
+               // Extract salt from cookie
+               $salt = substr(get_session('u_hash'), 0, -40);
+
+               // Now let's compare passwords
+               $hash = generatePassString($hashDB);
+               if (($hash == get_session('u_hash')) || ($_POST['pass1'] == $_POST['pass2'])) {
+                       // Load user's data
+                       $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND password='%s' LIMIT 1",
+                        array($GLOBALS['userid'], $hashDB), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1) {
+                               // Load the data
+                               $DATA = SQL_FETCHROW($result);
+
+                               // Free result
+                               SQL_FREERESULT($result);
+
+                               // Translate gender
+                               $DATA[0] = TRANSLATE_GENDER($DATA[0]);
+
+                               // Clear/init the content variable
+                               $content = "";
+                               $DATA['info'] = "";
+
+                               switch ($mod)
+                               {
+                               case "mydata":
+                                       foreach ($modes as $mode) {
+                                               switch ($mode)
+                                               {
+                                               case "normal": break; // Do not add any special lines
+
+                                               case "email": // Email was changed!
+                                                       $content = MEMBER_CHANGED_EMAIL.": ".$_POST['old_addy']."\n";
+                                                       break;
+
+                                               case "pass": // Password was changed
+                                                       $content = MEMBER_CHANGED_PASS."\n";
+                                                       break;
+
+                                               default:
+                                                       $content = MEMBER_UNKNOWN_MODE.": ".$mode."\n\n";
+                                                       break;
+                                               }
+                                       } // END - if
+
+                                       if (EXT_IS_ACTIVE("country")) {
+                                               // Replace code with description
+                                               $DATA[4] = COUNTRY_GENERATE_INFO($_POST['country_code']);
+                                       }
+
+                                       // Load template
+                                       $msg = LOAD_EMAIL_TEMPLATE("member_mydata_notify", $content, $GLOBALS['userid']);
+
+                                       if ($_CONFIG['admin_notify'] == "Y") {
+                                               // The admin needs to be notified about a profile change
+                                               $msg_admin = "admin_mydata_notify";
+                                               $sub_adm = ADMIN_CHANGED_DATA;
+                                       } else {
+                                               // No mail to admin
+                                               $msg_admin = "";
+                                               $sub_adm = "";
+                                       }
+
+                                       // Set subject lines
+                                       $sub_mem = MEMBER_CHANGED_DATA;
+
+                                       // Output success message
+                                       $content = "<STRONG><SPAN class=\"member_done\">".MYDATA_MAIL_SENT."</SPAN></STRONG>";
+                                       break;
+
+                               default:
+                                       $content = "<STRONG><SPAN class=\"member_failed\">".UNKNOWN_MODULE."</SPAN></STRONG>";
+                                       break;
+                               }
+                       } else {
+                               // Could not load profile data
+                               $content = "<STRONG><SPAN class=\"member_failed\">".MEMBER_CANNOT_LOAD_PROFILE."</SPAN></STRONG>";
+                       }
+               } else {
+                       // Passwords mismatch
+                       $content = "<STRONG><SPAN class=\"member_failed\">".MEMBER_PASSWORD_ERROR."</SPAN></STRONG>";
+               }
+       } else {
+               // Could not load profile
+               $content = "<STRONG><SPAN class=\"member_failed\">".MEMBER_CANNOT_LOAD_PROFILE."</SPAN></STRONG>";
+       }
+
+       // Send email to user if required
+       if ((!empty($sub_mem)) && (!empty($msg))) {
+               // Send member mail
+               SEND_EMAIL($DATA[7], $sub_mem, $msg);
+       }
+
+       // Send only if no other error has occured
+       if (empty($content)) {
+               if ((!empty($sub_adm)) && (!empty($msg_admin))) {
+                       // Send admin mail
+                       SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, $GLOBALS['userid']);
+               } elseif ($_CONFIG['admin_notify'] == "Y") {
+                       // Cannot send mails to admin!
+                       $content = CANNOT_SEND_ADMIN_MAILS;
+               } else {
+                       // No mail to admin
+                       $content = "<STRONG><SPAN class=\"member_done\">".MYDATA_MAIL_SENT."</SPAN></STRONG>";
+               }
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_settings_saved", false, $content);
+}
+// Update module counter
+function COUNT_MODULE($mod)
+{
+       if ($mod != "css")
+       {
+               // Do count all other modules but not accesses on CSS file css.php!
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_mod_reg SET clicks=clicks+1 WHERE module='%s' LIMIT 1",
+                array($mod), __FILE__, __LINE__);
+       }
+}
+// Get action value from mode (admin/guest/member) and what-value
+function GET_ACTION ($MODE, &$wht)
+{
+       global $ret, $_CONFIG;
+       // @DEPRECATED Init status
+       $ret = "";
+
+       //* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=<br />";
+       if ((empty($wht)) && ($MODE != "admin")) {
+               $wht = "welcome";
+               if (!empty($_CONFIG['index_home'])) $wht = $_CONFIG['index_home'];
+       } // END - if
+
+       if ($MODE == "admin") {
+               // Action value for admin area
+               if (!empty($GLOBALS['action'])) {
+                       // Get it directly from URL
+                       return $GLOBALS['action'];
+               } elseif (($wht == "overview") || (empty($GLOBALS['what']))) {
+                       // Default value for admin area
+                       $ret = "login";
+               }
+       } elseif (!empty($GLOBALS['action'])) {
+               // Get it directly from URL
+               return $GLOBALS['action'];
+       }
+       //* DEBUG: */ echo __LINE__."*".$ret."*<br />\n";
+
+       if (MODULE_HAS_MENU($MODE)) {
+               // Rewriting modules to menu
+               switch ($MODE) {
+                       case "index": $MODE = "guest";  break;
+                       case "login": $MODE = "member"; break;
+               } // END - switch
+
+               // Guest and member menu is "main" as the default
+               if (empty($ret)) $ret = "main";
+
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='%s' LIMIT 1",
+                array($MODE, $wht), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load action value and pray that this one is the right you want... ;-)
+                       list($ret) = SQL_FETCHROW($result);
+               } // END - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Return action value
+       return $ret;
+}
+//
+function GET_CATEGORY ($cid) {
+       // Default is not found
+       $ret = _CATEGORY_404;
+
+       // Is the category id set?
+       if ($cid == "0") {
+               // No category
+               $ret = _CATEGORY_NONE;
+       } elseif ($cid > 0) {
+               // Lookup the category in database
+               $result = SQL_QUERY_ESC("SELECT cat FROM "._MYSQL_PREFIX."_cats WHERE id=%s LIMIT 1",
+                       array(bigintval($cid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Category found... :-)
+                       list($ret) = SQL_FETCHROW($result);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       } // END - if
+
+       // Return result
+       return $ret;
+}
+//
+function GET_PAYMENT ($pid, $full=false) {
+       // Default is not found
+       $ret = _PAYMENT_404;
+
+       // Load payment data
+       $result = SQL_QUERY_ESC("SELECT mail_title, price FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
+               array(bigintval($pid)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Payment type found... :-)
+               if (!$full) {
+                       // Return only title
+                       list($ret) = SQL_FETCHROW($result);
+               } else {
+                       // Return title and price
+                       list($t, $p) = SQL_FETCHROW($result);
+                       $ret = $t." / ".TRANSLATE_COMMA($p)." ".POINTS;
+               }
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $ret;
+}
+//
+function GET_PAY_POINTS($pid, $lookFor="price")
+{
+       $ret = "-1";
+       $result = SQL_QUERY_ESC("SELECT %s FROM "._MYSQL_PREFIX."_payments WHERE id=%s LIMIT 1",
+               array($lookFor, $pid), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1)
+       {
+               // Payment type found... :-)
+               list($ret) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+       }
+       return $ret;
+}
+// Remove a receiver's ID from $ARRAY and add a link for him to confirm
+function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=false)
+{
+       $ret = "failed";
+       if ($uid > 0)
+       {
+               // Remove entry from array
+               unset($ARRAY[$key]);
+
+               // Is there already a line for this user available?
+               if ($stats_id > 0)
+               {
+                       // Only when we got a real stats ID continue searching for the entry
+                       $type = "NORMAL"; $rowName = "stats_id";
+                       if ($bonus) { $type = "BONUS"; $rowName = "bonus_id"; }
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1",
+                        array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 0)
+                       {
+                               // No, so we add one!
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_links (%s, userid, link_type) VALUES ('%s','%s','%s')",
+                                array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__);
+                               $ret = "done";
+                       }
+                        else
+                       {
+                               // Already found
+                               $ret = "already";
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               }
+       }
+       // Return status for sending routine
+       return $ret;
+}
+//
+function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false) {
+       $ret = 0;
+       if ($onlyRows) {
+               // Count rows
+               $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
+                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+       } else {
+               // Add all rows
+               $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
+                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+       }
+
+       // Load row
+       list($ret) = SQL_FETCHROW($result);
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Fix empty values
+       if ((empty($ret)) && ($lookFor != "counter") && ($lookFor != "id") && ($lookFor != "userid")) {
+               $ret = "0.00000";
+       } // END - if
+
+       // Return value
+       return $ret;
+}
+// "Getter fro ref level percents
+function GET_REF_LEVEL_PERCENTS ($level) {
+       global $cacheInstance, $_CONFIG, $cacheArray;
+
+       // Default is zero
+       $per = 0;
+
+       // Do we have cache?
+       if ((isset($cacheArray['ref_depths']['level'])) && (EXT_IS_ACTIVE("cache"))) {
+               // First look for level
+               $key = array_search($level, $cacheArray['ref_depths']['level']);
+               if ($key !== false) {
+                       // Entry found!
+                       $per = $cacheArray['ref_depths']['percents'][$key];
+
+                       // Count cache hit
+                       $_CONFIG['cache_hits']++;
+               }
+       } else {
+               // Get referal data
+               $result_lvl = SQL_QUERY_ESC("SELECT percents FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
+                       array(bigintval($level)), __FILE__, __LINE__);
+
+               // Entry found?
+               if (SQL_NUMROWS($result_lvl) == 1) {
+                       // Get percents
+                       list($per) = SQL_FETCHROW($result_lvl);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result_lvl);
+       }
+
+       // Return percent
+       return $per;
+}
+/**
+ *
+ * Dynamic referral system, can also send mails!
+ *
+ * uid         = Referral ID wich should receive...
+ * points      = ... xxx points
+ * send_notify = shall I send the referral an email or not?
+ * rid         = inc/modules/guest/what-confirm.php need this (DEPRECATED???)
+ * locked      = Shall I pay it to normal (false) or locked (true) points ammount?
+ * add_mode    = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
+ *               for default value will cause no referral will get points ever!!!)
+ */
+function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
+       //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+       global $DEPTH, $_CONFIG, $DATA, $cacheArray;
+
+       // Convert mode to lower-case
+       $add_mode = strtolower($add_mode);
+
+       // When $uid = 0 add points to jackpot
+       if ($uid == "0") {
+               // Add points to jackpot
+               ADD_JACKPOT($points);
+               return;
+       } // END - if
+
+       // Count up referral depth
+       if (!isset($DEPTH)) {
+               // Initialialize referral system
+               $DEPTH = 0;
+       } else {
+               // Increase referral level
+               $DEPTH++;
+       }
+
+       // Default is "normal" points
+       $data = "points";
+
+       // Which points, locked or normal?
+       if ($locked) $data = "locked_points";
+
+       // Check user account
+       $result_user = SQL_QUERY_ESC("SELECT refid, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+        array(bigintval($uid)), __FILE__, __LINE__);
+
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
+       if (SQL_NUMROWS($result_user) == 1) {
+               // This is the user and his ref
+               list($ref, $email) = SQL_FETCHROW($result_user);
+               $cacheArray['add_uid'][$ref] = $uid;
+
+               // Get percents
+               $per = GET_REF_LEVEL_PERCENTS($DEPTH);
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$DEPTH},per={$per},mode={$add_mode}<br />\n";
+
+               // Some percents found?
+               if ($per > 0) {
+                       // Calculate new points
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},per={$per},depth={$DEPTH}<br />\n";
+                       $ref_points = $points * $per / 100;
+
+                       // Pay refback here if level > 0 and in ref-mode
+                       if ((EXT_IS_ACTIVE("refback")) && ($DEPTH > 0) && ($per < 100) && ($add_mode == "ref") && (isset($cacheArray['add_uid'][$uid]))) {
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - BEFORE!<br />\n";
+                               $ref_points = ADD_REFBACK_POINTS($cacheArray['add_uid'][$uid], $uid, $points, $ref_points);
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$DEPTH} - AFTER!<br />\n";
+                       } // END - if
+
+                       // Update points...
+                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET %s=%s+%s WHERE userid=%s AND ref_depth='%s' LIMIT 1",
+                        array($data, $data, $ref_points, bigintval($uid), bigintval($DEPTH)), __FILE__, __LINE__);
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$DEPTH},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
+
+                       // No entry updated?
+                       if (SQL_AFFECTEDROWS() < 1) {
+                               // First ref in this level! :-)
+                               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_points (userid,ref_depth,%s) VALUES (%s,%s,%s)",
+                                array($data, bigintval($uid), bigintval($DEPTH), $ref_points), __FILE__, __LINE__);
+                       } // END - if
+
+                       // Update mediadata as well
+                       if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
+                               // Update database
+                               MEDIA_UPDATE_ENTRY(array("total_points"), "add", $ref_points);
+                       } // END - if
+
+                       // Points updated, maybe I shall send him an email?
+                       if (($send_notify) && ($ref > 0) && (!$locked)) {
+                               // Prepare content
+                               $content = array(
+                                       'percent' => $per,
+                                       'level'   => bigintval($DEPTH),
+                                       'points'  => $ref_points,
+                                       'refid'   => bigintval($ref)
+                               );
+
+                               // Load email template
+                               $msg = LOAD_EMAIL_TEMPLATE("confirm-referral", $content, bigintval($uid));
+
+                               SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
+                       } elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
+                               // Direct payment shall be notified about
+                               define('__POINTS_VALUE', $ref_points);
+
+                               // Prepare content
+                               $content = array(
+                                       'text'   => REASON_DIRECT_PAYMENT,
+                                       'points' => TRANSLATE_COMMA($ref_points)
+                               );
+
+                               // Load message
+                               $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, $uid);
+
+                               // And sent it away
+                               SEND_EMAIL($email, SUBJECT_DIRECT_PAYMENT, $msg);
+                               if (!isset($_GET['mid'])) LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_ADDED);
+                       }
+
+                       // Maybe there's another ref?
+                       if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == "ref")) {
+                               // Then let's credit him here...
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
+                               ADD_POINTS_REFSYSTEM($ref, $points, $send_notify, $ref, $locked);
+                       } // END - if
+               } // END - if
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result_user);
+       //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+}
+//
+function UPDATE_REF_COUNTER ($uid) {
+       global $cacheArray, $cacheInstance;
+
+       // Make it sure referral level zero (member him-/herself) is at least selected
+       if (empty($cacheArray['ref_level'][$uid])) $cacheArray['ref_level'][$uid] = 1;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
+
+       // Update counter
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
+               array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
+
+       // When no entry was updated then we have to create it here
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
+       if (SQL_AFFECTEDROWS() < 1) {
+               // First count!
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_refsystem (userid, level, counter) VALUES (%s,%s,1)",
+                       array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
+       } // END - if
+
+       // Check for his referral
+       $result = SQL_QUERY_ESC("SELECT refid FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+               array(bigintval($uid)), __FILE__, __LINE__);
+
+       // Load refid
+       list($ref) = SQL_FETCHROW($result);
+
+       // Free memory
+       SQL_FREERESULT($result);
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref}<br />\n";
+
+       // When he has a referral...
+       if (($ref > 0) && ($ref != $uid)) {
+               // Move to next referral level and count his counter one up!
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
+               $cacheArray['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
+       } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2")) {
+               // Remove cache here
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
+               if ($cacheInstance->cache_file("refsystem", true)) $cacheInstance->cache_destroy();
+       }
+
+       // "Walk" back here
+       $cacheArray['ref_level'][$uid]--;
+
+       // Handle refback here if extension is installed
+       if (EXT_IS_ACTIVE("refback")) {
+               UPDATE_REFBACK_TABLE($uid);
+       } // END - if
+}
+// Updates/extends the online list
+function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht) {
+       global $_CONFIG;
+
+       // Do not update online list when extension is deactivated
+       if (!EXT_IS_ACTIVE("online", true)) return;
+
+       // Empty session?
+       if (empty($SID)) {
+               // This is invalid here!
+               print "Invalid session. Backtrace:<pre>";
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
+       // Initialize variables
+       $uid = 0; $rid = 0; $MEM = "N"; $ADMIN = "N";
+
+       // Valid userid?
+       if ((!empty($GLOBALS['userid'])) && ($GLOBALS['userid'] > 0) && (IS_MEMBER())) {
+               // Is valid user
+               $uid = bigintval($GLOBALS['userid']);
+               $MEM = "Y";
+       } // END - if
+
+       if (IS_ADMIN()) {
+               // Is administrator
+               $ADMIN = "Y";
+       } // END - if
+
+       if (isSessionVariableSet('up_refid')) {
+               // Check cookie
+               if (get_session('refid') > 0) $rid = bigintval($GLOBALS['refid']);
+       } // END - if
+
+       // Now search for the user
+       $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_online
+WHERE sid='%s' LIMIT 1",
+ array($SID), __FILE__, __LINE__);
+
+       // Entry found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Then update it
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_online SET
+module='%s',
+action='%s',
+what='%s',
+userid=%s,
+refid=%s,
+is_member='%s',
+is_admin='%s',
+timestamp=UNIX_TIMESTAMP()
+WHERE sid='%s' LIMIT 1",
+                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID), __FILE__, __LINE__
+               );
+       } else {
+               // No entry does exists so we simply add it!
+               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_online (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
+                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID, GET_REMOTE_ADDR()), __FILE__, __LINE__
+               );
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Purge old entries
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
+        array($_CONFIG['online_timeout']), __FILE__, __LINE__);
+}
+// OBSULETE: Sends out mail to all administrators
+function SEND_ADMIN_EMAILS($subj, $msg) {
+       // Load all admin email addresses
+       $result = SQL_QUERY("SELECT email FROM "._MYSQL_PREFIX."_admins ORDER BY id ASC", __FILE__, __LINE__);
+       while (list($email) = SQL_FETCHROW($result)) {
+               // Send the email out
+               SEND_EMAIL($email, $subj, $msg);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Really simple... ;-)
+}
+// Get ID number from administrator's login name
+function GET_ADMIN_ID($login) {
+       global $cacheArray, $_CONFIG;
+       $ret = "-1";
+       if (!empty($cacheArray['admins']['aid'][$login])) {
+               // Check cache
+               $ret = $cacheArray['admins']['aid'][$login];
+
+               // Update cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+                array($login), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       list($ret) = SQL_FETCHROW($result);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+       return $ret;
+}
+//
+// Get password hash from administrator's login name
+function GET_ADMIN_HASH($login)
+{
+       global $cacheArray, $_CONFIG;
+       $ret = "-1";
+       if (!empty($cacheArray['admins']['password'][$login])) {
+               // Check cache
+               $ret = $cacheArray['admins']['password'][$login];
+
+               // Update cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT password FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
+                array($login), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch data
+                       list($ret) = SQL_FETCHROW($result);
+
+                       // Set cache
+                       $cacheArray['admins']['password'][$login] = $ret;
+               }
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+       return $ret;
+}
+//
+function GET_ADMIN_LOGIN ($aid) {
+       global $cacheArray, $_CONFIG;
+       $ret = "***";
+       if (!empty($cacheArray['admins']['login'][$aid])) {
+               // Get cache
+               $ret = $cacheArray['admins']['login'][$aid];
+
+               // Update cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result = SQL_QUERY_ESC("SELECT login FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                       array(bigintval($aid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch data
+                       list($ret) = SQL_FETCHROW($result);
+
+                       // Set cache
+                       $cacheArray['admins']['login'][$aid] = $ret;
+               } // END - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+       }
+       return $ret;
+}
+// Get email address of admin id
+function GET_ADMIN_EMAIL ($aid) {
+       global $cacheArray, $_CONFIG;
+
+       $ret = "***";
+       if (!empty($cacheArray['admins']['email'])) {
+               // Get cache
+               $ret = $cacheArray['admins']['email'][$aid];
+
+               // Update cache hits
+               $_CONFIG['cache_hits']++;
+       } elseif (!EXT_IS_ACTIVE("cache")) {
+               // Load from database
+               $result_aid = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                       array(bigintval($ret)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Get data
+                       list($ret) = SQL_FETCHROW($result_aid);
+
+                       // Set cache
+                       $cacheArray['admins']['email'][$aid] = $ret;
+                       } // END - if
+
+               // Free result
+               SQL_FREERESULT($result_aid);
+       }
+
+       // Return email
+       return $ret;
+}
+// Get default ACL  of admin id
+function GET_ADMIN_DEFAULT_ACL ($aid) {
+       global $cacheArray, $_CONFIG;
+
+       $ret = "***";
+       if (!empty($cacheArray['admins']['def_acl'])) {
+               // Use cache
+               $ret = $cacheArray['admins']['def_acl'][$aid];
+
+               // Update cache hits
+               $_CONFIG['cache_hits']++;
+       } else {
+               // Load from database
+               $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1",
+                       array(bigintval($ret)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch data
+                       list($ret) = SQL_FETCHROW($result_aid);
+
+                       // Set cache
+                       $cacheArray['admins']['def_acl'][$aid] = $ret;
+               }
+
+               // Free result
+               SQL_FREERESULT($result_aid);
+       }
+
+       // Return email
+       return $ret;
+}
+//
+function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="") {
+       $ret = "";
+       if ($table == "/ARRAY/") {
+               // Selection from array
+               if (is_array($id) && is_array($name) && sizeof($id) == sizeof($name)) {
+                       // Both are arrays
+                       foreach ($id as $idx => $value) {
+                               $ret .= "<OPTION value=\"".$value."\"";
+                               if ($default == $value) $ret .= " selected checked";
+                               $ret .= ">".$name[$idx]."</OPTION>\n";
+                       } // END - foreach
+               } // END - if
+       } else {
+               // Data from database
+               $SPEC = ", ".$id;
+               if (!empty($special)) $SPEC = ", ".$special;
+               $ORDER = $name.$SPEC;
+               if ($table == "country") $ORDER = $special;
+               $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM "._MYSQL_PREFIX."_%s ".$where." ORDER BY %s",
+                array($id, $ORDER, $table, $name), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) > 0) {
+                       // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
+                       while (list($value, $title, $add) = SQL_FETCHROW($result)) {
+                               if (empty($special)) $add = "";
+                               $ret .= "<OPTION value=\"".$value."\"";
+                               if ($default == $value) $ret .= " selected checked";
+                               if (!empty($add)) $add = " (".$add.")";
+                               $ret .= ">".$title.$add."</OPTION>\n";
+                       } // END - while
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               } else {
+                       // No data found
+                       $ret = "<OPTION value=\"x\">".SELECT_NONE."</OPTION>\n";
+               }
+       }
+
+       // Return - hopefully - the requested data
+       return $ret;
+}
+// Activate exchange (DEPERECATED???)
+function activateExchange() {
+       global $_CONFIG;
+       $result = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) >= $_CONFIG['activate_xchange'])
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Activate System
+               $SQLs = array(
+                       "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', mem_only='Y' WHERE module='order' LIMIT 1",
+                       "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='order' OR what='unconfirmed' LIMIT 2",
+                       "UPDATE "._MYSQL_PREFIX."_config SET activate_xchange='0' WHERE config=0 LIMIT 1"
+               );
+
+               // Run SQLs
+               foreach ($SQLs as $sql) {
+                       $result = SQL_QUERY($sql, __FILE__, __LINE__);
+               }
+
+               // @TODO Destroy cache
+       }
+}
+//
+function DELETE_USER_ACCOUNT($uid, $reason)
+{
+       $points = 0;
+       $result = SQL_QUERY_ESC("SELECT (SUM(p.points) - d.used_points) AS points
+FROM "._MYSQL_PREFIX."_user_points AS p
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
+ON p.userid=d.userid
+WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Save his points to add them to the jackpot
+               list($points) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Delete points entries as well
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
+
+               // Update mediadata as well
+               if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
+                       // Update database
+                       MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $points);
+               } // END - if
+
+               // Now, when we have all his points adds them do the jackpot!
+               ADD_JACKPOT($points);
+       }
+
+       // Delete category selections as well...
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s",
+        array(bigintval($uid)), __FILE__, __LINE__);
+
+       // Remove from rallye if found
+       if (EXT_IS_ACTIVE("rallye")) {
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE userid=%s",
+                array(bigintval($uid)), __FILE__, __LINE__);
+       }
+
+       // Now a mail to the user and that's all...
+       $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
+       SEND_EMAIL($uid, ADMIN_DEL_ACCOUNT, $msg);
+
+       // Ok, delete the account!
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
+}
+//
+function META_DESCRIPTION($mod, $wht)
+{
+       global $_CONFIG, $DEPTH;
+       if (($mod != "admin") && ($mod != "login"))
+       {
+               // Exclude admin and member's area
+               $DESCR = MAIN_TITLE." ".trim($_CONFIG['title_middle'])." ".ADD_DESCR("guest", "what-".$wht, true);
+               unset($DEPTH);
+               OUTPUT_HTML("<META name=\"description\" content=\"".$DESCR."\">");
+       }
+}
+//
+function ADD_JACKPOT($points)
+{
+       $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Create line
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_jackpot (ok, points) VALUES ('ok','%s')", array($points), __FILE__, __LINE__);
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Update points
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_jackpot SET points=points+%s WHERE ok='ok' LIMIT 1",
+                array($points), __FILE__, __LINE__);
+       }
+}
+//
+function SUB_JACKPOT($points)
+{
+       // First failed
+       $ret = "-1";
+
+       // Get current points
+       $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0)
+       {
+               // Create line
+               $result = SQL_QUERY("INSERT INTO "._MYSQL_PREFIX."_jackpot (ok, points) VALUES ('ok', 0.00000)", __FILE__, __LINE__);
+       }
+        else
+       {
+               // Free memory
+               SQL_FREERESULT($result);
+
+               // Read points
+               list($jackpot) = SQL_FETCHROW($result);
+               if ($jackpot >= $points)
+               {
+                       // Update points when there are enougth points in jackpot
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_jackpot SET points=points-%s WHERE ok='ok' LIMIT 1",
+                               array($points), __FILE__, __LINE__);
+                       $ret = $jackpot - $points;
+               }
+       }
+}
+//
+function IS_DEMO() {
+       return ((EXT_IS_ACTIVE("demo")) && (get_session('admin_login') == "demo"));
+}
+//
+function LOAD_CONFIG($no="0") {
+       global $cacheArray;
+       $CFG_DUMMY = array();
+
+       // Check for cache extension, cache-array and if the requested configuration is in cache
+       if ((is_array($cacheArray)) && (isset($cacheArray['config'][$no])) && (is_array($cacheArray['config'][$no]))) {
+               // Load config from cache
+               //* DEBUG: */ echo gettype($cacheArray['config'][$no])."<br />\n";
+               foreach ($cacheArray['config'][$no] as $key => $value) {
+                       $CFG_DUMMY[$key] = $value;
+               } // END - foreach
+
+               // Count cache hits if exists
+               if ((isset($CFG_DUMMY['cache_hits'])) && (EXT_IS_ACTIVE("cache"))) {
+                       $CFG_DUMMY['cache_hits']++;
+               } // END - if
+       } else {
+               // Load config from DB
+               $result_config = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_config WHERE config=%d LIMIT 1",
+                       array(bigintval($no)), __FILE__, __LINE__);
+
+               // Get config from database
+               $CFG_DUMMY = SQL_FETCHARRAY($result_config);
+
+               // Free result
+               SQL_FREERESULT($result_config);
+
+               // Remember this config in the array
+               $cacheArray['config'][$no] = $CFG_DUMMY;
+       }
+
+       // Return config array
+       return $CFG_DUMMY;
+}
+// Gets the matching what name from module
+function GET_WHAT($MOD_CHECK) {
+       global $_CONFIG;
+
+       $wht = "";
+       //* DEBUG: */ echo __LINE__."!".$MOD_CHECK."!<br />\n";
+       switch ($MOD_CHECK)
+       {
+       case "admin":
+               $wht = "overview";
+               break;
+
+       case "login":
+       case "index":
+               $wht = "welcome";
+               if (($MOD_CHECK == "index") && (!empty($_CONFIG['index_home']))) $wht = $_CONFIG['index_home'];
+               break;
+
+       default:
+               $wht = "";
+               break;
+       }
+
+       // Return what value
+       return $wht;
+}
+//
+function MODULE_HAS_MENU($mod, $forceDb = false)
+{
+       global $cacheArray, $_CONFIG;
+
+       // All is false by default
+       $ret = false;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mod={$mod},cache=".GET_EXT_VERSION("cache")."<br />\n";
+       if (GET_EXT_VERSION("cache") >= "0.1.2") {
+               // Cache version is okay, so let's check the cache!
+               if (isset($cacheArray['modules']['has_menu'][$mod])) {
+                       // Check module cache and count hit
+                       $ret = ($cacheArray['modules']['has_menu'][$mod] == "Y");
+                       $_CONFIG['cache_hits']++;
+               } elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) {
+                       // Check cache and count hit
+                       $ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y");
+                       $_CONFIG['cache_hits']++;
+               }
+       } elseif ((GET_EXT_VERSION("sql_patches") >= "0.3.6") && ((!EXT_IS_ACTIVE("cache")) || ($forceDb === true))) {
+               // Check database for entry
+               $result = SQL_QUERY_ESC("SELECT has_menu FROM "._MYSQL_PREFIX."_mod_reg WHERE module='%s' LIMIT 1",
+                array($mod), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       list($has_menu) = SQL_FETCHROW($result);
+
+                       // Fake cache... ;-)
+                       $cacheArray['extensions']['ext_menu'][$mod] = $has_menu;
+
+                       // Does it have a menu?
+                       $ret = ($has_menu == "Y");
+               } // END  - if
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } elseif (GET_EXT_VERSION("sql_patches") == "") {
+               // No sql_patches installed, so maybe in admin area?
+               $ret = ((IS_ADMIN()) && ($mod == "admin")); // Then there is a menu!
+       }
+
+       // Return status
+       return $ret;
+}
+// Subtract points from database and mediadata cache
+function SUB_POINTS ($uid, $points) {
+       // Add points to used points
+       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `used_points`=`used_points`+%s WHERE userid=%s LIMIT 1",
+        array($points, bigintval($uid)), __FILE__, __LINE__);
+
+       // Update mediadata as well
+       if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
+               // Update database
+               MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $points);
+       } // END - if
+}
+// Update config entries
+function UPDATE_CONFIG ($entries, $values, $updateMode="") {
+       // Do we have multiple entries?
+       if (is_array($entries)) {
+               // Walk through all
+               $all = "";
+               foreach ($entries as $idx => $entry) {
+                       // Update mode set?
+                       if (!empty($updateMode)) {
+                               // Update entry
+                               $all .= sprintf("%s=%s%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]);
+                       } else {
+                               // Check if string or number
+                               if (($values[$idx] + 0) === $values[$idx]) {
+                                       // Number detected
+                                       $all .= sprintf("%s=%s,", $entry, (float)$values[$idx]);
+                               } else {
+                                       // String detected
+                                       $all .= sprintf("%s='%s',", $entry, SQL_ESCAPE($values[$idx]));
+                               }
+                       }
+               } // END - foreach
+
+               // Remove last comma
+               $entries = substr($all, 0, -1);
+       } elseif (!empty($updateMode)) {
+               // Update mode set
+               $entries .= sprintf("=%s%s%s", $entries, $updateMode, (float)$values);
+       } else {
+               // Regular entry to update
+               $entries .= sprintf("='%s'", SQL_ESCAPE($values));
+       }
+
+       // Run database update
+       //DEBUG_LOG(__FUNCTION__.":entries={$entries}");
+       SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__);
+
+       // Get affected rows
+       $affectedRows = SQL_AFFECTEDROWS();
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
+
+       // Rebuild cache
+       REBUILD_CACHE("config", "config");
+}
+// Creates a new task for updated extension
+function CREATE_EXTENSION_UPDATE_TASK ($admin_id, $subject, $notes) {
+       // Check if task is not there
+       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE subject='%s' LIMIT 1",
+               array($subject), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
+               // Task not created so it's a brand-new extension which we need to register and create a task for!
+               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','EXTENSION_UPDATE','%s','%s', UNIX_TIMESTAMP())",
+                       array($admin_id, $subject, $notes), __FILE__, __LINE__);
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+// Creates a new task for newly installed extension
+function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
+       // Not installed and do we have created a task for the admin?
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `"._MYSQL_PREFIX."_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1",
+               array($subject), __FILE__, __LINE__);
+       if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == "")) {
+               // Template file
+               $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
+                       PATH,
+                       GET_LANGUAGE(),
+                       $ext
+               );
+
+               // Load text for task
+               if (FILE_READABLE($tpl)) {
+                       // Load extension's own text template (HTML!)
+                       $msg = LOAD_TEMPLATE("ext_".$ext, true);
+               } else {
+                       // Load default message
+                       $msg = LOAD_TEMPLATE("admin_new_ext", "", 0);
+               }
+
+               // Task not created so it's a brand-new extension which we need to register and create a task for!
+               $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created)
+VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())",
+                       array(
+                               $admin_id,
+                               $subject,
+                               addslashes($msg),
+                       ),  __FILE__, __LINE__, true, false
+               );
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result);
+}
+//
+?>
diff --git a/inc/patch-system.php b/inc/patch-system.php
new file mode 100644 (file)
index 0000000..c0daae6
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/05/2005 *
+ * ===============                              Last change: 03/05/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : patch-system.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Handles patch level                              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Verwalyet die Patch-Level                        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check for patch level differences between databases and current hard-coded
+if (CURR_SVN_REVISION > $_CONFIG['patch_level']) {
+       // Update database and CONFIG array
+       UPDATE_CONFIG(array("patch_level", "patch_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()"));
+       $_CONFIG['patch_level'] = CURR_SVN_REVISION;
+       $_CONFIG['patch_ctime'] = time();
+} // END - if
+
+//
+?>
diff --git a/inc/phpmailer/ChangeLog.txt b/inc/phpmailer/ChangeLog.txt
new file mode 100644 (file)
index 0000000..44e4e87
--- /dev/null
@@ -0,0 +1,284 @@
+ChangeLog
+
+Version 2.0.2 (June 04 2008)
+
+** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
+   IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
+   APPRECIATED.
+
+* added S/MIME functionality (ability to digitally sign emails)
+  BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
+       The "Signed Emails" functionality adds the Sign method to pass the private key
+       filename and the password to read it, and then email will be sent with
+       content-type multipart/signed and with the digital signature attached.
+* added ability to define path (mainly for embedded images)
+  function MsgHTML($message,$basedir='') ... where:
+  $basedir is the fully qualified path
+* fixed MsgHTML() function:
+  - Embedded Images where images are specified by <protocol>:// will not be altered or embedded
+* fixed the return value of SMTP exit code ( pclose )
+* addressed issue of multibyte characters in subject line and truncating
+* added ability to have user specified Message ID
+  (default is still that PHPMailer create a unique Message ID)
+* corrected unidentified message type to 'application/octet-stream'
+* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al).
+* added check for added attachments
+* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny")
+
+Version 2.0.1 (Sun, Dec 02 2007)
+* corrected incorrect version numbers in all three classes
+
+Version 2.0.0 (Sun, Dec 02 2007)
+* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon)
+* finished all testing, all known bugs corrected, enhancements tested
+- note: designed for PHP4, but will work with PHP5 (not compatible with
+  E_STRICT) ... full PHP5 version of PHPMailer released separately.
+  PHP5 version will NOT work with PHP4.
+
+Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release
+* implements new property to control VERP in class.smtp.php
+  example (requires instantiating class.smtp.php):
+  $mail->do_verp = true;
+* POP-before-SMTP functionality included, thanks to Richard Davey
+  (see class.pop3.php & pop3_before_smtp_test.php for examples)
+* included example showing how to use PHPMailer with GMAIL
+* fixed the missing Cc in SendMail() and Mail()
+
+******************
+A note on sending bulk emails:
+
+If the email you are sending is not personalized, consider using the
+"undisclosed-recipient:;" strategy. That is, put all of your recipients
+in the Bcc field and set the To field to "undisclosed-recipients:;".
+It's a lot faster (only one send) and saves quite a bit on resources.
+Contrary to some opinions, this will not get you listed in spam engines -
+it's a legitimate way for you to send emails.
+
+A partial example for use with PHPMailer:
+
+$mail->AddAddress("undisclosed-recipients:;");
+$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com");
+
+Many email service providers restrict the number of emails that can be sent
+in any given time period. Often that is between 50 - 60 emails maximum
+per hour or per send session.
+
+If that's the case, then break up your Bcc lists into chunks that are one
+less than your limit, and put a pause in your script.
+*******************
+
+Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release
+* dramatically simplified using inline graphics ... it's fully automated and
+  requires no user input
+* added automatic document type detection for attachments and pictures
+* added MsgHTML() function to replace Body tag for HTML emails
+* fixed the SendMail security issues (input validation vulnerability)
+* enhanced the AddAddresses functionality so that the "Name" portion is used
+  in the email address
+* removed the need to use the AltBody method (set from the HTML, or default
+  text used)
+* set the PHP Mail() function as the default (still support SendMail, SMTP Mail)
+* removed the need to set the IsHTML property (set automatically)
+* added Estonian language file by Indrek P&auml;ri
+* added header injection patch
+* added "set" method to permit users to create their own pseudo-properties
+  like 'X-Headers', etc.
+  example of use:
+  $mail->set('X-Priority', '3');
+  $mail->set('X-MSMail-Priority', 'Normal');
+* fixed warning message in SMTP get_lines method
+* added TLS/SSL SMTP support
+  example of use:
+  $mail = new PHPMailer();
+       $mail->Mailer = "smtp";
+       $mail->Host = "smtp.example.com";
+       $mail->SMTPSecure   = "tls"; // option
+       //$mail->SMTPSecure   = "ssl";  // option
+       ...
+  $mail->Send();
+* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)
+* Works with PHP installed as a module or as CGI-PHP
+- NOTE: will NOT work with PHP5 in E_STRICT error mode
+
+Version 1.73 (Sun, Jun 10 2005)
+* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
+* Now has a total of 20 translations
+* Fixed alt attachments bug: http://tinyurl.com/98u9k
+
+Version 1.72 (Wed, May 25 2004)
+* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
+* Received: Removed this method because spam filter programs like
+SpamAssassin reject this header.
+* Fixed error count bug.
+* SetLanguage default is now "language/".
+* Fixed magic_quotes_runtime bug.
+
+Version 1.71 (Tue, Jul 28 2003)
+* Made several speed enhancements
+* Added German and Italian translation files
+* Fixed HELO/AUTH bugs on keep-alive connects
+* Now provides an error message if language file does not load
+* Fixed attachment EOL bug
+* Updated some unclear documentation
+* Added additional tests and improved others
+
+Version 1.70 (Mon, Jun 20 2003)
+* Added SMTP keep-alive support
+* Added IsError method for error detection
+* Added error message translation support (SetLanguage)
+* Refactored many methods to increase library performance
+* Hello now sends the newer EHLO message before HELO as per RFC 2821
+* Removed the boundary class and replaced it with GetBoundary
+* Removed queue support methods
+* New $Hostname variable
+* New Message-ID header
+* Received header reformat
+* Helo variable default changed to $Hostname
+* Removed extra spaces in Content-Type definition (#667182)
+* Return-Path should be set to Sender when set
+* Adds Q or B encoding to headers when necessary
+* quoted-encoding should now encode NULs \000
+* Fixed encoding of body/AltBody (#553370)
+* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
+* Multiple bug fixes
+
+Version 1.65 (Fri, Aug 09 2002)
+* Fixed non-visible attachment bug (#585097) for Outlook
+* SMTP connections are now closed after each transaction
+* Fixed SMTP::Expand return value
+* Converted SMTP class documentation to phpDocumentor format
+
+Version 1.62 (Wed, Jun 26 2002)
+* Fixed multi-attach bug
+* Set proper word wrapping
+* Reduced memory use with attachments
+* Added more debugging
+* Changed documentation to phpDocumentor format
+
+Version 1.60 (Sat, Mar 30 2002)
+* Sendmail pipe and address patch (Christian Holtje)
+* Added embedded image and read confirmation support (A. Ognio)
+* Added unit tests
+* Added SMTP timeout support (*nix only)
+* Added possibly temporary PluginDir variable for SMTP class
+* Added LE message line ending variable
+* Refactored boundary and attachment code
+* Eliminated SMTP class warnings
+* Added SendToQueue method for future queuing support
+
+Version 1.54 (Wed, Dec 19 2001)
+* Add some queuing support code
+* Fixed a pesky multi/alt bug
+* Messages are no longer forced to have "To" addresses
+
+Version 1.50 (Thu, Nov 08 2001)
+* Fix extra lines when not using SMTP mailer
+* Set WordWrap variable to int with a zero default
+
+Version 1.47 (Tue, Oct 16 2001)
+* Fixed Received header code format
+* Fixed AltBody order error
+* Fixed alternate port warning
+
+Version 1.45 (Tue, Sep 25 2001)
+* Added enhanced SMTP debug support
+* Added support for multiple ports on SMTP
+* Added Received header for tracing
+* Fixed AddStringAttachment encoding
+* Fixed possible header name quote bug
+* Fixed wordwrap() trim bug
+* Couple other small bug fixes
+
+Version 1.41 (Wed, Aug 22 2001)
+* Fixed AltBody bug w/o attachments
+* Fixed rfc_date() for certain mail servers
+
+Version 1.40 (Sun, Aug 12 2001)
+* Added multipart/alternative support (AltBody)
+* Documentation update
+* Fixed bug in Mercury MTA
+
+Version 1.29 (Fri, Aug 03 2001)
+* Added AddStringAttachment() method
+* Added SMTP authentication support
+
+Version 1.28 (Mon, Jul 30 2001)
+* Fixed a typo in SMTP class
+* Fixed header issue with Imail (win32) SMTP server
+* Made fopen() calls for attachments use "rb" to fix win32 error
+
+Version 1.25 (Mon, Jul 02 2001)
+* Added RFC 822 date fix (Patrice)
+* Added improved error handling by adding a $ErrorInfo variable
+* Removed MailerDebug variable (obsolete with new error handler)
+
+Version 1.20 (Mon, Jun 25 2001)
+* Added quoted-printable encoding (Patrice)
+* Set Version as public and removed PrintVersion()
+* Changed phpdoc to only display public variables and methods
+
+Version 1.19 (Thu, Jun 21 2001)
+* Fixed MS Mail header bug
+* Added fix for Bcc problem with mail(). *Does not work on Win32*
+  (See PHP bug report: http://www.php.net/bugs.php?id=11616)
+* mail() no longer passes a fifth parameter when not needed
+
+Version 1.15 (Fri, Jun 15 2001)
+[Note: these changes contributed by Patrice Fournier]
+* Changed all remaining \n to \r\n
+* Bcc: header no longer writen to message except
+when sent directly to sendmail
+* Added a small message to non-MIME compliant mail reader
+* Added Sender variable to change the Sender email
+used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode
+* Changed boundary setting to a place it will be set only once
+* Removed transfer encoding for whole message when using multipart
+* Message body now uses Encoding in multipart messages
+* Can set encoding and type to attachments 7bit, 8bit
+and binary attachment are sent as is, base64 are encoded
+* Can set Encoding to base64 to send 8 bits body
+through 7 bits servers
+
+Version 1.10 (Tue, Jun 12 2001)
+* Fixed win32 mail header bug (printed out headers in message body)
+
+Version 1.09 (Fri, Jun 08 2001)
+* Changed date header to work with Netscape mail programs
+* Altered phpdoc documentation
+
+Version 1.08 (Tue, Jun 05 2001)
+* Added enhanced error-checking
+* Added phpdoc documentation to source
+
+Version 1.06 (Fri, Jun 01 2001)
+* Added optional name for file attachments
+
+Version 1.05 (Tue, May 29 2001)
+* Code cleanup
+* Eliminated sendmail header warning message
+* Fixed possible SMTP error
+
+Version 1.03 (Thu, May 24 2001)
+* Fixed problem where qmail sends out duplicate messages
+
+Version 1.02 (Wed, May 23 2001)
+* Added multiple recipient and attachment Clear* methods
+* Added Sendmail public variable
+* Fixed problem with loading SMTP library multiple times
+
+Version 0.98 (Tue, May 22 2001)
+* Fixed problem with redundant mail hosts sending out multiple messages
+* Added additional error handler code
+* Added AddCustomHeader() function
+* Added support for Microsoft mail client headers (affects priority)
+* Fixed small bug with Mailer variable
+* Added PrintVersion() function
+
+Version 0.92 (Tue, May 15 2001)
+* Changed file names to class.phpmailer.php and class.smtp.php to match
+  current PHP class trend.
+* Fixed problem where body not being printed when a message is attached
+* Several small bug fixes
+
+Version 0.90 (Tue, April 17 2001)
+* Intial public release
diff --git a/inc/phpmailer/LICENSE b/inc/phpmailer/LICENSE
new file mode 100644 (file)
index 0000000..03851a3
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+                      Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL.  It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+                           Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+  This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it.  You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+  When we speak of free software, we are referring to freedom of use,\r
+not price.  Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights.  These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+  For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you.  You must make sure that they, too, receive or can get the source\r
+code.  If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it.  And you must show them these terms so they know their rights.\r
+\r
+  We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+  To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library.  Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+  Finally, software patents pose a constant threat to the existence of\r
+any free program.  We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder.  Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+  Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License.  This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License.  We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+  When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library.  The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom.  The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+  We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License.  It also provides other free software developers Less\r
+of an advantage over competing non-free programs.  These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries.  However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+  For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard.  To achieve this, non-free programs must be\r
+allowed to use the library.  A more frequent case is that a free\r
+library does the same job as widely used non-free libraries.  In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+  In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software.  For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+  Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.  Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library".  The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+                 GNU LESSER GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+  A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+  The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms.  A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language.  (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+  "Source code" for a work means the preferred form of the work for\r
+making modifications to it.  For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+  Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it).  Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+  \r
+  1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+  You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+  2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) The modified work must itself be a software library.\r
+\r
+    b) You must cause the files modified to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    c) You must cause the whole of the work to be licensed at no\r
+    charge to all third parties under the terms of this License.\r
+\r
+    d) If a facility in the modified Library refers to a function or a\r
+    table of data to be supplied by an application program that uses\r
+    the facility, other than as an argument passed when the facility\r
+    is invoked, then you must make a good faith effort to ensure that,\r
+    in the event an application does not supply such function or\r
+    table, the facility still operates, and performs whatever part of\r
+    its purpose remains meaningful.\r
+\r
+    (For example, a function in a library to compute square roots has\r
+    a purpose that is entirely well-defined independent of the\r
+    application.  Therefore, Subsection 2d requires that any\r
+    application-supplied function or table used by this function must\r
+    be optional: if the application does not supply it, the square\r
+    root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library.  To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License.  (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.)  Do not make any other change in\r
+these notices.\r
+\r
+  Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+  This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+  4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+  If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library".  Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+  However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library".  The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+  When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library.  The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+  If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work.  (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+  Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+  6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+  You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License.  You must supply a copy of this License.  If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License.  Also, you must do one\r
+of these things:\r
+\r
+    a) Accompany the work with the complete corresponding\r
+    machine-readable source code for the Library including whatever\r
+    changes were used in the work (which must be distributed under\r
+    Sections 1 and 2 above); and, if the work is an executable linked\r
+    with the Library, with the complete machine-readable "work that\r
+    uses the Library", as object code and/or source code, so that the\r
+    user can modify the Library and then relink to produce a modified\r
+    executable containing the modified Library.  (It is understood\r
+    that the user who changes the contents of definitions files in the\r
+    Library will not necessarily be able to recompile the application\r
+    to use the modified definitions.)\r
+\r
+    b) Use a suitable shared library mechanism for linking with the\r
+    Library.  A suitable mechanism is one that (1) uses at run time a\r
+    copy of the library already present on the user's computer system,\r
+    rather than copying library functions into the executable, and (2)\r
+    will operate properly with a modified version of the library, if\r
+    the user installs one, as long as the modified version is\r
+    interface-compatible with the version that the work was made with.\r
+\r
+    c) Accompany the work with a written offer, valid for at\r
+    least three years, to give the same user the materials\r
+    specified in Subsection 6a, above, for a charge no more\r
+    than the cost of performing this distribution.\r
+\r
+    d) If distribution of the work is made by offering access to copy\r
+    from a designated place, offer equivalent access to copy the above\r
+    specified materials from the same place.\r
+\r
+    e) Verify that the user has already received a copy of these\r
+    materials or that you have already sent this user a copy.\r
+\r
+  For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it.  However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+  It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system.  Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+  7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+    a) Accompany the combined library with a copy of the same work\r
+    based on the Library, uncombined with any other library\r
+    facilities.  This must be distributed under the terms of the\r
+    Sections above.\r
+\r
+    b) Give prominent notice with the combined library of the fact\r
+    that part of it is a work based on the Library, and explaining\r
+    where to find the accompanying uncombined form of the same work.\r
+\r
+  8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License.  Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License.  However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+  9. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+  10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+  11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded.  In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+  13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation.  If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+  14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission.  For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this.  Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+                           NO WARRANTY\r
+\r
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+                    END OF TERMS AND CONDITIONS\r
+\r
+           How to Apply These Terms to Your New Libraries\r
+\r
+  If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change.  You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+  To apply these terms, attach the following notices to the library.  It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+    <one line to give the library's name and a brief idea of what it does.>\r
+    Copyright (C) <year>  <name of author>\r
+\r
+    This library is free software; you can redistribute it and/or\r
+    modify it under the terms of the GNU Lesser General Public\r
+    License as published by the Free Software Foundation; either\r
+    version 2.1 of the License, or (at your option) any later version.\r
+\r
+    This library is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+    Lesser General Public License for more details.\r
+\r
+    You should have received a copy of the GNU Lesser General Public\r
+    License along with this library; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary.  Here is a sample; alter the names:\r
+\r
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+  <signature of Ty Coon>, 1 April 1990\r
+  Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
diff --git a/inc/phpmailer/README b/inc/phpmailer/README
new file mode 100644 (file)
index 0000000..75b76c1
--- /dev/null
@@ -0,0 +1,152 @@
+/*******************************************************************\r
+* The http://phpmailer.codeworxtech.com/ website now carries a few *\r
+* advertisements through the Google Adsense network. Please visit  *\r
+* the advertiser sites and help us offset some of our costs.       *\r
+* Thanks ....                                                      *\r
+********************************************************************/\r
+\r
+PHPMailer\r
+Full Featured Email Transfer Class for PHP\r
+==========================================\r
+\r
+Version 2.0.2 (June 04 2008)\r
+\r
+With this release, we are announcing that the development of PHPMailer for PHP5\r
+will be our focus from this date on. We have implemented all the enhancements\r
+and fixes from the sourceforge.net Tracker.\r
+\r
+** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.\r
+   IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE\r
+   APPRECIATED.\r
+\r
+We have now added S/MIME functionality (ability to digitally sign emails).\r
+BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.\r
+The "Signed Emails" functionality adds the Sign method to pass the private key\r
+filename and the password to read it, and then email will be sent with\r
+content-type multipart/signed and with the digital signature attached.\r
+\r
+We have also included more example files to show the use of "sendmail", "mail()",\r
+"smtp", and "gmail".\r
+\r
+We are also looking for more programmers to join the volunteer development team.\r
+If you have an interest in this, please let us know.\r
+\r
+Enjoy!\r
+\r
+** NOTE:\r
+\r
+As of November 2007, PHPMailer has a new project team headed by industry\r
+veteran Andy Prevost (codeworxtech). The first release in more than two\r
+years will focus on fixes, adding ease-of-use enhancements, provide\r
+basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility\r
+features. A new release is planned before year-end 2007 that will provide\r
+full compatiblity with PHP4 and PHP5, as well as more bug fixes.\r
+\r
+We are looking for project developers to assist in restoring PHPMailer to\r
+its leadership position. Our goals are to simplify use of PHPMailer, provide\r
+good documentation and examples, and retain backward compatibility to level\r
+1.7.3 standards.\r
+\r
+If you are interested in helping out, visit http://sourceforge.net/phpmailer\r
+and indicate your interest.\r
+\r
+**\r
+\r
+http://phpmailer.sourceforge.net/\r
+\r
+This software is licenced under the LGPL.  Please read LICENSE for information on the\r
+software availability and distribution.\r
+\r
+Class Features:\r
+- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs\r
+- Redundant SMTP servers\r
+- Multipart/alternative emails for mail clients that do not read HTML email\r
+- Support for 8bit, base64, binary, and quoted-printable encoding\r
+- Uses the same methods as the very popular AspEmail active server (COM) component\r
+- SMTP authentication\r
+- Native language support\r
+- Word wrap, and more!\r
+\r
+Why you might need it:\r
+\r
+Many PHP developers utilize email in their code.  The only PHP function\r
+that supports this is the mail() function.  However, it does not expose\r
+any of the popular features that many email clients use nowadays like\r
+HTML-based emails and attachments. There are two proprietary\r
+development tools out there that have all the functionality built into\r
+easy to use classes: AspEmail(tm) and AspMail.  Both of these\r
+programs are COM components only available on Windows.  They are also a\r
+little pricey for smaller projects.\r
+\r
+Since I do Linux development I\92ve missed these tools for my PHP coding.\r
+So I built a version myself that implements the same methods (object\r
+calls) that the Windows-based components do. It is open source and the\r
+LGPL license allows you to place the class in your proprietary PHP\r
+projects.\r
+\r
+\r
+Installation:\r
+\r
+Copy class.phpmailer.php into your php.ini include_path. If you are\r
+using the SMTP mailer then place class.smtp.php in your path as well.\r
+In the language directory you will find several files like\r
+phpmailer.lang-en.php.  If you look right before the .php extension\r
+that there are two letters.  These represent the language type of the\r
+translation file.  For instance "en" is the English file and "br" is\r
+the Portuguese file.  Chose the file that best fits with your language\r
+and place it in the PHP include path.  If your language is English\r
+then you have nothing more to do.  If it is a different language then\r
+you must point PHPMailer to the correct translation.  To do this, call\r
+the PHPMailer SetLanguage method like so:\r
+\r
+// To load the Portuguese version\r
+$mail->SetLanguage("br", "/optional/path/to/language/directory/");\r
+\r
+That's it.  You should now be ready to use PHPMailer!\r
+\r
+\r
+A Simple Example:\r
+\r
+<?php\r
+require("class.phpmailer.php");\r
+\r
+$mail = new PHPMailer();\r
+\r
+$mail->IsSMTP();                                      // set mailer to use SMTP\r
+$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server\r
+$mail->SMTPAuth = true;     // turn on SMTP authentication\r
+$mail->Username = "jswan";  // SMTP username\r
+$mail->Password = "secret"; // SMTP password\r
+\r
+$mail->From = "from@example.com";\r
+$mail->FromName = "Mailer";\r
+$mail->AddAddress("josh@example.net", "Josh Adams");\r
+$mail->AddAddress("ellen@example.com");                  // name is optional\r
+$mail->AddReplyTo("info@example.com", "Information");\r
+\r
+$mail->WordWrap = 50;                                 // set word wrap to 50 characters\r
+$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments\r
+$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name\r
+$mail->IsHTML(true);                                  // set email format to HTML\r
+\r
+$mail->Subject = "Here is the subject";\r
+$mail->Body    = "This is the HTML message body <b>in bold!</b>";\r
+$mail->AltBody = "This is the body in plain text for non-HTML mail clients";\r
+\r
+if(!$mail->Send())\r
+{\r
+   echo "Message could not be sent. <p>";\r
+   echo "Mailer Error: " . $mail->ErrorInfo;\r
+   exit;\r
+}\r
+\r
+echo "Message has been sent";\r
+?>\r
+\r
+CHANGELOG\r
+\r
+See ChangeLog.txt\r
+\r
+Download: http://sourceforge.net/project/showfiles.php?group_id=26031\r
+\r
+Andy Prevost\r
diff --git a/inc/phpmailer/class.phpmailer.php b/inc/phpmailer/class.phpmailer.php
new file mode 100644 (file)
index 0000000..2ddc30f
--- /dev/null
@@ -0,0 +1,1896 @@
+<?php
+/*~ class.phpmailer.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.0.2                                                          |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * PHPMailer - PHP email transport class
+ * @package PHPMailer
+ * @author Andy Prevost
+ * @copyright 2004 - 2008 Andy Prevost
+ */
+
+class PHPMailer {
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PUBLIC
+  /////////////////////////////////////////////////
+
+  /**
+   * Email priority (1 = High, 3 = Normal, 5 = low).
+   * @var int
+   */
+  var $Priority          = 3;
+
+  /**
+   * Sets the CharSet of the message.
+   * @var string
+   */
+  var $CharSet           = 'iso-8859-1';
+
+  /**
+   * Sets the Content-type of the message.
+   * @var string
+   */
+  var $ContentType        = 'text/plain';
+
+  /**
+   * Sets the Encoding of the message. Options for this are "8bit",
+   * "7bit", "binary", "base64", and "quoted-printable".
+   * @var string
+   */
+  var $Encoding          = '8bit';
+
+  /**
+   * Holds the most recent mailer error message.
+   * @var string
+   */
+  var $ErrorInfo         = '';
+
+  /**
+   * Sets the From email address for the message.
+   * @var string
+   */
+  var $From              = 'root@localhost';
+
+  /**
+   * Sets the From name of the message.
+   * @var string
+   */
+  var $FromName          = 'Root User';
+
+  /**
+   * Sets the Sender email (Return-Path) of the message.  If not empty,
+   * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+   * @var string
+   */
+  var $Sender            = '';
+
+  /**
+   * Sets the Subject of the message.
+   * @var string
+   */
+  var $Subject           = '';
+
+  /**
+   * Sets the Body of the message.  This can be either an HTML or text body.
+   * If HTML then run IsHTML(true).
+   * @var string
+   */
+  var $Body              = '';
+
+  /**
+   * Sets the text-only body of the message.  This automatically sets the
+   * email to multipart/alternative.  This body can be read by mail
+   * clients that do not have HTML email capability such as mutt. Clients
+   * that can read HTML will view the normal Body.
+   * @var string
+   */
+  var $AltBody           = '';
+
+  /**
+   * Sets word wrapping on the body of the message to a given number of
+   * characters.
+   * @var int
+   */
+  var $WordWrap          = 0;
+
+  /**
+   * Method to send mail: ("mail", "sendmail", or "smtp").
+   * @var string
+   */
+  var $Mailer            = 'mail';
+
+  /**
+   * Sets the path of the sendmail program.
+   * @var string
+   */
+  var $Sendmail          = '/usr/sbin/sendmail';
+
+  /**
+   * Path to PHPMailer plugins.  This is now only useful if the SMTP class
+   * is in a different directory than the PHP include path.
+   * @var string
+   */
+  var $PluginDir         = '';
+
+  /**
+   * Holds PHPMailer version.
+   * @var string
+   */
+  var $Version           = "2.0.2";
+
+  /**
+   * Sets the email address that a reading confirmation will be sent.
+   * @var string
+   */
+  var $ConfirmReadingTo  = '';
+
+  /**
+   * Sets the hostname to use in Message-Id and Received headers
+   * and as default HELO string. If empty, the value returned
+   * by SERVER_NAME is used or 'localhost.localdomain'.
+   * @var string
+   */
+  var $Hostname          = '';
+
+  /**
+   * Sets the message ID to be used in the Message-Id header.
+   * If empty, a unique id will be generated.
+   * @var string
+   */
+  var $MessageID         = '';
+
+  /////////////////////////////////////////////////
+  // PROPERTIES FOR SMTP
+  /////////////////////////////////////////////////
+
+  /**
+   * Sets the SMTP hosts.  All hosts must be separated by a
+   * semicolon.  You can also specify a different port
+   * for each host by using this format: [hostname:port]
+   * (e.g. "smtp1.example.com:25;smtp2.example.com").
+   * Hosts will be tried in order.
+   * @var string
+   */
+  var $Host        = 'localhost';
+
+  /**
+   * Sets the default SMTP server port.
+   * @var int
+   */
+  var $Port        = 25;
+
+  /**
+   * Sets the SMTP HELO of the message (Default is $Hostname).
+   * @var string
+   */
+  var $Helo        = '';
+
+  /**
+   * Sets connection prefix.
+   * Options are "", "ssl" or "tls"
+   * @var string
+   */
+  var $SMTPSecure = "";
+
+  /**
+   * Sets SMTP authentication. Utilizes the Username and Password variables.
+   * @var bool
+   */
+  var $SMTPAuth     = false;
+
+  /**
+   * Sets SMTP username.
+   * @var string
+   */
+  var $Username     = '';
+
+  /**
+   * Sets SMTP password.
+   * @var string
+   */
+  var $Password     = '';
+
+  /**
+   * Sets the SMTP server timeout in seconds. This function will not
+   * work with the win32 version.
+   * @var int
+   */
+  var $Timeout      = 10;
+
+  /**
+   * Sets SMTP class debugging on or off.
+   * @var bool
+   */
+  var $SMTPDebug    = false;
+
+  /**
+   * Prevents the SMTP connection from being closed after each mail
+   * sending.  If this is set to true then to close the connection
+   * requires an explicit call to SmtpClose().
+   * @var bool
+   */
+  var $SMTPKeepAlive = false;
+
+  /**
+   * Provides the ability to have the TO field process individual
+   * emails, instead of sending to entire TO addresses
+   * @var bool
+   */
+  var $SingleTo = false;
+
+  /////////////////////////////////////////////////
+  // PROPERTIES, PRIVATE
+  /////////////////////////////////////////////////
+
+  var $smtp            = NULL;
+  var $to              = array();
+  var $cc              = array();
+  var $bcc             = array();
+  var $ReplyTo         = array();
+  var $attachment      = array();
+  var $CustomHeader    = array();
+  var $message_type    = '';
+  var $boundary        = array();
+  var $language        = array();
+  var $error_count     = 0;
+  var $LE              = "\n";
+  var $sign_key_file   = "";
+  var $sign_key_pass   = "";
+
+  /////////////////////////////////////////////////
+  // METHODS, VARIABLES
+  /////////////////////////////////////////////////
+
+  /**
+   * Sets message type to HTML.
+   * @param bool $bool
+   * @return void
+   */
+  function IsHTML($bool) {
+    if($bool == true) {
+      $this->ContentType = 'text/html';
+    } else {
+      $this->ContentType = 'text/plain';
+    }
+  }
+
+  /**
+   * Sets Mailer to send message using SMTP.
+   * @return void
+   */
+  function IsSMTP() {
+    $this->Mailer = 'smtp';
+  }
+
+  /**
+   * Sets Mailer to send message using PHP mail() function.
+   * @return void
+   */
+  function IsMail() {
+    $this->Mailer = 'mail';
+  }
+
+  /**
+   * Sets Mailer to send message using the $Sendmail program.
+   * @return void
+   */
+  function IsSendmail() {
+    $this->Mailer = 'sendmail';
+  }
+
+  /**
+   * Sets Mailer to send message using the qmail MTA.
+   * @return void
+   */
+  function IsQmail() {
+    $this->Sendmail = '/var/qmail/bin/sendmail';
+    $this->Mailer = 'sendmail';
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, RECIPIENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds a "To" address.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  function AddAddress($address, $name = '') {
+    $cur = count($this->to);
+    $this->to[$cur][0] = trim($address);
+    $this->to[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Cc" address. Note: this function works
+   * with the SMTP mailer on win32, not with the "mail"
+   * mailer.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  function AddCC($address, $name = '') {
+    $cur = count($this->cc);
+    $this->cc[$cur][0] = trim($address);
+    $this->cc[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Bcc" address. Note: this function works
+   * with the SMTP mailer on win32, not with the "mail"
+   * mailer.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  function AddBCC($address, $name = '') {
+    $cur = count($this->bcc);
+    $this->bcc[$cur][0] = trim($address);
+    $this->bcc[$cur][1] = $name;
+  }
+
+  /**
+   * Adds a "Reply-To" address.
+   * @param string $address
+   * @param string $name
+   * @return void
+   */
+  function AddReplyTo($address, $name = '') {
+    $cur = count($this->ReplyTo);
+    $this->ReplyTo[$cur][0] = trim($address);
+    $this->ReplyTo[$cur][1] = $name;
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MAIL SENDING
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates message and assigns Mailer. If the message is
+   * not sent successfully then it returns false.  Use the ErrorInfo
+   * variable to view description of the error.
+   * @return bool
+   */
+  function Send() {
+    $header = '';
+    $body = '';
+    $result = true;
+
+    if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
+      $this->SetError($this->Lang('provide_address'));
+      return false;
+    }
+
+    /* Set whether the message is multipart/alternative */
+    if(!empty($this->AltBody)) {
+      $this->ContentType = 'multipart/alternative';
+    }
+
+    $this->error_count = 0; // reset errors
+    $this->SetMessageType();
+    $header .= $this->CreateHeader();
+    $body = $this->CreateBody();
+
+    if($body == '') {
+      return false;
+    }
+
+    /* Choose the mailer */
+    switch($this->Mailer) {
+      case 'sendmail':
+        $result = $this->SendmailSend($header, $body);
+        break;
+      case 'smtp':
+        $result = $this->SmtpSend($header, $body);
+        break;
+      case 'mail':
+        $result = $this->MailSend($header, $body);
+        break;
+      default:
+        $result = $this->MailSend($header, $body);
+        break;
+        //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
+        //$result = false;
+        //break;
+    }
+
+    return $result;
+  }
+
+  /**
+   * Sends mail using the $Sendmail program.
+   * @access private
+   * @return bool
+   */
+  function SendmailSend($header, $body) {
+    if ($this->Sender != '') {
+      $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+    } else {
+      $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
+    }
+
+    if(!@$mail = popen($sendmail, 'w')) {
+      $this->SetError($this->Lang('execute') . $this->Sendmail);
+      return false;
+    }
+
+    fputs($mail, $header);
+    fputs($mail, $body);
+
+    $result = pclose($mail);
+    if (version_compare(phpversion(), '4.2.3') == -1) {
+      $result = $result >> 8 & 0xFF;
+    }
+    if($result != 0) {
+      $this->SetError($this->Lang('execute') . $this->Sendmail);
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends mail using the PHP mail() function.
+   * @access private
+   * @return bool
+   */
+  function MailSend($header, $body) {
+
+    $to = '';
+    for($i = 0; $i < count($this->to); $i++) {
+      if($i != 0) { $to .= ', '; }
+      $to .= $this->AddrFormat($this->to[$i]);
+    }
+
+    $toArr = split(',', $to);
+
+    $params = sprintf("-oi -f %s", $this->Sender);
+    if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
+      $old_from = ini_get('sendmail_from');
+      ini_set('sendmail_from', $this->Sender);
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+      }
+    } else {
+      if ($this->SingleTo === true && count($toArr) > 1) {
+        foreach ($toArr as $key => $val) {
+          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+        }
+      } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
+      }
+    }
+
+    if (isset($old_from)) {
+      ini_set('sendmail_from', $old_from);
+    }
+
+    if(!$rt) {
+      $this->SetError($this->Lang('instantiate'));
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Sends mail via SMTP using PhpSMTP (Author:
+   * Chris Ryan).  Returns bool.  Returns false if there is a
+   * bad MAIL FROM, RCPT, or DATA input.
+   * @access private
+   * @return bool
+   */
+  function SmtpSend($header, $body) {
+    include_once($this->PluginDir . 'class.smtp.php');
+    $error = '';
+    $bad_rcpt = array();
+
+    if(!$this->SmtpConnect()) {
+      return false;
+    }
+
+    $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
+    if(!$this->smtp->Mail($smtp_from)) {
+      $error = $this->Lang('from_failed') . $smtp_from;
+      $this->SetError($error);
+      $this->smtp->Reset();
+      return false;
+    }
+
+    /* Attempt to send attach all recipients */
+    for($i = 0; $i < count($this->to); $i++) {
+      if(!$this->smtp->Recipient($this->to[$i][0])) {
+        $bad_rcpt[] = $this->to[$i][0];
+      }
+    }
+    for($i = 0; $i < count($this->cc); $i++) {
+      if(!$this->smtp->Recipient($this->cc[$i][0])) {
+        $bad_rcpt[] = $this->cc[$i][0];
+      }
+    }
+    for($i = 0; $i < count($this->bcc); $i++) {
+      if(!$this->smtp->Recipient($this->bcc[$i][0])) {
+        $bad_rcpt[] = $this->bcc[$i][0];
+      }
+    }
+
+    if(count($bad_rcpt) > 0) { // Create error message
+      for($i = 0; $i < count($bad_rcpt); $i++) {
+        if($i != 0) {
+          $error .= ', ';
+        }
+        $error .= $bad_rcpt[$i];
+      }
+      $error = $this->Lang('recipients_failed') . $error;
+      $this->SetError($error);
+      $this->smtp->Reset();
+      return false;
+    }
+
+    if(!$this->smtp->Data($header . $body)) {
+      $this->SetError($this->Lang('data_not_accepted'));
+      $this->smtp->Reset();
+      return false;
+    }
+    if($this->SMTPKeepAlive == true) {
+      $this->smtp->Reset();
+    } else {
+      $this->SmtpClose();
+    }
+
+    return true;
+  }
+
+  /**
+   * Initiates a connection to an SMTP server.  Returns false if the
+   * operation failed.
+   * @access private
+   * @return bool
+   */
+  function SmtpConnect() {
+    if($this->smtp == NULL) {
+      $this->smtp = new SMTP();
+    }
+
+    $this->smtp->do_debug = $this->SMTPDebug;
+    $hosts = explode(';', $this->Host);
+    $index = 0;
+    $connection = ($this->smtp->Connected());
+
+    /* Retry while there is no connection */
+    while($index < count($hosts) && $connection == false) {
+      $hostinfo = array();
+      if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
+        $host = $hostinfo[1];
+        $port = $hostinfo[2];
+      } else {
+        $host = $hosts[$index];
+        $port = $this->Port;
+      }
+
+      if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
+        if ($this->Helo != '') {
+          $this->smtp->Hello($this->Helo);
+        } else {
+          $this->smtp->Hello($this->ServerHostname());
+        }
+
+        $connection = true;
+        if($this->SMTPAuth) {
+          if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
+            $this->SetError($this->Lang('authenticate'));
+            $this->smtp->Reset();
+            $connection = false;
+          }
+        }
+      }
+      $index++;
+    }
+    if(!$connection) {
+      $this->SetError($this->Lang('connect_host'));
+    }
+
+    return $connection;
+  }
+
+  /**
+   * Closes the active SMTP session if one exists.
+   * @return void
+   */
+  function SmtpClose() {
+    if($this->smtp != NULL) {
+      if($this->smtp->Connected()) {
+        $this->smtp->Quit();
+        $this->smtp->Close();
+      }
+    }
+  }
+
+  /**
+   * Sets the language for all class error messages.  Returns false
+   * if it cannot load the language file.  The default language type
+   * is English.
+   * @param string $lang_type Type of language (e.g. Portuguese: "br")
+   * @param string $lang_path Path to the language file directory
+   * @access public
+   * @return bool
+   */
+  function SetLanguage($lang_type, $lang_path = 'language/') {
+    if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
+      include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
+    } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
+      include($lang_path.'phpmailer.lang-en.php');
+    } else {
+      $this->SetError('Could not load language file');
+      return false;
+    }
+    $this->language = $PHPMAILER_LANG;
+
+    return true;
+  }
+
+  /////////////////////////////////////////////////
+  // METHODS, MESSAGE CREATION
+  /////////////////////////////////////////////////
+
+  /**
+   * Creates recipient headers.
+   * @access private
+   * @return string
+   */
+  function AddrAppend($type, $addr) {
+    $addr_str = $type . ': ';
+    $addr_str .= $this->AddrFormat($addr[0]);
+    if(count($addr) > 1) {
+      for($i = 1; $i < count($addr); $i++) {
+        $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
+      }
+    }
+    $addr_str .= $this->LE;
+
+    return $addr_str;
+  }
+
+  /**
+   * Formats an address correctly.
+   * @access private
+   * @return string
+   */
+  function AddrFormat($addr) {
+    if(empty($addr[1])) {
+      $formatted = $this->SecureHeader($addr[0]);
+    } else {
+      $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
+    }
+
+    return $formatted;
+  }
+
+  /**
+   * Wraps message for use with mailers that do not
+   * automatically perform wrapping and for quoted-printable.
+   * Original written by philippe.
+   * @access private
+   * @return string
+   */
+  function WrapText($message, $length, $qp_mode = false) {
+    $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
+    // If utf-8 encoding is used, we will need to make sure we don't
+    // split multibyte characters when we wrap
+    $is_utf8 = (strtolower($this->CharSet) == "utf-8");
+
+    $message = $this->FixEOL($message);
+    if (substr($message, -1) == $this->LE) {
+      $message = substr($message, 0, -1);
+    }
+
+    $line = explode($this->LE, $message);
+    $message = '';
+    for ($i=0 ;$i < count($line); $i++) {
+      $line_part = explode(' ', $line[$i]);
+      $buf = '';
+      for ($e = 0; $e<count($line_part); $e++) {
+        $word = $line_part[$e];
+        if ($qp_mode and (strlen($word) > $length)) {
+          $space_left = $length - strlen($buf) - 1;
+          if ($e != 0) {
+            if ($space_left > 20) {
+              $len = $space_left;
+              if ($is_utf8) {
+                $len = $this->UTF8CharBoundary($word, $len);
+              } elseif (substr($word, $len - 1, 1) == "=") {
+                $len--;
+              } elseif (substr($word, $len - 2, 1) == "=") {
+                $len -= 2;
+              }
+              $part = substr($word, 0, $len);
+              $word = substr($word, $len);
+              $buf .= ' ' . $part;
+              $message .= $buf . sprintf("=%s", $this->LE);
+            } else {
+              $message .= $buf . $soft_break;
+            }
+            $buf = '';
+          }
+          while (strlen($word) > 0) {
+            $len = $length;
+            if ($is_utf8) {
+              $len = $this->UTF8CharBoundary($word, $len);
+            } elseif (substr($word, $len - 1, 1) == "=") {
+              $len--;
+            } elseif (substr($word, $len - 2, 1) == "=") {
+              $len -= 2;
+            }
+            $part = substr($word, 0, $len);
+            $word = substr($word, $len);
+
+            if (strlen($word) > 0) {
+              $message .= $part . sprintf("=%s", $this->LE);
+            } else {
+              $buf = $part;
+            }
+          }
+        } else {
+          $buf_o = $buf;
+          $buf .= ($e == 0) ? $word : (' ' . $word);
+
+          if (strlen($buf) > $length and $buf_o != '') {
+            $message .= $buf_o . $soft_break;
+            $buf = $word;
+          }
+        }
+      }
+      $message .= $buf . $this->LE;
+    }
+
+    return $message;
+  }
+
+  /**
+   * Finds last character boundary prior to maxLength in a utf-8
+   * quoted (printable) encoded string.
+   * Original written by Colin Brown.
+   * @access private
+   * @param string $encodedText utf-8 QP text
+   * @param int    $maxLength   find last character boundary prior to this length
+   * @return int
+   */
+  function UTF8CharBoundary($encodedText, $maxLength) {
+    $foundSplitPos = false;
+    $lookBack = 3;
+    while (!$foundSplitPos) {
+      $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
+      $encodedCharPos = strpos($lastChunk, "=");
+      if ($encodedCharPos !== false) {
+        // Found start of encoded character byte within $lookBack block.
+        // Check the encoded byte value (the 2 chars after the '=')
+        $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
+        $dec = hexdec($hex);
+        if ($dec < 128) { // Single byte character.
+          // If the encoded char was found at pos 0, it will fit
+          // otherwise reduce maxLength to start of the encoded char
+          $maxLength = ($encodedCharPos == 0) ? $maxLength :
+          $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec >= 192) { // First byte of a multi byte character
+          // Reduce maxLength to split at start of character
+          $maxLength = $maxLength - ($lookBack - $encodedCharPos);
+          $foundSplitPos = true;
+        } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
+          $lookBack += 3;
+        }
+      } else {
+        // No encoded character found
+        $foundSplitPos = true;
+      }
+    }
+    return $maxLength;
+  }
+
+  /**
+   * Set the body wrapping.
+   * @access private
+   * @return void
+   */
+  function SetWordWrap() {
+    if($this->WordWrap < 1) {
+      return;
+    }
+
+    switch($this->message_type) {
+      case 'alt':
+        /* fall through */
+      case 'alt_attachments':
+        $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
+        break;
+      default:
+        $this->Body = $this->WrapText($this->Body, $this->WordWrap);
+        break;
+    }
+  }
+
+  /**
+   * Assembles message header.
+   * @access private
+   * @return string
+   */
+  function CreateHeader() {
+    $result = '';
+
+    /* Set the boundaries */
+    $uniq_id = md5(uniqid(time()));
+    $this->boundary[1] = 'b1_' . $uniq_id;
+    $this->boundary[2] = 'b2_' . $uniq_id;
+
+    $result .= $this->HeaderLine('Date', $this->RFCDate());
+    if($this->Sender == '') {
+      $result .= $this->HeaderLine('Return-Path', trim($this->From));
+    } else {
+      $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
+    }
+
+    /* To be created automatically by mail() */
+    if($this->Mailer != 'mail') {
+      if(count($this->to) > 0) {
+        $result .= $this->AddrAppend('To', $this->to);
+      } elseif (count($this->cc) == 0) {
+        $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
+      }
+      if(count($this->cc) > 0) {
+        $result .= $this->AddrAppend('Cc', $this->cc);
+      }
+    }
+
+    $from = array();
+    $from[0][0] = trim($this->From);
+    $from[0][1] = $this->FromName;
+    $result .= $this->AddrAppend('From', $from);
+
+    /* sendmail and mail() extract Cc from the header before sending */
+    if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
+      $result .= $this->AddrAppend('Cc', $this->cc);
+    }
+
+    /* sendmail and mail() extract Bcc from the header before sending */
+    if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
+      $result .= $this->AddrAppend('Bcc', $this->bcc);
+    }
+
+    if(count($this->ReplyTo) > 0) {
+      $result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
+    }
+
+    /* mail() sets the subject itself */
+    if($this->Mailer != 'mail') {
+      $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
+    }
+
+    if($this->MessageID != '') {
+      $result .= $this->HeaderLine('Message-ID',$this->MessageID);
+    } else {
+      $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
+    }
+    $result .= $this->HeaderLine('X-Priority', $this->Priority);
+    $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']');
+
+    if($this->ConfirmReadingTo != '') {
+      $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
+    }
+
+    // Add custom headers
+    for($index = 0; $index < count($this->CustomHeader); $index++) {
+      $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
+    }
+    if (!$this->sign_key_file) {
+      $result .= $this->HeaderLine('MIME-Version', '1.0');
+      $result .= $this->GetMailMIME();
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns the message MIME.
+   * @access private
+   * @return string
+   */
+  function GetMailMIME() {
+    $result = '';
+    switch($this->message_type) {
+      case 'plain':
+        $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
+        $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
+        break;
+      case 'attachments':
+        /* fall through */
+      case 'alt_attachments':
+        if($this->InlineImageExists()){
+          $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
+        } else {
+          $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
+          $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        }
+        break;
+      case 'alt':
+        $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
+        $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+        break;
+    }
+
+    if($this->Mailer != 'mail') {
+      $result .= $this->LE.$this->LE;
+    }
+
+    return $result;
+  }
+
+  /**
+   * Assembles the message body.  Returns an empty string on failure.
+   * @access private
+   * @return string
+   */
+  function CreateBody() {
+    $result = '';
+    if ($this->sign_key_file) {
+      $result .= $this->GetMailMIME();
+    }
+
+    $this->SetWordWrap();
+
+    switch($this->message_type) {
+      case 'alt':
+        $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
+        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->EndBoundary($this->boundary[1]);
+        break;
+      case 'plain':
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        break;
+      case 'attachments':
+        $result .= $this->GetBoundary($this->boundary[1], '', '', '');
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE;
+        $result .= $this->AttachAll();
+        break;
+      case 'alt_attachments':
+        $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+        $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
+        $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
+        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
+        $result .= $this->EncodeString($this->Body, $this->Encoding);
+        $result .= $this->LE.$this->LE;
+        $result .= $this->EndBoundary($this->boundary[2]);
+        $result .= $this->AttachAll();
+        break;
+    }
+
+    if($this->IsError()) {
+      $result = '';
+    } else if ($this->sign_key_file) {
+      $file = tempnam("", "mail");
+      $fp = fopen($file, "w");
+      fwrite($fp, $result);
+      fclose($fp);
+      $signed = tempnam("", "signed");
+
+      if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_key_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
+        $fp = fopen($signed, "r");
+        $result = fread($fp, filesize($this->sign_key_file));
+        fclose($fp);
+      } else {
+        $this->SetError($this->Lang("signing").openssl_error_string());
+        $result = '';
+      }
+
+      unlink($file);
+      unlink($signed);
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns the start of a message boundary.
+   * @access private
+   */
+  function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+    $result = '';
+    if($charSet == '') {
+      $charSet = $this->CharSet;
+    }
+    if($contentType == '') {
+      $contentType = $this->ContentType;
+    }
+    if($encoding == '') {
+      $encoding = $this->Encoding;
+    }
+    $result .= $this->TextLine('--' . $boundary);
+    $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
+    $result .= $this->LE;
+    $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
+    $result .= $this->LE;
+
+    return $result;
+  }
+
+  /**
+   * Returns the end of a message boundary.
+   * @access private
+   */
+  function EndBoundary($boundary) {
+    return $this->LE . '--' . $boundary . '--' . $this->LE;
+  }
+
+  /**
+   * Sets the message type.
+   * @access private
+   * @return void
+   */
+  function SetMessageType() {
+    if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
+      $this->message_type = 'plain';
+    } else {
+      if(count($this->attachment) > 0) {
+        $this->message_type = 'attachments';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
+        $this->message_type = 'alt';
+      }
+      if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
+        $this->message_type = 'alt_attachments';
+      }
+    }
+  }
+
+  /* Returns a formatted header line.
+   * @access private
+   * @return string
+   */
+  function HeaderLine($name, $value) {
+    return $name . ': ' . $value . $this->LE;
+  }
+
+  /**
+   * Returns a formatted mail line.
+   * @access private
+   * @return string
+   */
+  function TextLine($value) {
+    return $value . $this->LE;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, ATTACHMENTS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds an attachment from a path on the filesystem.
+   * Returns false if the file could not be found
+   * or accessed.
+   * @param string $path Path to the attachment.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+    if(!@is_file($path)) {
+      $this->SetError($this->Lang('file_access') . $path);
+      return false;
+    }
+
+    $filename = basename($path);
+    if($name == '') {
+      $name = $filename;
+    }
+
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $path;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $name;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = false; // isStringAttachment
+    $this->attachment[$cur][6] = 'attachment';
+    $this->attachment[$cur][7] = 0;
+
+    return true;
+  }
+
+  /**
+   * Attaches all fs, string, and binary attachments to the message.
+   * Returns an empty string on failure.
+   * @access private
+   * @return string
+   */
+  function AttachAll() {
+    /* Return text of body */
+    $mime = array();
+
+    /* Add all attachments */
+    for($i = 0; $i < count($this->attachment); $i++) {
+      /* Check for string attachment */
+      $bString = $this->attachment[$i][5];
+      if ($bString) {
+        $string = $this->attachment[$i][0];
+      } else {
+        $path = $this->attachment[$i][0];
+      }
+
+      $filename    = $this->attachment[$i][1];
+      $name        = $this->attachment[$i][2];
+      $encoding    = $this->attachment[$i][3];
+      $type        = $this->attachment[$i][4];
+      $disposition = $this->attachment[$i][6];
+      $cid         = $this->attachment[$i][7];
+
+      $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
+      $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
+      $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
+
+      if($disposition == 'inline') {
+        $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
+      }
+
+      $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE);
+
+      /* Encode as string attachment */
+      if($bString) {
+        $mime[] = $this->EncodeString($string, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      } else {
+        $mime[] = $this->EncodeFile($path, $encoding);
+        if($this->IsError()) {
+          return '';
+        }
+        $mime[] = $this->LE.$this->LE;
+      }
+    }
+
+    $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
+
+    return join('', $mime);
+  }
+
+  /**
+   * Encodes attachment in requested format.  Returns an
+   * empty string on failure.
+   * @access private
+   * @return string
+   */
+  function EncodeFile ($path, $encoding = 'base64') {
+    if(!@$fd = fopen($path, 'rb')) {
+      $this->SetError($this->Lang('file_open') . $path);
+      return '';
+    }
+    $magic_quotes = get_magic_quotes_runtime();
+    set_magic_quotes_runtime(0);
+    $file_buffer = fread($fd, filesize($path));
+    $file_buffer = $this->EncodeString($file_buffer, $encoding);
+    fclose($fd);
+    set_magic_quotes_runtime($magic_quotes);
+
+    return $file_buffer;
+  }
+
+  /**
+   * Encodes string to requested format. Returns an
+   * empty string on failure.
+   * @access private
+   * @return string
+   */
+  function EncodeString ($str, $encoding = 'base64') {
+    $encoded = '';
+    switch(strtolower($encoding)) {
+      case 'base64':
+        /* chunk_split is found in PHP >= 3.0.6 */
+        $encoded = chunk_split(base64_encode($str), 76, $this->LE);
+        break;
+      case '7bit':
+      case '8bit':
+        $encoded = $this->FixEOL($str);
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+          $encoded .= $this->LE;
+        break;
+      case 'binary':
+        $encoded = $str;
+        break;
+      case 'quoted-printable':
+        $encoded = $this->EncodeQP($str);
+        break;
+      default:
+        $this->SetError($this->Lang('encoding') . $encoding);
+        break;
+    }
+    return $encoded;
+  }
+
+  /**
+   * Encode a header string to best of Q, B, quoted or none.
+   * @access private
+   * @return string
+   */
+  function EncodeHeader ($str, $position = 'text') {
+    $x = 0;
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        if (!preg_match('/[\200-\377]/', $str)) {
+          /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
+          $encoded = addcslashes($str, "\0..\37\177\\\"");
+          if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
+            return ($encoded);
+          } else {
+            return ("\"$encoded\"");
+          }
+        }
+        $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+        break;
+      case 'comment':
+        $x = preg_match_all('/[()"]/', $str, $matches);
+        /* Fall-through */
+      case 'text':
+      default:
+        $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+        break;
+    }
+
+    if ($x == 0) {
+      return ($str);
+    }
+
+    $maxlen = 75 - 7 - strlen($this->CharSet);
+    /* Try to select the encoding which should produce the shortest output */
+    if (strlen($str)/3 < $x) {
+      $encoding = 'B';
+      if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
+     // Use a custom function which correctly encodes and wraps long
+     // multibyte strings without breaking lines within a character
+        $encoded = $this->Base64EncodeWrapMB($str);
+      } else {
+        $encoded = base64_encode($str);
+        $maxlen -= $maxlen % 4;
+        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
+      }
+    } else {
+      $encoding = 'Q';
+      $encoded = $this->EncodeQ($str, $position);
+      $encoded = $this->WrapText($encoded, $maxlen, true);
+      $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
+    }
+
+    $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
+    $encoded = trim(str_replace("\n", $this->LE, $encoded));
+
+    return $encoded;
+  }
+
+  /**
+   * Checks if a string contains multibyte characters.
+   * @access private
+   * @param string $str multi-byte text to wrap encode
+   * @return bool
+   */
+  function HasMultiBytes($str) {
+    if (function_exists('mb_strlen')) {
+      return (strlen($str) > mb_strlen($str, $this->CharSet));
+    } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
+      return False;
+    }
+  }
+
+  /**
+   * Correctly encodes and wraps long multibyte strings for mail headers
+   * without breaking lines within a character.
+   * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
+   * @access private
+   * @param string $str multi-byte text to wrap encode
+   * @return string
+   */
+  function Base64EncodeWrapMB($str) {
+    $start = "=?".$this->CharSet."?B?";
+    $end = "?=";
+    $encoded = "";
+
+    $mb_length = mb_strlen($str, $this->CharSet);
+    // Each line must have length <= 75, including $start and $end
+    $length = 75 - strlen($start) - strlen($end);
+    // Average multi-byte ratio
+    $ratio = $mb_length / strlen($str);
+    // Base64 has a 4:3 ratio
+    $offset = $avgLength = floor($length * $ratio * .75);
+
+    for ($i = 0; $i < $mb_length; $i += $offset) {
+      $lookBack = 0;
+
+      do {
+        $offset = $avgLength - $lookBack;
+        $chunk = mb_substr($str, $i, $offset, $this->CharSet);
+        $chunk = base64_encode($chunk);
+        $lookBack++;
+      }
+      while (strlen($chunk) > $length);
+
+      $encoded .= $chunk . $this->LE;
+    }
+
+    // Chomp the last linefeed
+    $encoded = substr($encoded, 0, -strlen($this->LE));
+    return $encoded;
+  }
+
+  /**
+   * Encode string to quoted-printable.
+   * @access private
+   * @return string
+   */
+  function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
+    $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
+    $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
+    $eol = "\r\n";
+    $escape = '=';
+    $output = '';
+    while( list(, $line) = each($lines) ) {
+      $linlen = strlen($line);
+      $newline = '';
+      for($i = 0; $i < $linlen; $i++) {
+        $c = substr( $line, $i, 1 );
+        $dec = ord( $c );
+        if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
+          $c = '=2E';
+        }
+        if ( $dec == 32 ) {
+          if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
+            $c = '=20';
+          } else if ( $space_conv ) {
+            $c = '=20';
+          }
+        } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
+          $h2 = floor($dec/16);
+          $h1 = floor($dec%16);
+          $c = $escape.$hex[$h2].$hex[$h1];
+        }
+        if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
+          $output .= $newline.$escape.$eol; //  soft line break; " =\r\n" is okay
+          $newline = '';
+          // check if newline first character will be point or not
+          if ( $dec == 46 ) {
+            $c = '=2E';
+          }
+        }
+        $newline .= $c;
+      } // end of for
+      $output .= $newline.$eol;
+    } // end of while
+    return trim($output);
+  }
+
+  /**
+   * Encode string to q encoding.
+   * @access private
+   * @return string
+   */
+  function EncodeQ ($str, $position = 'text') {
+    /* There should not be any EOL in the string */
+    $encoded = preg_replace("[\r\n]", '', $str);
+
+    switch (strtolower($position)) {
+      case 'phrase':
+        $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+      case 'comment':
+        $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+      case 'text':
+      default:
+        /* Replace every high ascii, control =, ? and _ characters */
+        $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
+              "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        break;
+    }
+
+    /* Replace every spaces to _ (more readable than =20) */
+    $encoded = str_replace(' ', '_', $encoded);
+
+    return $encoded;
+  }
+
+  /**
+   * Adds a string or binary attachment (non-filesystem) to the list.
+   * This method can be used to attach ascii or binary data,
+   * such as a BLOB record from a database.
+   * @param string $string String attachment data.
+   * @param string $filename Name of the attachment.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return void
+   */
+  function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
+    /* Append to $attachment array */
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $string;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $filename;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = true; // isString
+    $this->attachment[$cur][6] = 'attachment';
+    $this->attachment[$cur][7] = 0;
+  }
+
+  /**
+   * Adds an embedded attachment.  This can include images, sounds, and
+   * just about any other document.  Make sure to set the $type to an
+   * image type.  For JPEG images use "image/jpeg" and for GIF images
+   * use "image/gif".
+   * @param string $path Path to the attachment.
+   * @param string $cid Content ID of the attachment.  Use this to identify
+   *        the Id for accessing the image in an HTML form.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+
+    if(!@is_file($path)) {
+      $this->SetError($this->Lang('file_access') . $path);
+      return false;
+    }
+
+    $filename = basename($path);
+    if($name == '') {
+      $name = $filename;
+    }
+
+    /* Append to $attachment array */
+    $cur = count($this->attachment);
+    $this->attachment[$cur][0] = $path;
+    $this->attachment[$cur][1] = $filename;
+    $this->attachment[$cur][2] = $name;
+    $this->attachment[$cur][3] = $encoding;
+    $this->attachment[$cur][4] = $type;
+    $this->attachment[$cur][5] = false;
+    $this->attachment[$cur][6] = 'inline';
+    $this->attachment[$cur][7] = $cid;
+
+    return true;
+  }
+
+  /**
+   * Returns true if an inline attachment is present.
+   * @access private
+   * @return bool
+   */
+  function InlineImageExists() {
+    $result = false;
+    for($i = 0; $i < count($this->attachment); $i++) {
+      if($this->attachment[$i][6] == 'inline') {
+        $result = true;
+        break;
+      }
+    }
+
+    return $result;
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MESSAGE RESET
+  /////////////////////////////////////////////////
+
+  /**
+   * Clears all recipients assigned in the TO array.  Returns void.
+   * @return void
+   */
+  function ClearAddresses() {
+    $this->to = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the CC array.  Returns void.
+   * @return void
+   */
+  function ClearCCs() {
+    $this->cc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the BCC array.  Returns void.
+   * @return void
+   */
+  function ClearBCCs() {
+    $this->bcc = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the ReplyTo array.  Returns void.
+   * @return void
+   */
+  function ClearReplyTos() {
+    $this->ReplyTo = array();
+  }
+
+  /**
+   * Clears all recipients assigned in the TO, CC and BCC
+   * array.  Returns void.
+   * @return void
+   */
+  function ClearAllRecipients() {
+    $this->to = array();
+    $this->cc = array();
+    $this->bcc = array();
+  }
+
+  /**
+   * Clears all previously set filesystem, string, and binary
+   * attachments.  Returns void.
+   * @return void
+   */
+  function ClearAttachments() {
+    $this->attachment = array();
+  }
+
+  /**
+   * Clears all custom headers.  Returns void.
+   * @return void
+   */
+  function ClearCustomHeaders() {
+    $this->CustomHeader = array();
+  }
+
+  /////////////////////////////////////////////////
+  // CLASS METHODS, MISCELLANEOUS
+  /////////////////////////////////////////////////
+
+  /**
+   * Adds the error message to the error container.
+   * Returns void.
+   * @access private
+   * @return void
+   */
+  function SetError($msg) {
+    $this->error_count++;
+    $this->ErrorInfo = $msg;
+  }
+
+  /**
+   * Returns the proper RFC 822 formatted date.
+   * @access private
+   * @return string
+   */
+  function RFCDate() {
+    $tz = date('Z');
+    $tzs = ($tz < 0) ? '-' : '+';
+    $tz = abs($tz);
+    $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
+    $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
+
+    return $result;
+  }
+
+  /**
+   * Returns the appropriate server variable.  Should work with both
+   * PHP 4.1.0+ as well as older versions.  Returns an empty string
+   * if nothing is found.
+   * @access private
+   * @return mixed
+   */
+  function ServerVar($varName) {
+    global $HTTP_SERVER_VARS;
+    global $HTTP_ENV_VARS;
+
+    if(!isset($_SERVER)) {
+      $_SERVER = $HTTP_SERVER_VARS;
+      if(!isset($_SERVER['REMOTE_ADDR'])) {
+        $_SERVER = $HTTP_ENV_VARS; // must be Apache
+      }
+    }
+
+    if(isset($_SERVER[$varName])) {
+      return $_SERVER[$varName];
+    } else {
+      return '';
+    }
+  }
+
+  /**
+   * Returns the server hostname or 'localhost.localdomain' if unknown.
+   * @access private
+   * @return string
+   */
+  function ServerHostname() {
+    if ($this->Hostname != '') {
+      $result = $this->Hostname;
+    } elseif ($this->ServerVar('SERVER_NAME') != '') {
+      $result = $this->ServerVar('SERVER_NAME');
+    } else {
+      $result = 'localhost.localdomain';
+    }
+
+    return $result;
+  }
+
+  /**
+   * Returns a message in the appropriate language.
+   * @access private
+   * @return string
+   */
+  function Lang($key) {
+    if(count($this->language) < 1) {
+      $this->SetLanguage('en'); // set the default language
+    }
+
+    if(isset($this->language[$key])) {
+      return $this->language[$key];
+    } else {
+      return 'Language string failed to load: ' . $key;
+    }
+  }
+
+  /**
+   * Returns true if an error occurred.
+   * @return bool
+   */
+  function IsError() {
+    return ($this->error_count > 0);
+  }
+
+  /**
+   * Changes every end of line from CR or LF to CRLF.
+   * @access private
+   * @return string
+   */
+  function FixEOL($str) {
+    $str = str_replace("\r\n", "\n", $str);
+    $str = str_replace("\r", "\n", $str);
+    $str = str_replace("\n", $this->LE, $str);
+    return $str;
+  }
+
+  /**
+   * Adds a custom header.
+   * @return void
+   */
+  function AddCustomHeader($custom_header) {
+    $this->CustomHeader[] = explode(':', $custom_header, 2);
+  }
+
+  /**
+   * Evaluates the message and returns modifications for inline images and backgrounds
+   * @access public
+   * @return $message
+   */
+  function MsgHTML($message,$basedir='') {
+    preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
+    if(isset($images[2])) {
+      foreach($images[2] as $i => $url) {
+        // do not change urls for absolute images (thanks to corvuscorax)
+        if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
+          $filename = basename($url);
+          $directory = dirname($url);
+          ($directory == '.')?$directory='':'';
+          $cid = 'cid:' . md5($filename);
+          $fileParts = split("\.", $filename);
+          $ext = $fileParts[1];
+          $mimeType = $this->_mime_types($ext);
+          if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
+          if ( strlen($directory) > 1 && substr($basedir,-1) != '/') { $directory .= '/'; }
+          $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType);
+          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
+            $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
+          }
+        }
+      }
+    }
+    $this->IsHTML(true);
+    $this->Body = $message;
+    $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
+    if ( !empty($textMsg) && empty($this->AltBody) ) {
+      $this->AltBody = $textMsg;
+    }
+    if ( empty($this->AltBody) ) {
+      $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
+    }
+  }
+
+  /**
+   * Gets the mime type of the embedded or inline image
+   * @access private
+   * @return mime type of ext
+   */
+  function _mime_types($ext = '') {
+    $mimes = array(
+      'hqx'  =>  'application/mac-binhex40',
+      'cpt'   =>  'application/mac-compactpro',
+      'doc'   =>  'application/msword',
+      'bin'   =>  'application/macbinary',
+      'dms'   =>  'application/octet-stream',
+      'lha'   =>  'application/octet-stream',
+      'lzh'   =>  'application/octet-stream',
+      'exe'   =>  'application/octet-stream',
+      'class' =>  'application/octet-stream',
+      'psd'   =>  'application/octet-stream',
+      'so'    =>  'application/octet-stream',
+      'sea'   =>  'application/octet-stream',
+      'dll'   =>  'application/octet-stream',
+      'oda'   =>  'application/oda',
+      'pdf'   =>  'application/pdf',
+      'ai'    =>  'application/postscript',
+      'eps'   =>  'application/postscript',
+      'ps'    =>  'application/postscript',
+      'smi'   =>  'application/smil',
+      'smil'  =>  'application/smil',
+      'mif'   =>  'application/vnd.mif',
+      'xls'   =>  'application/vnd.ms-excel',
+      'ppt'   =>  'application/vnd.ms-powerpoint',
+      'wbxml' =>  'application/vnd.wap.wbxml',
+      'wmlc'  =>  'application/vnd.wap.wmlc',
+      'dcr'   =>  'application/x-director',
+      'dir'   =>  'application/x-director',
+      'dxr'   =>  'application/x-director',
+      'dvi'   =>  'application/x-dvi',
+      'gtar'  =>  'application/x-gtar',
+      'php'   =>  'application/x-httpd-php',
+      'php4'  =>  'application/x-httpd-php',
+      'php3'  =>  'application/x-httpd-php',
+      'phtml' =>  'application/x-httpd-php',
+      'phps'  =>  'application/x-httpd-php-source',
+      'js'    =>  'application/x-javascript',
+      'swf'   =>  'application/x-shockwave-flash',
+      'sit'   =>  'application/x-stuffit',
+      'tar'   =>  'application/x-tar',
+      'tgz'   =>  'application/x-tar',
+      'xhtml' =>  'application/xhtml+xml',
+      'xht'   =>  'application/xhtml+xml',
+      'zip'   =>  'application/zip',
+      'mid'   =>  'audio/midi',
+      'midi'  =>  'audio/midi',
+      'mpga'  =>  'audio/mpeg',
+      'mp2'   =>  'audio/mpeg',
+      'mp3'   =>  'audio/mpeg',
+      'aif'   =>  'audio/x-aiff',
+      'aiff'  =>  'audio/x-aiff',
+      'aifc'  =>  'audio/x-aiff',
+      'ram'   =>  'audio/x-pn-realaudio',
+      'rm'    =>  'audio/x-pn-realaudio',
+      'rpm'   =>  'audio/x-pn-realaudio-plugin',
+      'ra'    =>  'audio/x-realaudio',
+      'rv'    =>  'video/vnd.rn-realvideo',
+      'wav'   =>  'audio/x-wav',
+      'bmp'   =>  'image/bmp',
+      'gif'   =>  'image/gif',
+      'jpeg'  =>  'image/jpeg',
+      'jpg'   =>  'image/jpeg',
+      'jpe'   =>  'image/jpeg',
+      'png'   =>  'image/png',
+      'tiff'  =>  'image/tiff',
+      'tif'   =>  'image/tiff',
+      'css'   =>  'text/css',
+      'html'  =>  'text/html',
+      'htm'   =>  'text/html',
+      'shtml' =>  'text/html',
+      'txt'   =>  'text/plain',
+      'text'  =>  'text/plain',
+      'log'   =>  'text/plain',
+      'rtx'   =>  'text/richtext',
+      'rtf'   =>  'text/rtf',
+      'xml'   =>  'text/xml',
+      'xsl'   =>  'text/xml',
+      'mpeg'  =>  'video/mpeg',
+      'mpg'   =>  'video/mpeg',
+      'mpe'   =>  'video/mpeg',
+      'qt'    =>  'video/quicktime',
+      'mov'   =>  'video/quicktime',
+      'avi'   =>  'video/x-msvideo',
+      'movie' =>  'video/x-sgi-movie',
+      'doc'   =>  'application/msword',
+      'word'  =>  'application/msword',
+      'xl'    =>  'application/excel',
+      'eml'   =>  'message/rfc822'
+    );
+    return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
+  }
+
+  /**
+   * Set (or reset) Class Objects (variables)
+   *
+   * Usage Example:
+   * $page->set('X-Priority', '3');
+   *
+   * @access public
+   * @param string $name Parameter Name
+   * @param mixed $value Parameter Value
+   * NOTE: will not work with arrays, there are no arrays to set/reset
+   */
+  function set ( $name, $value = '' ) {
+    if ( isset($this->$name) ) {
+      $this->$name = $value;
+    } else {
+      $this->SetError('Cannot set or reset variable ' . $name);
+      return false;
+    }
+  }
+
+  /**
+   * Read a file from a supplied filename and return it.
+   *
+   * @access public
+   * @param string $filename Parameter File Name
+   */
+  function getFile($filename) {
+    $return = '';
+    if ($fp = fopen($filename, 'rb')) {
+      while (!feof($fp)) {
+        $return .= fread($fp, 1024);
+      }
+      fclose($fp);
+      return $return;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Strips newlines to prevent header injection.
+   * @access private
+   * @param string $str String
+   * @return string
+   */
+  function SecureHeader($str) {
+    $str = trim($str);
+    $str = str_replace("\r", "", $str);
+    $str = str_replace("\n", "", $str);
+    return $str;
+  }
+
+  /**
+   * Set the private key file and password to sign the message.
+   *
+   * @access public
+   * @param string $key_filename Parameter File Name
+   * @param string $key_pass Password for private key
+   */
+  function Sign($key_filename, $key_pass) {
+    $this->sign_key_file = $key_filename;
+    $this->sign_key_pass = $key_pass;
+  }
+
+}
+
+?>
diff --git a/inc/phpmailer/class.pop3.php b/inc/phpmailer/class.pop3.php
new file mode 100644 (file)
index 0000000..e97a0c9
--- /dev/null
@@ -0,0 +1,436 @@
+<?php
+/*~ class.pop3.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.0.2                                                          |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * POP Before SMTP Authentication Class
+ *
+ * Author: Richard Davey (rich@corephp.co.uk)
+ * License: LGPL, see PHPMailer License
+ *
+ * Specifically for PHPMailer to allow POP before SMTP authentication.
+ * Does not yet work with APOP - if you have an APOP account, contact me
+ * and we can test changes to this script.
+ *
+ * This class is based on the structure of the SMTP class by Chris Ryan
+ *
+ * This class is rfc 1939 compliant and implements all the commands
+ * required for POP3 connection, authentication and disconnection.
+ *
+ * @package PHPMailer
+ * @author Richard Davey
+ */
+
+class POP3
+{
+  /**
+   * Default POP3 port
+   * @var int
+   */
+  var $POP3_PORT = 110;
+
+  /**
+   * Default Timeout
+   * @var int
+   */
+  var $POP3_TIMEOUT = 30;
+
+  /**
+   * POP3 Carriage Return + Line Feed
+   * @var string
+   */
+  var $CRLF = "\r\n";
+
+  /**
+   * Displaying Debug warnings? (0 = now, 1+ = yes)
+   * @var int
+   */
+  var $do_debug = 2;
+
+  /**
+   * POP3 Mail Server
+   * @var string
+   */
+  var $host;
+
+  /**
+   * POP3 Port
+   * @var int
+   */
+  var $port;
+
+  /**
+   * POP3 Timeout Value
+   * @var int
+   */
+  var $tval;
+
+  /**
+   * POP3 Username
+   * @var string
+   */
+  var $username;
+
+  /**
+   * POP3 Password
+   * @var string
+   */
+  var $password;
+
+  /**#@+
+   * @access private
+   */
+  var $pop_conn;
+  var $connected;
+  var $error;     //  Error log array
+  /**#@-*/
+
+  /**
+   * Constructor, sets the initial values
+   *
+   * @return POP3
+   */
+  function POP3 ()
+    {
+      $this->pop_conn = 0;
+      $this->connected = false;
+      $this->error = null;
+    }
+
+  /**
+   * Combination of public events - connect, login, disconnect
+   *
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @param string $username
+   * @param string $password
+   */
+  function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0)
+  {
+    $this->host = $host;
+
+    //  If no port value is passed, retrieve it
+    if ($port == false)
+    {
+      $this->port = $this->POP3_PORT;
+    }
+    else
+    {
+      $this->port = $port;
+    }
+
+    //  If no port value is passed, retrieve it
+    if ($tval == false)
+    {
+      $this->tval = $this->POP3_TIMEOUT;
+    }
+    else
+    {
+      $this->tval = $tval;
+    }
+
+    $this->do_debug = $debug_level;
+    $this->username = $username;
+    $this->password = $password;
+
+    //  Refresh the error log
+      $this->error = null;
+
+      //  Connect
+    $result = $this->Connect($this->host, $this->port, $this->tval);
+
+    if ($result)
+    {
+      $login_result = $this->Login($this->username, $this->password);
+
+      if ($login_result)
+      {
+        $this->Disconnect();
+
+        return true;
+      }
+
+    }
+
+    //  We need to disconnect regardless if the login succeeded
+    $this->Disconnect();
+
+    return false;
+  }
+
+  /**
+   * Connect to the POP3 server
+   *
+   * @param string $host
+   * @param integer $port
+   * @param integer $tval
+   * @return boolean
+   */
+  function Connect ($host, $port = false, $tval = 30)
+    {
+    //  Are we already connected?
+    if ($this->connected)
+    {
+      return true;
+    }
+
+    /*
+      On Windows this will raise a PHP Warning error if the hostname doesn't exist.
+      Rather than supress it with @fsockopen, let's capture it cleanly instead
+    */
+
+    set_error_handler(array(&$this, 'catchWarning'));
+
+    //  Connect to the POP3 server
+    $this->pop_conn = fsockopen($host,    //  POP3 Host
+                  $port,    //  Port #
+                  $errno,   //  Error Number
+                  $errstr,  //  Error Message
+                  $tval);   //  Timeout (seconds)
+
+    //  Restore the error handler
+    restore_error_handler();
+
+    //  Does the Error Log now contain anything?
+    if ($this->error && $this->do_debug >= 1)
+    {
+        $this->displayErrors();
+    }
+
+    //  Did we connect?
+      if ($this->pop_conn == false)
+      {
+        //  It would appear not...
+        $this->error = array(
+          'error' => "Failed to connect to server $host on port $port",
+          'errno' => $errno,
+          'errstr' => $errstr
+        );
+
+        if ($this->do_debug >= 1)
+        {
+          $this->displayErrors();
+        }
+
+        return false;
+      }
+
+      //  Increase the stream time-out
+
+      //  Check for PHP 4.3.0 or later
+      if (version_compare(phpversion(), '4.3.0', 'ge'))
+      {
+        stream_set_timeout($this->pop_conn, $tval, 0);
+      }
+      else
+      {
+        //  Does not work on Windows
+        if (substr(PHP_OS, 0, 3) !== 'WIN')
+        {
+          socket_set_timeout($this->pop_conn, $tval, 0);
+        }
+      }
+
+    //  Get the POP3 server response
+      $pop3_response = $this->getResponse();
+
+      //  Check for the +OK
+      if ($this->checkResponse($pop3_response))
+      {
+      //  The connection is established and the POP3 server is talking
+      $this->connected = true;
+        return true;
+      }
+
+    }
+
+    /**
+     * Login to the POP3 server (does not support APOP yet)
+     *
+     * @param string $username
+     * @param string $password
+     * @return boolean
+     */
+    function Login ($username = '', $password = '')
+    {
+      if ($this->connected == false)
+      {
+        $this->error = 'Not connected to POP3 server';
+
+        if ($this->do_debug >= 1)
+        {
+          $this->displayErrors();
+        }
+      }
+
+      if (empty($username))
+      {
+        $username = $this->username;
+      }
+
+      if (empty($password))
+      {
+        $password = $this->password;
+      }
+
+    $pop_username = "USER $username" . $this->CRLF;
+    $pop_password = "PASS $password" . $this->CRLF;
+
+      //  Send the Username
+      $this->sendString($pop_username);
+      $pop3_response = $this->getResponse();
+
+      if ($this->checkResponse($pop3_response))
+      {
+        //  Send the Password
+        $this->sendString($pop_password);
+        $pop3_response = $this->getResponse();
+
+        if ($this->checkResponse($pop3_response))
+        {
+          return true;
+        }
+        else
+        {
+          return false;
+        }
+      }
+      else
+      {
+        return false;
+      }
+    }
+
+    /**
+     * Disconnect from the POP3 server
+     */
+    function Disconnect ()
+    {
+      $this->sendString('QUIT');
+
+      fclose($this->pop_conn);
+    }
+
+    /*
+      ---------------
+      Private Methods
+      ---------------
+    */
+
+    /**
+     * Get the socket response back.
+     * $size is the maximum number of bytes to retrieve
+     *
+     * @param integer $size
+     * @return string
+     */
+    function getResponse ($size = 128)
+    {
+      $pop3_response = fgets($this->pop_conn, $size);
+
+      return $pop3_response;
+    }
+
+    /**
+     * Send a string down the open socket connection to the POP3 server
+     *
+     * @param string $string
+     * @return integer
+     */
+    function sendString ($string)
+    {
+      $bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
+
+      return $bytes_sent;
+
+    }
+
+    /**
+     * Checks the POP3 server response for +OK or -ERR
+     *
+     * @param string $string
+     * @return boolean
+     */
+    function checkResponse ($string)
+    {
+      if (substr($string, 0, 3) !== '+OK')
+      {
+        $this->error = array(
+          'error' => "Server reported an error: $string",
+          'errno' => 0,
+          'errstr' => ''
+        );
+
+        if ($this->do_debug >= 1)
+        {
+          $this->displayErrors();
+        }
+
+        return false;
+      }
+      else
+      {
+        return true;
+      }
+
+    }
+
+    /**
+     * If debug is enabled, display the error message array
+     *
+     */
+    function displayErrors ()
+    {
+      echo '<pre>';
+
+      foreach ($this->error as $single_error)
+    {
+        print_r($single_error);
+    }
+
+      echo '</pre>';
+    }
+
+  /**
+   * Takes over from PHP for the socket warning handler
+   *
+   * @param integer $errno
+   * @param string $errstr
+   * @param string $errfile
+   * @param integer $errline
+   */
+  function catchWarning ($errno, $errstr, $errfile, $errline)
+  {
+    $this->error[] = array(
+      'error' => "Connecting to the POP3 server raised a PHP warning: ",
+      'errno' => $errno,
+      'errstr' => $errstr
+    );
+  }
+
+  //  End of class
+}
+?>
diff --git a/inc/phpmailer/class.smtp.php b/inc/phpmailer/class.smtp.php
new file mode 100644 (file)
index 0000000..398c3ff
--- /dev/null
@@ -0,0 +1,1062 @@
+<?php
+/*~ class.smtp.php
+.---------------------------------------------------------------------------.
+|  Software: PHPMailer - PHP email class                                    |
+|   Version: 2.0.2                                                          |
+|   Contact: via sourceforge.net support pages (also www.codeworxtech.com)  |
+|      Info: http://phpmailer.sourceforge.net                               |
+|   Support: http://sourceforge.net/projects/phpmailer/                     |
+| ------------------------------------------------------------------------- |
+|    Author: Andy Prevost (project admininistrator)                         |
+|    Author: Brent R. Matzelle (original founder)                           |
+| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved.               |
+| Copyright (c) 2001-2003, Brent R. Matzelle                                |
+| ------------------------------------------------------------------------- |
+|   License: Distributed under the Lesser General Public License (LGPL)     |
+|            http://www.gnu.org/copyleft/lesser.html                        |
+| This program is distributed in the hope that it will be useful - WITHOUT  |
+| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
+| FITNESS FOR A PARTICULAR PURPOSE.                                         |
+| ------------------------------------------------------------------------- |
+| We offer a number of paid services (www.codeworxtech.com):                |
+| - Web Hosting on highly optimized fast and secure servers                 |
+| - Technology Consulting                                                   |
+| - Oursourcing (highly qualified programmers and graphic designers)        |
+'---------------------------------------------------------------------------'
+
+/**
+ * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
+ * commands except TURN which will always return a not implemented
+ * error. SMTP also provides some utility methods for sending mail
+ * to an SMTP server.
+ * @package PHPMailer
+ * @author Chris Ryan
+ */
+
+class SMTP
+{
+  /**
+   *  SMTP server port
+   *  @var int
+   */
+  var $SMTP_PORT = 25;
+
+  /**
+   *  SMTP reply line ending
+   *  @var string
+   */
+  var $CRLF = "\r\n";
+
+  /**
+   *  Sets whether debugging is turned on
+   *  @var bool
+   */
+  var $do_debug;       # the level of debug to perform
+
+  /**
+   *  Sets VERP use on/off (default is off)
+   *  @var bool
+   */
+  var $do_verp = false;
+
+  /**#@+
+   * @access private
+   */
+  var $smtp_conn;      # the socket to the server
+  var $error;          # error if any on the last call
+  var $helo_rply;      # the reply the server sent to us for HELO
+  /**#@-*/
+
+  /**
+   * Initialize the class so that the data is in a known state.
+   * @access public
+   * @return void
+   */
+  function SMTP() {
+    $this->smtp_conn = 0;
+    $this->error = null;
+    $this->helo_rply = null;
+
+    $this->do_debug = 0;
+  }
+
+  /*************************************************************
+   *                    CONNECTION FUNCTIONS                  *
+   ***********************************************************/
+
+  /**
+   * Connect to the server specified on the port specified.
+   * If the port is not specified use the default SMTP_PORT.
+   * If tval is specified then a connection will try and be
+   * established with the server for that number of seconds.
+   * If tval is not specified the default is 30 seconds to
+   * try on the connection.
+   *
+   * SMTP CODE SUCCESS: 220
+   * SMTP CODE FAILURE: 421
+   * @access public
+   * @return bool
+   */
+  function Connect($host,$port=0,$tval=30) {
+    # set the error val to null so there is no confusion
+    $this->error = null;
+
+    # make sure we are __not__ connected
+    if($this->connected()) {
+      # ok we are connected! what should we do?
+      # for now we will just give an error saying we
+      # are already connected
+      $this->error = array("error" => "Already connected to a server");
+      return false;
+    }
+
+    if(empty($port)) {
+      $port = $this->SMTP_PORT;
+    }
+
+    #connect to the smtp server
+    $this->smtp_conn = fsockopen($host,    # the host of the server
+                                 $port,    # the port to use
+                                 $errno,   # error number if any
+                                 $errstr,  # error message if any
+                                 $tval);   # give up after ? secs
+    # verify we connected properly
+    if(empty($this->smtp_conn)) {
+      $this->error = array("error" => "Failed to connect to server",
+                           "errno" => $errno,
+                           "errstr" => $errstr);
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": $errstr ($errno)" . $this->CRLF;
+      }
+      return false;
+    }
+
+    # sometimes the SMTP server takes a little longer to respond
+    # so we will give it a longer timeout for the first read
+    // Windows still does not have support for this timeout function
+    if(substr(PHP_OS, 0, 3) != "WIN")
+     socket_set_timeout($this->smtp_conn, $tval, 0);
+
+    # get any announcement stuff
+    $announce = $this->get_lines();
+
+    # set the timeout  of any socket functions at 1/10 of a second
+    //if(function_exists("socket_set_timeout"))
+    //   socket_set_timeout($this->smtp_conn, 0, 100000);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
+    }
+
+    return true;
+  }
+
+  /**
+   * Performs SMTP authentication.  Must be run after running the
+   * Hello() method.  Returns true if successfully authenticated.
+   * @access public
+   * @return bool
+   */
+  function Authenticate($username, $password) {
+    // Start authentication
+    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 334) {
+      $this->error =
+        array("error" => "AUTH not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    // Send encoded username
+    fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 334) {
+      $this->error =
+        array("error" => "Username not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    // Send encoded password
+    fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($code != 235) {
+      $this->error =
+        array("error" => "Password not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Returns true if connected to a server otherwise false
+   * @access private
+   * @return bool
+   */
+  function Connected() {
+    if(!empty($this->smtp_conn)) {
+      $sock_status = socket_get_status($this->smtp_conn);
+      if($sock_status["eof"]) {
+        # hmm this is an odd situation... the socket is
+        # valid but we are not connected anymore
+        if($this->do_debug >= 1) {
+            echo "SMTP -> NOTICE:" . $this->CRLF .
+                 "EOF caught while checking if connected";
+        }
+        $this->Close();
+        return false;
+      }
+      return true; # everything looks good
+    }
+    return false;
+  }
+
+  /**
+   * Closes the socket and cleans up the state of the class.
+   * It is not considered good to use this function without
+   * first trying to use QUIT.
+   * @access public
+   * @return void
+   */
+  function Close() {
+    $this->error = null; # so there is no confusion
+    $this->helo_rply = null;
+    if(!empty($this->smtp_conn)) {
+      # close the connection and cleanup
+      fclose($this->smtp_conn);
+      $this->smtp_conn = 0;
+    }
+  }
+
+  /***************************************************************
+   *                        SMTP COMMANDS                       *
+   *************************************************************/
+
+  /**
+   * Issues a data command and sends the msg_data to the server
+   * finializing the mail transaction. $msg_data is the message
+   * that is to be send with the headers. Each header needs to be
+   * on a single line followed by a <CRLF> with the message headers
+   * and the message body being seperated by and additional <CRLF>.
+   *
+   * Implements rfc 821: DATA <CRLF>
+   *
+   * SMTP CODE INTERMEDIATE: 354
+   *     [data]
+   *     <CRLF>.<CRLF>
+   *     SMTP CODE SUCCESS: 250
+   *     SMTP CODE FAILURE: 552,554,451,452
+   * SMTP CODE FAILURE: 451,554
+   * SMTP CODE ERROR  : 500,501,503,421
+   * @access public
+   * @return bool
+   */
+  function Data($msg_data) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Data() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"DATA" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 354) {
+      $this->error =
+        array("error" => "DATA command not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    # the server is ready to accept data!
+    # according to rfc 821 we should not send more than 1000
+    # including the CRLF
+    # characters on a single line so we will break the data up
+    # into lines by \r and/or \n then if needed we will break
+    # each of those into smaller lines to fit within the limit.
+    # in addition we will be looking for lines that start with
+    # a period '.' and append and additional period '.' to that
+    # line. NOTE: this does not count towards are limit.
+
+    # normalize the line breaks so we know the explode works
+    $msg_data = str_replace("\r\n","\n",$msg_data);
+    $msg_data = str_replace("\r","\n",$msg_data);
+    $lines = explode("\n",$msg_data);
+
+    # we need to find a good way to determine is headers are
+    # in the msg_data or if it is a straight msg body
+    # currently I am assuming rfc 822 definitions of msg headers
+    # and if the first field of the first line (':' sperated)
+    # does not contain a space then it _should_ be a header
+    # and we can process all lines before a blank "" line as
+    # headers.
+    $field = substr($lines[0],0,strpos($lines[0],":"));
+    $in_headers = false;
+    if(!empty($field) && !strstr($field," ")) {
+      $in_headers = true;
+    }
+
+    $max_line_length = 998; # used below; set here for ease in change
+
+    while(list(,$line) = @each($lines)) {
+      $lines_out = null;
+      if($line == "" && $in_headers) {
+        $in_headers = false;
+      }
+      # ok we need to break this line up into several
+      # smaller lines
+      while(strlen($line) > $max_line_length) {
+        $pos = strrpos(substr($line,0,$max_line_length)," ");
+
+        # Patch to fix DOS attack
+        if(!$pos) {
+          $pos = $max_line_length - 1;
+        }
+
+        $lines_out[] = substr($line,0,$pos);
+        $line = substr($line,$pos + 1);
+        # if we are processing headers we need to
+        # add a LWSP-char to the front of the new line
+        # rfc 822 on long msg headers
+        if($in_headers) {
+          $line = "\t" . $line;
+        }
+      }
+      $lines_out[] = $line;
+
+      # now send the lines to the server
+      while(list(,$line_out) = @each($lines_out)) {
+        if(strlen($line_out) > 0)
+        {
+          if(substr($line_out, 0, 1) == ".") {
+            $line_out = "." . $line_out;
+          }
+        }
+        fputs($this->smtp_conn,$line_out . $this->CRLF);
+      }
+    }
+
+    # ok all the message data has been sent so lets get this
+    # over with aleady
+    fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "DATA not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Expand takes the name and asks the server to list all the
+   * people who are members of the _list_. Expand will return
+   * back and array of the result or false if an error occurs.
+   * Each value in the array returned has the format of:
+   *     [ <full-name> <sp> ] <path>
+   * The definition of <path> is defined in rfc 821
+   *
+   * Implements rfc 821: EXPN <SP> <string> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE FAILURE: 550
+   * SMTP CODE ERROR  : 500,501,502,504,421
+   * @access public
+   * @return string array
+   */
+  function Expand($name) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+            "error" => "Called Expand() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "EXPN not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    # parse the reply and place in our array to return to user
+    $entries = explode($this->CRLF,$rply);
+    while(list(,$l) = @each($entries)) {
+      $list[] = substr($l,4);
+    }
+
+    return $list;
+  }
+
+  /**
+   * Sends the HELO command to the smtp server.
+   * This makes sure that we and the server are in
+   * the same known state.
+   *
+   * Implements from rfc 821: HELO <SP> <domain> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500, 501, 504, 421
+   * @access public
+   * @return bool
+   */
+  function Hello($host="") {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+            "error" => "Called Hello() without being connected");
+      return false;
+    }
+
+    # if a hostname for the HELO was not specified determine
+    # a suitable one to send
+    if(empty($host)) {
+      # we need to determine some sort of appopiate default
+      # to send to the server
+      $host = "localhost";
+    }
+
+    // Send extended hello first (RFC 2821)
+    if(!$this->SendHello("EHLO", $host))
+    {
+      if(!$this->SendHello("HELO", $host))
+          return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Sends a HELO/EHLO command.
+   * @access private
+   * @return bool
+   */
+  function SendHello($hello, $host) {
+    fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => $hello . " not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    $this->helo_rply = $rply;
+
+    return true;
+  }
+
+  /**
+   * Gets help information on the keyword specified. If the keyword
+   * is not specified then returns generic help, ussually contianing
+   * A list of keywords that help is available on. This function
+   * returns the results back to the user. It is up to the user to
+   * handle the returned data. If an error occurs then false is
+   * returned with $this->error set appropiately.
+   *
+   * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
+   *
+   * SMTP CODE SUCCESS: 211,214
+   * SMTP CODE ERROR  : 500,501,502,504,421
+   * @access public
+   * @return string
+   */
+  function Help($keyword="") {
+    $this->error = null; # to avoid confusion
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Help() without being connected");
+      return false;
+    }
+
+    $extra = "";
+    if(!empty($keyword)) {
+      $extra = " " . $keyword;
+    }
+
+    fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 211 && $code != 214) {
+      $this->error =
+        array("error" => "HELP not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return $rply;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command.
+   *
+   * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,421
+   * @access public
+   * @return bool
+   */
+  function Mail($from) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Mail() without being connected");
+      return false;
+    }
+
+    $useVerp = ($this->do_verp ? "XVERP" : "");
+    fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "MAIL not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the command NOOP to the SMTP server.
+   *
+   * Implements from rfc 821: NOOP <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500, 421
+   * @access public
+   * @return bool
+   */
+  function Noop() {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Noop() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"NOOP" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "NOOP not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the quit command to the server and then closes the socket
+   * if there is no error or the $close_on_error argument is true.
+   *
+   * Implements from rfc 821: QUIT <CRLF>
+   *
+   * SMTP CODE SUCCESS: 221
+   * SMTP CODE ERROR  : 500
+   * @access public
+   * @return bool
+   */
+  function Quit($close_on_error=true) {
+    $this->error = null; # so there is no confusion
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Quit() without being connected");
+      return false;
+    }
+
+    # send the quit command to the server
+    fputs($this->smtp_conn,"quit" . $this->CRLF);
+
+    # get any good-bye messages
+    $byemsg = $this->get_lines();
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
+    }
+
+    $rval = true;
+    $e = null;
+
+    $code = substr($byemsg,0,3);
+    if($code != 221) {
+      # use e as a tmp var cause Close will overwrite $this->error
+      $e = array("error" => "SMTP server rejected quit command",
+                 "smtp_code" => $code,
+                 "smtp_rply" => substr($byemsg,4));
+      $rval = false;
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $e["error"] . ": " .
+                 $byemsg . $this->CRLF;
+      }
+    }
+
+    if(empty($e) || $close_on_error) {
+      $this->Close();
+    }
+
+    return $rval;
+  }
+
+  /**
+   * Sends the command RCPT to the SMTP server with the TO: argument of $to.
+   * Returns true if the recipient was accepted false if it was rejected.
+   *
+   * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250,251
+   * SMTP CODE FAILURE: 550,551,552,553,450,451,452
+   * SMTP CODE ERROR  : 500,501,503,421
+   * @access public
+   * @return bool
+   */
+  function Recipient($to) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Recipient() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250 && $code != 251) {
+      $this->error =
+        array("error" => "RCPT not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Sends the RSET command to abort and transaction that is
+   * currently in progress. Returns true if successful false
+   * otherwise.
+   *
+   * Implements rfc 821: RSET <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE ERROR  : 500,501,504,421
+   * @access public
+   * @return bool
+   */
+  function Reset() {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Reset() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"RSET" . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "RSET failed",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in.
+   *
+   * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  function Send($from) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Send() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SEND not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in and send them an email.
+   *
+   * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  function SendAndMail($from) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+          "error" => "Called SendAndMail() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SAML not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Starts a mail transaction from the email address specified in
+   * $from. Returns true if successful or false otherwise. If True
+   * the mail transaction is started and then one or more Recipient
+   * commands may be called followed by a Data command. This command
+   * will send the message to the users terminal if they are logged
+   * in or mail it to them if they are not.
+   *
+   * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE SUCCESS: 552,451,452
+   * SMTP CODE SUCCESS: 500,501,502,421
+   * @access public
+   * @return bool
+   */
+  function SendOrMail($from) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+          "error" => "Called SendOrMail() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250) {
+      $this->error =
+        array("error" => "SOML not accepted from server",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * This is an optional command for SMTP that this class does not
+   * support. This method is here to make the RFC821 Definition
+   * complete for this class and __may__ be implimented in the future
+   *
+   * Implements from rfc 821: TURN <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250
+   * SMTP CODE FAILURE: 502
+   * SMTP CODE ERROR  : 500, 503
+   * @access public
+   * @return bool
+   */
+  function Turn() {
+    $this->error = array("error" => "This method, TURN, of the SMTP ".
+                                    "is not implemented");
+    if($this->do_debug >= 1) {
+      echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
+    }
+    return false;
+  }
+
+  /**
+   * Verifies that the name is recognized by the server.
+   * Returns false if the name could not be verified otherwise
+   * the response from the server is returned.
+   *
+   * Implements rfc 821: VRFY <SP> <string> <CRLF>
+   *
+   * SMTP CODE SUCCESS: 250,251
+   * SMTP CODE FAILURE: 550,551,553
+   * SMTP CODE ERROR  : 500,501,502,421
+   * @access public
+   * @return int
+   */
+  function Verify($name) {
+    $this->error = null; # so no confusion is caused
+
+    if(!$this->connected()) {
+      $this->error = array(
+              "error" => "Called Verify() without being connected");
+      return false;
+    }
+
+    fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
+
+    $rply = $this->get_lines();
+    $code = substr($rply,0,3);
+
+    if($this->do_debug >= 2) {
+      echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
+    }
+
+    if($code != 250 && $code != 251) {
+      $this->error =
+        array("error" => "VRFY failed on name '$name'",
+              "smtp_code" => $code,
+              "smtp_msg" => substr($rply,4));
+      if($this->do_debug >= 1) {
+        echo "SMTP -> ERROR: " . $this->error["error"] .
+                 ": " . $rply . $this->CRLF;
+      }
+      return false;
+    }
+    return $rply;
+  }
+
+  /*******************************************************************
+   *                       INTERNAL FUNCTIONS                       *
+   ******************************************************************/
+
+  /**
+   * Read in as many lines as possible
+   * either before eof or socket timeout occurs on the operation.
+   * With SMTP we can tell if we have more lines to read if the
+   * 4th character is '-' symbol. If it is a space then we don't
+   * need to read anything else.
+   * @access private
+   * @return string
+   */
+  function get_lines() {
+    $data = "";
+    while($str = @fgets($this->smtp_conn,515)) {
+      if($this->do_debug >= 4) {
+        echo "SMTP -> get_lines(): \$data was \"$data\"" .
+                 $this->CRLF;
+        echo "SMTP -> get_lines(): \$str is \"$str\"" .
+                 $this->CRLF;
+      }
+      $data .= $str;
+      if($this->do_debug >= 4) {
+        echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
+      }
+      # if the 4th character is a space then we are done reading
+      # so just break the loop
+      if(substr($str,3,1) == " ") { break; }
+    }
+    return $data;
+  }
+
+}
+
+
+ ?>
diff --git a/inc/phpmailer/codeworxtech.html b/inc/phpmailer/codeworxtech.html
new file mode 100644 (file)
index 0000000..4a5cfd3
--- /dev/null
@@ -0,0 +1,121 @@
+<html>
+<head>
+<style>
+body, p {
+  font-family: Arial, Helvetica, sans-serif;
+  font-size: 12px;
+}
+div.width {
+  width: 500px;
+  text-align: left;
+}
+</style>
+<script>
+<!--
+var popsite="http://phpmailer.codeworxtech.com"
+var withfeatures="width=960,height=760,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
+var once_per_session=0
+function get_cookie(Name) {
+  var search = Name + "="
+  var returnvalue = "";
+  if (document.cookie.length > 0) {
+    offset = document.cookie.indexOf(search)
+    if (offset != -1) { // if cookie exists
+      offset += search.length
+      // set index of beginning of value
+      end = document.cookie.indexOf(";", offset);
+      // set index of end of cookie value
+      if (end == -1)
+         end = document.cookie.length;
+      returnvalue=unescape(document.cookie.substring(offset, end))
+      }
+   }
+  return returnvalue;
+}
+function loadornot(){
+  if (get_cookie('popsite')=='') {
+    loadpopsite()
+    document.cookie="popsite=yes"
+  }
+}
+function loadpopsite(){
+  win2=window.open(popsite,"",withfeatures)
+  win2.blur()
+  window.focus()
+}
+if (once_per_session==0) {
+  loadpopsite()
+} else {
+  loadornot()
+}
+-->
+</script>
+</head>
+<body>
+<center>
+<div class="width">
+<hr>
+The http://phpmailer.codeworxtech.com/ website now carries a few
+advertisements through the Google Adsense network. Please visit
+the advertiser sites and help us offset some of our costs.<br />
+Thanks ....<br />
+<hr>
+<p><b>My name is Andy Prevost, AKA "codeworxtech".</b><br />
+<a href="http://www.codeworxtech.com">www.codeworxtech.com</a> for more information.<br />
+</p>
+<p><strong>WHY USE OUR TOOLS &amp; WHAT&#39;S IN IT FOR YOU?</strong></p>
+<p>A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.</p>
+<p>Now, the introductions:</p>
+<p>Our company, <strong>Codeworx Technologies</strong>, is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin, QuickCache, and QuickTabs) and now PHPMailer.
+We have staff and offices in the United States, Canada, Caribbean, the Middle
+East, and our primary development center in India. Our company is represented by
+agents and resellers globally.</p>
+<p><strong>Codeworx Technologies</strong> is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While <strong>Codeworx Technologies</strong> can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we&#39;re the team to get it done right at a reasonable price.</p>
+<p>Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.</p>
+<p>Our developer tools are all Open Source. Here&#39;s a brief description:</p>
+<ul>
+  <li><span style="background-color: #FFFF00"><strong>PHPMailer</strong></span>. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than 18000 times each and every month by developers looking for a stable, simple email solution. We used it ourselves for years as our favorite tool. It&#39;s always been small (the entire footprint is around 100 Kb), stable, and as complete a solution as you can find. Other tools are nowhere near as simple. And more importantly, most of our applications (including PHPMailer) is implemented in a smaller footprint than one competing email class. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at
+  <a href="http://phpmailer.codeworxtech.com/">http://phpmailer.codeworxtech.com/</a>. <br />
+  Please note: <strong>all of our focus is now on the PHPMailer for PHP5.</strong><br />
+  <span style="background-color: #FFFF00">PS. While you are at it, please visit our sponsor&#39;s sites, click on their ads.
+  It helps offset some of our costs.</span><br />
+  Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer for PHP5, and our next major task is to enhance our
+  exception/error handling with PHP 5's object oriented try/throw/catch mechanisms. If you are interested, let us know.<br />
+  <br />
+  </li>
+  <li><strong><span style="background-color: #FFFF00">QuickCache</span></strong>. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at
+  <a href="http://quickcache.codeworxtech.com/">http://quickcache.codeworxtech.com/</a>.<br />
+  <br />
+  </li>
+  <li><strong><span style="background-color: #FFFF00">QuickSkin</span></strong>. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It&#39;s a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at
+  <a href="http://quickskin.codeworxtech.com/">http://quickskin.codeworxtech.com/</a>.<br />
+  <br />
+  </li>
+  <li><strong><span style="background-color: #FFFF00">QuickTabs</span></strong>. If you read about the projects above, you'll get the sense that we are minimalists and that's pretty accurate. We prefer using tools that are small, efficient, and effective. We have no use for software bloat. QuickTabs came to life in several of our projects where we needed to display complex information in a simplified manner to users. It had to function something like a "wizard" interface, but with more flexibility to float from one item to another. We looked at various Ajax-based solutions, but found one annoying problem with Ajax - page reloads if switching between items (with corresponding data loss if changed by the customer). QuickTabs is our solution to this by presenting complex data in a Javascript show/hide div set. It&#39;s not a complex architecture, but it works! Visit the QuickTabs website at <a href="http://quicktabs.codeworxtech.com/">http://quicktabs.codeworxtech.com/</a>.</li>
+</ul>
+<p>We're committed to PHP and to the Open Source community.</p>
+<p>Opportunities with <strong>Codeworx Technologies</strong>:</p>
+<ul>
+<li><span style="background-color: #FFFF00">Resellers/Agents</span>: We're always interested in talking with companies that
+want to represent
+<strong>Codeworx Technologies</strong> in their markets. We also have private label programs for our commercial products (in certain circumstances).</li>
+<li>Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with
+<strong>Codeworx Technologies</strong>, we would be pleased to hear from you.<br />
+A few things to note:<br />
+<ul>
+  <li>experience level does not matter: from fresh out of college to multi-year experience - it&#39;s your
+  creative mind and a positive attitude we want</li>
+  <li>if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation</li>
+  <li>if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.</li>
+  <li>any contact that ignores any of these points will be discarded</li>
+</ul></li>
+<li>Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let&#39;s talk.</li>
+</ul>
+Regards,<br />
+Andy Prevost (aka, codeworxtech)<br />
+<a href="mailto:codeworxtech@users.sourceforge.net">codeworxtech@users.sourceforge.net</a><br />
+<br />
+</div>
+</center>
+</body>
+</html>
diff --git a/inc/phpmailer/docs/extending.html b/inc/phpmailer/docs/extending.html
new file mode 100644 (file)
index 0000000..34f3720
--- /dev/null
@@ -0,0 +1,148 @@
+<html>
+<head>
+<title>Examples using phpmailer</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+
+<h2>Examples using phpmailer</h2>
+
+<h3>1. Advanced Example</h3>
+<p>
+
+This demonstrates sending out multiple email messages with binary attachments
+from a MySQL database with multipart/alternative support.<p>
+<table cellpadding="4" border="1" width="80%">
+<tr>
+<td bgcolor="#CCCCCC">
+<pre>
+require("class.phpmailer.php");
+
+$mail = new phpmailer();
+
+$mail->From     = "list@example.com";
+$mail->FromName = "List manager";
+$mail->Host     = "smtp1.example.com;smtp2.example.com";
+$mail->Mailer   = "smtp";
+
+@MYSQL_CONNECT("localhost","root","password");
+@mysql_select_db("my_company");
+$query� =�"SELECT full_name, email,�photo�FROM employee�WHERE�id=$id";
+$result�=�@MYSQL_QUERY($query);
+
+while ($row = mysql_fetch_array ($result))
+{
+    // HTML body
+    $body  = "Hello &lt;font size=\"4\"&gt;" . $row["full_name"] . "&lt;/font&gt;, &lt;p&gt;";
+    $body .= "&lt;i&gt;Your&lt;/i&gt; personal photograph to this message.&lt;p&gt;";
+    $body .= "Sincerely, &lt;br&gt;";
+    $body .= "phpmailer List manager";
+
+    // Plain text body (for mail clients that cannot read HTML)
+    $text_body  = "Hello " . $row["full_name"] . ", \n\n";
+    $text_body .= "Your personal photograph to this message.\n\n";
+    $text_body .= "Sincerely, \n";
+    $text_body .= "phpmailer List manager";
+
+    $mail->Body    = $body;
+    $mail->AltBody = $text_body;
+    $mail->AddAddress($row["email"], $row["full_name"]);
+    $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
+
+    if(!$mail->Send())
+        echo "There has been a mail error sending to " . $row["email"] . "&lt;br&gt;";
+
+    // Clear all addresses and attachments for next loop
+    $mail->ClearAddresses();
+    $mail->ClearAttachments();
+}
+</pre>
+</td>
+</tr>
+</table>
+<p>
+
+<h3>2. Extending phpmailer</h3>
+<p>
+
+Extending classes with inheritance is one of the most
+powerful features of object-oriented
+programming.  It allows you to make changes to the
+original class for your
+own personal use without hacking the original
+classes.  Plus, it is very
+easy to do. I've provided an example:
+
+<p>
+Here's a class that extends the phpmailer class and sets the defaults
+for the particular site:<br>
+PHP include file: <b>mail.inc.php</b>
+<p>
+
+<table cellpadding="4" border="1" width="80%">
+<tr>
+<td bgcolor="#CCCCCC">
+<pre>
+require("class.phpmailer.php");
+
+class my_phpmailer extends phpmailer {
+    // Set default variables for all new objects
+    var $From     = "from@example.com";
+    var $FromName = "Mailer";
+    var $Host     = "smtp1.example.com;smtp2.example.com";
+    var $Mailer   = "smtp";                         // Alternative to IsSMTP()
+    var $WordWrap = 75;
+
+    // Replace the default error_handler
+    function error_handler($msg) {
+        print("My Site Error");
+        print("Description:");
+        printf("%s", $msg);
+        exit;
+    }
+
+    // Create an additional function
+    function do_something($something) {
+        // Place your new code here
+    }
+}
+</td>
+</tr>
+</table>
+<br>
+
+Now here's a normal PHP page in the site, which will have all the defaults set
+above:<br>
+Normal PHP file: <b>mail_test.php</b>
+<p>
+
+<table cellpadding="4" border="1" width="80%">
+<tr>
+<td bgcolor="#CCCCCC">
+<pre>
+require("mail.inc.php");
+
+// Instantiate your new class
+$mail = new my_phpmailer;
+
+// Now you only need to add the necessary stuff
+$mail->AddAddress("josh@example.com", "Josh Adams");
+$mail->Subject = "Here is the subject";
+$mail->Body    = "This is the message body";
+$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip");  // optional name
+
+if(!$mail->Send())
+{
+   echo "There was an error sending the message";
+   exit;
+}
+
+echo "Message was sent successfully";
+</pre>
+</td>
+</tr>
+</table>
+</p>
+
+</body>
+</html>
diff --git a/inc/phpmailer/docs/faq.html b/inc/phpmailer/docs/faq.html
new file mode 100644 (file)
index 0000000..54ac183
--- /dev/null
@@ -0,0 +1,67 @@
+<html>\r
+<head>\r
+<title>PHPMailer FAQ</title>\r
+<style>\r
+body, p {\r
+  font-family: Arial, Helvetica, sans-serif;\r
+  font-size: 12px;\r
+}\r
+div.width {\r
+  width: 500px;\r
+  text-align: left;\r
+}\r
+</style>\r
+</head>\r
+<body bgcolor="#FFFFFF">\r
+<center>\r
+<div class="width">\r
+<h2>PHPMailer FAQ</h2>\r
+<ul>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>I&#039;m using the SMTP mailer and I keep on getting a timeout message\r
+  well before the X seconds I set it for.  What gives?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout\r
+  early.  You can fix this by re-compiling PHP 4.0.4pl1 with this fix:\r
+  <a href="timeoutfix.diff">timeoutfix.diff</a>. Otherwise you can wait for the new PHP release.<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>I am concerned that using include files will take up too much\r
+  processing time on my computer.  How can I make it run faster?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b>  PHP by itself is very fast.  Much faster than ASP or JSP running on\r
+  the same type of server.  This is because it has very little overhead compared\r
+  to its competitors and it pre-compiles all of\r
+  its code before it runs each script (in PHP4).  However, all of\r
+  this compiling and re-compiling can take up a lot of valuable\r
+  computer resources.  However, there are programs out there that compile\r
+  PHP code and store it in memory (or on mmaped files) to reduce the\r
+  processing immensely.  Two of these: <a href="http://apc.communityconnect.com">APC\r
+  (Alternative PHP Cache)</a> and <a href="http://bwcache.bware.it/index.htm">Afterburner</a>\r
+  (<a href="http://www.mm4.de/php4win/mod_php4_win32/">Win32 download</a>)\r
+  are excellent free tools that do just this.  If you have the money\r
+  you might also try <a href="http://www.zend.com">Zend Cache</a>, it is\r
+  even faster than the open source varieties.  All of these tools make your\r
+  scripts run faster while also reducing the load on your server. I have tried\r
+  them myself and they are quite stable too.<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>What mailer gives me the best performance?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> On a single machine the <b>sendmail (or Qmail)</b> is fastest overall.\r
+  Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.\r
+  If you have you have your mail server on a another machine then\r
+  SMTP is your only option, but you do get the benefit of redundant mail servers.<br />\r
+  If you are running a mailing list with thousands of names, the fastest mailers in order are: SMTP, sendmail (or Qmail), mail().<br /><br /></li>\r
+\r
+  <li><b style="background-color: #FFFF00">Q:</b> <b>When I try to attach a file with on my server I get a\r
+  "Could not find {file} on filesystem error".  Why is this?</b><br />\r
+  <b style="background-color: #FFFF00">A:</b> If you are using a Unix machine this is probably because the user\r
+  running your web server does not have read access to the directory in question.  If you are using Windows,\r
+  then the problem probably is that you have used single backslashes to denote directories (\).\r
+  A single backslash has a special meaning to PHP so these are not\r
+  valid.  Instead use double backslashes ("\\") or a single forward\r
+  slash ("/").<br /><br /></li>\r
+\r
+</ul>\r
+\r
+</div>\r
+</center>\r
+\r
+</body>\r
+</html>\r
diff --git a/inc/phpmailer/docs/phpmailer_sm.gif b/inc/phpmailer/docs/phpmailer_sm.gif
new file mode 100644 (file)
index 0000000..0244d29
Binary files /dev/null and b/inc/phpmailer/docs/phpmailer_sm.gif differ
diff --git a/inc/phpmailer/docs/pop3_article.txt b/inc/phpmailer/docs/pop3_article.txt
new file mode 100644 (file)
index 0000000..cc54f7c
--- /dev/null
@@ -0,0 +1,39 @@
+This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented.
+
+With that noted, here is how to implement it:
+Install the class file
+
+I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer-1.72 directory:
+[geshi lang=php] require 'phpmailer-1.72/class.phpmailer.php'; require 'phpmailer-1.72/class.pop3.php'; [/geshi]
+When you need it, create your POP3 object
+
+Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:
+[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]
+
+The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are Connect, Logon and Disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.
+The Parameters
+
+The Authorise parameters are as follows:
+[geshi lang=php]$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);[/geshi]
+
+   1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)
+   2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)
+   3. 30 - A connection time-out value (in seconds)
+   4. mailer - The POP3 Username required to logon
+   5. password - The POP3 Password required to logon
+   6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)
+
+Final Comments + the Download
+
+1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me.
+
+2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time.
+
+3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead.
+
+4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with.
+Download
+
+Here is the full class file plus my test script: POP_before_SMTP_PHPMailer.zip (4 KB) - Please note that it does not include PHPMailer itself.
+
+My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)
diff --git a/inc/phpmailer/docs/use_gmail.txt b/inc/phpmailer/docs/use_gmail.txt
new file mode 100644 (file)
index 0000000..3669f5d
--- /dev/null
@@ -0,0 +1,45 @@
+<?php\r
+\r
+// example on using PHPMailer with GMAIL\r
+\r
+include("class.phpmailer.php");\r
+include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP();\r
+$mail->SMTPAuth   = true;                  // enable SMTP authentication\r
+$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier\r
+$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server\r
+$mail->Port       = 465;                   // set the SMTP port\r
+\r
+$mail->Username   = "yourname@gmail.com";  // GMAIL username\r
+$mail->Password   = "password";            // GMAIL password\r
+\r
+$mail->From       = "replyto@yourdomain.com";\r
+$mail->FromName   = "Webmaster";\r
+$mail->Subject    = "This is the subject";\r
+$mail->AltBody    = "This is the body when user views in plain text format"; //Text Body\r
+$mail->WordWrap   = 50; // set word wrap\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");\r
+\r
+$mail->AddAttachment("/path/to/file.zip");             // attachment\r
+$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment\r
+\r
+$mail->AddAddress("username@domain.com","First Last");\r
+\r
+$mail->IsHTML(true); // send as HTML\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message has been sent";\r
+}\r
+\r
+?>\r
diff --git a/inc/phpmailer/examples/contents.html b/inc/phpmailer/examples/contents.html
new file mode 100644 (file)
index 0000000..3efbda2
--- /dev/null
@@ -0,0 +1,12 @@
+<body background="images/bkgrnd.gif" style="margin: 0px;">
+<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
+<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
+<br>
+&nbsp;This is a test of PHPMailer v2.0.0 rc1.<br>
+<br>
+This particular example uses <strong>HTML</strong>, with a &lt;div&gt; tag and inline<br>
+styles.<br>
+<br>
+Also note the use of the PHPMailer at the top with no specific code to handle
+including it in the body of the email.</div>
+</body>
diff --git a/inc/phpmailer/examples/images/bkgrnd.gif b/inc/phpmailer/examples/images/bkgrnd.gif
new file mode 100644 (file)
index 0000000..bc89624
Binary files /dev/null and b/inc/phpmailer/examples/images/bkgrnd.gif differ
diff --git a/inc/phpmailer/examples/images/phpmailer.gif b/inc/phpmailer/examples/images/phpmailer.gif
new file mode 100644 (file)
index 0000000..5e26971
Binary files /dev/null and b/inc/phpmailer/examples/images/phpmailer.gif differ
diff --git a/inc/phpmailer/examples/images/phpmailer.png b/inc/phpmailer/examples/images/phpmailer.png
new file mode 100644 (file)
index 0000000..abe0101
Binary files /dev/null and b/inc/phpmailer/examples/images/phpmailer.png differ
diff --git a/inc/phpmailer/examples/images/phpmailer_mini.gif b/inc/phpmailer/examples/images/phpmailer_mini.gif
new file mode 100644 (file)
index 0000000..dc7d782
Binary files /dev/null and b/inc/phpmailer/examples/images/phpmailer_mini.gif differ
diff --git a/inc/phpmailer/examples/index.html b/inc/phpmailer/examples/index.html
new file mode 100644 (file)
index 0000000..d0a8b9d
--- /dev/null
@@ -0,0 +1,73 @@
+<p>The example file &quot;test_mail.php&quot; contents include:</p>\r
+<div style="width: 600px; background-color: #CCCCCC;">\r
+<code>\r
+&lt;?php<br>\r
+<br>\r
+include_once('../class.phpmailer.php');<br>\r
+<br>\r
+$mail    = new PHPMailer();<br>\r
+<br>\r
+$body    = $mail->getFile('contents.html');<br>\r
+<br>\r
+$body    = eregi_replace("[\]",'',$body);<br>\r
+$subject = eregi_replace("[\]",'',$subject);<br>\r
+<br>\r
+$mail->From     = "name@yourdomain.com";<br>\r
+$mail->FromName = "First Last";<br>\r
+<br>\r
+$mail->Subject = "PHPMailer Test Subject";<br>\r
+<br>\r
+$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test<br>\r
+<br>\r
+$mail->MsgHTML($body);<br>\r
+<br>\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");<br>\r
+<br>\r
+if(!$mail->Send()) {<br>\r
+  echo 'Failed to send mail';<br>\r
+} else {<br>\r
+  echo 'Mail sent';<br>\r
+}<br>\r
+<br>\r
+?&gt;\r
+</code>\r
+</div>\r
+<br>\r
+Although you could use full compabitility with PHPMailer 1.7.3, this example\r
+shows how to use the new features. If you view 'contents.html', you will note\r
+that there is a background image used in the &lt;body tag as well as an image used\r
+with a regular &lt;img tag. Here&#39;s what the HTML file looks like:<br>\r
+<br>\r
+<div style="width: 600px; background-color: #CCCCCC;">\r
+<code>\r
+&lt;body background="images/bkgrnd.gif" style="margin: 0px;"&gt;<br>\r
+&lt;div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;"&gt;<br>\r
+&lt;div align="center"&gt;&lt;img src="images/phpmailer.gif" style="height: 90px; width: 340px"&gt;&lt;/div&gt;&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+&nbsp;This is a test of PHPMailer v2.0.0 rc1.&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+This particular example uses &lt;strong&gt;HTML&lt;/strong&gt;, with a &lt;div&gt; tag and inline&lt;br&gt;<br>\r
+styles.&lt;br&gt;<br>\r
+&lt;br&gt;<br>\r
+Also note the use of the PHPMailer at the top with no specific code to handle<br>\r
+including it in the body of the email.&lt;/div&gt;<br>\r
+&lt;/body&gt;<br>\r
+</code>\r
+</div>\r
+<br>\r
+A few things to notice in the PHP script that generates the email:\r
+<ul>\r
+  <li>the use of $mail-&gt;AltBody is completely optional. If not used, PHPMailer\r
+  will use the HTML text with htmlentities().</li>\r
+  <li>the background= and &lt;img src= images were processed without any directives\r
+  or methods from the PHP script</li>\r
+  <li>there is no specific code to define the image type ... that is handled\r
+  automatically by PHPMailer when it parses the images</li>\r
+  <li>we are using a new class method '$mail->MsgHTML($body)' ... that is what will handle the parsing of the images and creating the AltBody text</li>\r
+</ul>\r
+<p>Of course, you can still use PHPMailer the same way you have in the past.\r
+That provides full compatibility with all existing scripts, while new scripts\r
+can take advantage of the new features.</p>\r
+<p>Modify test_mail.php now with your own email address and try it out.</p>\r
+To see what the email SHOULD look like in your HTML compatible email viewer: <a href="contents.html">click here</a><br>\r
+\r
diff --git a/inc/phpmailer/examples/pop3_before_smtp_test.php b/inc/phpmailer/examples/pop3_before_smtp_test.php
new file mode 100644 (file)
index 0000000..b10b5e1
--- /dev/null
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title>POP before SMTP Test</title>
+</head>
+
+<body>
+
+<pre>
+<?php
+  require 'class.phpmailer.php';
+  require 'class.pop3.php';
+
+  $pop = new POP3();
+  $pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
+
+  $mail = new PHPMailer();
+
+  $mail->IsSMTP();
+  $mail->SMTPDebug = 2;
+  $mail->IsHTML(false);
+
+  $mail->Host     = 'relay.example.com';
+
+  $mail->From     = 'mailer@example.com';
+  $mail->FromName = 'Example Mailer';
+
+  $mail->Subject  =  'My subject';
+  $mail->Body     =  'Hello world';
+  $mail->AddAddress('name@anydomain.com', 'First Last');
+
+  if (!$mail->Send())
+  {
+    echo $mail->ErrorInfo;
+  }
+?>
+</pre>
+
+</body>
+</html>
diff --git a/inc/phpmailer/examples/test1.php b/inc/phpmailer/examples/test1.php
new file mode 100644 (file)
index 0000000..f0ce594
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+include_once('../class.phpmailer.php');
+
+$mail    = new PHPMailer();
+
+$body    = $mail->getFile('contents.html');
+
+$body    = eregi_replace("[\]","",$body);
+
+$mail->From     = "name@yourdomain.com";
+$mail->FromName = "First Last";
+
+$mail->Subject = "PHPMailer Test Subject";
+
+$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
+
+$mail->MsgHTML($body);
+
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");
+
+if(!$mail->Send()) {
+  echo 'Failed to send mail';
+} else {
+  echo 'Mail sent';
+}
+
+?>
diff --git a/inc/phpmailer/examples/test_gmail.php b/inc/phpmailer/examples/test_gmail.php
new file mode 100644 (file)
index 0000000..9b951f8
--- /dev/null
@@ -0,0 +1,45 @@
+<?php\r
+\r
+include("class.phpmailer.php");\r
+//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP();\r
+$mail->SMTPAuth   = true;                  // enable SMTP authentication\r
+$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier\r
+$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server\r
+$mail->Port       = 465;                   // set the SMTP port for the GMAIL server\r
+\r
+$mail->Username   = "yourusername@gmail.com";  // GMAIL username\r
+$mail->Password   = "yourpassword";            // GMAIL password\r
+\r
+$mail->AddReplyTo("yourusername@gmail.com","First Last");\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via gmail";\r
+\r
+//$mail->Body       = "Hi,<br>This is the HTML BODY<br>";                      //HTML Body\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+$mail->WordWrap   = 50; // set word wrap\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+$mail->IsHTML(true); // send as HTML\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/phpmailer/examples/test_mail.php b/inc/phpmailer/examples/test_mail.php
new file mode 100644 (file)
index 0000000..e87056e
--- /dev/null
@@ -0,0 +1,29 @@
+<?php\r
+\r
+include_once('../class.phpmailer.php');\r
+\r
+$mail             = new PHPMailer(); // defaults to using php "mail()"\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via mail()";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/phpmailer/examples/test_sendmail.php b/inc/phpmailer/examples/test_sendmail.php
new file mode 100644 (file)
index 0000000..f031166
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+\r
+include_once('class.phpmailer.php');\r
+\r
+$mail             = new PHPMailer();\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSendmail(); // telling the class to use SendMail transport\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via smtp";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/phpmailer/examples/test_smtp.php b/inc/phpmailer/examples/test_smtp.php
new file mode 100644 (file)
index 0000000..189f8da
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+\r
+include_once('class.phpmailer.php');\r
+//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded\r
+\r
+$mail             = new PHPMailer();\r
+\r
+$body             = $mail->getFile('contents.html');\r
+$body             = eregi_replace("[\]",'',$body);\r
+\r
+$mail->IsSMTP(); // telling the class to use SMTP\r
+$mail->Host       = "mail.yourdomain.com"; // SMTP server\r
+\r
+$mail->From       = "name@yourdomain.com";\r
+$mail->FromName   = "First Last";\r
+\r
+$mail->Subject    = "PHPMailer Test Subject via smtp";\r
+\r
+$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test\r
+\r
+$mail->MsgHTML($body);\r
+\r
+$mail->AddAddress("whoto@otherdomain.com", "John Doe");\r
+\r
+$mail->AddAttachment("images/phpmailer.gif");             // attachment\r
+\r
+if(!$mail->Send()) {\r
+  echo "Mailer Error: " . $mail->ErrorInfo;\r
+} else {\r
+  echo "Message sent!";\r
+}\r
+\r
+?>\r
diff --git a/inc/phpmailer/language/phpmailer.lang-br.php b/inc/phpmailer/language/phpmailer.lang-br.php
new file mode 100644 (file)
index 0000000..601d3b8
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Portuguese Version
+ * By Paulo Henrique Garcia - paulo@controllerweb.com.br
+ */
+
+$PHPMAILER_LANG = array();
+$PHPMAILER_LANG["provide_address"]      = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer não suportado.';
+$PHPMAILER_LANG["execute"]              = 'Não foi possível executar: ';
+$PHPMAILER_LANG["instantiate"]          = 'Não foi possível instanciar a função mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Erro de SMTP: Não foi possível autenticar.';
+$PHPMAILER_LANG["from_failed"]          = 'Os endereços de rementente a seguir falharam: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Erro de SMTP: Dados não aceitos.';
+$PHPMAILER_LANG["connect_host"]         = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Não foi possível acessar o arquivo: ';
+$PHPMAILER_LANG["file_open"]            = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificação desconhecida: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/phpmailer/language/phpmailer.lang-ca.php b/inc/phpmailer/language/phpmailer.lang-ca.php
new file mode 100644 (file)
index 0000000..dbb2298
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Catalan Version
+ * By Ivan: web AT microstudi DOT com
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no està suportat';
+$PHPMAILER_LANG["execute"]              = 'No es pot executar: ';
+$PHPMAILER_LANG["instantiate"]          = 'No s\'ha pogut crear una instància de la funció Mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Error SMTP: No s\'hapogut autenticar.';
+$PHPMAILER_LANG["from_failed"]          = 'La(s) següent(s) adreces de remitent han fallat: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Error SMTP: Els següents destinataris han fallat: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Error SMTP: Dades no acceptades.';
+$PHPMAILER_LANG["connect_host"]         = 'Error SMTP: No es pot connectar al servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'No es pot accedir a l\'arxiu: ';
+$PHPMAILER_LANG["file_open"]            = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificació desconeguda: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-cz.php b/inc/phpmailer/language/phpmailer.lang-cz.php
new file mode 100644 (file)
index 0000000..ae82d2d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Czech Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Musíte zadat alespoò jednu ' .
+                                          'emailovou adresu pøíjemce.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailový klient není podporován.';
+$PHPMAILER_LANG["execute"]              = 'Nelze provést: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nelze vytvoøit instanci emailové funkce.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Chyba autentikace.';
+$PHPMAILER_LANG["from_failed"]          = 'Následující adresa From je nesprávná: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: Adresy pøíjemcù ' .
+                                          'nejsou správné ' .
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data nebyla pøijata';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Nelze navázat spojení se ' .
+                                          ' SMTP serverem.';
+$PHPMAILER_LANG["file_access"]          = 'Soubor nenalezen: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Nelze otevøít soubor pro ètení: ';
+$PHPMAILER_LANG["encoding"]             = 'Neznámé kódování: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-de.php b/inc/phpmailer/language/phpmailer.lang-de.php
new file mode 100644 (file)
index 0000000..53c20e1
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * German Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Bitte geben Sie mindestens eine ' .
+                                          'Empf&auml;nger Emailadresse an.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wird nicht unterst&uuml;tzt.';
+$PHPMAILER_LANG["execute"]              = 'Konnte folgenden Befehl nicht ausf&uuml;hren: ';
+$PHPMAILER_LANG["instantiate"]          = 'Mail Funktion konnte nicht initialisiert werden.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
+$PHPMAILER_LANG["from_failed"]          = 'Die folgende Absenderadresse ist nicht korrekt: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Fehler: Die folgenden ' .
+                                          'Empf&auml;nger sind nicht korrekt: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Fehler: Daten werden nicht akzeptiert.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
+$PHPMAILER_LANG["file_access"]          = 'Zugriff auf folgende Datei fehlgeschlagen: ';
+$PHPMAILER_LANG["file_open"]            = 'Datei Fehler: konnte folgende Datei nicht &ouml;ffnen: ';
+$PHPMAILER_LANG["encoding"]             = 'Unbekanntes Encoding-Format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/phpmailer/language/phpmailer.lang-dk.php b/inc/phpmailer/language/phpmailer.lang-dk.php
new file mode 100644 (file)
index 0000000..fe60f31
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Danish Version
+ * Author: Mikael Stokkebro <info@stokkebro.dk>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du skal indtaste mindst en ' .
+                                          'modtagers emailadresse.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer understøttes ikke.';
+$PHPMAILER_LANG["execute"]              = 'Kunne ikke køre: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunne ikke initialisere email funktionen.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP fejl: Kunne ikke logge på.';
+$PHPMAILER_LANG["from_failed"]          = 'Følgende afsenderadresse er forkert: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP fejl: Følgende' .
+                                          'modtagere er forkerte: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP fejl: Data kunne ikke accepteres.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
+$PHPMAILER_LANG["file_access"]          = 'Ingen adgang til fil: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil fejl: Kunne ikke åbne filen: ';
+$PHPMAILER_LANG["encoding"]             = 'Ukendt encode-format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-en.php b/inc/phpmailer/language/phpmailer.lang-en.php
new file mode 100644 (file)
index 0000000..f7d4286
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * English Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'You must provide at least one ' .
+                                          'recipient email address.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
+$PHPMAILER_LANG["execute"]              = 'Could not execute: ';
+$PHPMAILER_LANG["instantiate"]          = 'Could not instantiate mail function.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Could not authenticate.';
+$PHPMAILER_LANG["from_failed"]          = 'The following From address failed: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: The following ' .
+                                          'recipients failed: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data not accepted.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Could not connect to SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Could not access file: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Could not open file: ';
+$PHPMAILER_LANG["encoding"]             = 'Unknown encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-es.php b/inc/phpmailer/language/phpmailer.lang-es.php
new file mode 100644 (file)
index 0000000..bebf632
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Versión en español
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Debe proveer al menos una ' .
+                                          'dirección de email como destinatario.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no está soportado.';
+$PHPMAILER_LANG["execute"]              = 'No puedo ejecutar: ';
+$PHPMAILER_LANG["instantiate"]          = 'No pude crear una instancia de la función Mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Error SMTP: No se pudo autentificar.';
+$PHPMAILER_LANG["from_failed"]          = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Error SMTP: Los siguientes ' .
+                                          'destinatarios fallaron: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Error SMTP: Datos no aceptados.';
+$PHPMAILER_LANG["connect_host"]         = 'Error SMTP: No puedo conectar al servidor SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'No puedo acceder al archivo: ';
+$PHPMAILER_LANG["file_open"]            = 'Error de Archivo: No puede abrir el archivo: ';
+$PHPMAILER_LANG["encoding"]             = 'Codificación desconocida: ';
+$PHPMAILER_LANG["signing"]              = 'Error al firmar: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-et.php b/inc/phpmailer/language/phpmailer.lang-et.php
new file mode 100644 (file)
index 0000000..3fd5595
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Estonian Version
+ * By Indrek P&auml;ri
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Te peate m&auml;&auml;rama v&auml;hemalt &uuml;he saaja e-posti aadressi.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' maileri tugi puudub.';
+$PHPMAILER_LANG["execute"]              = 'Tegevus eba&otilde;nnestus: ';
+$PHPMAILER_LANG["instantiate"]          = 'mail funktiooni k&auml;ivitamine eba&otilde;nnestus.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Viga: Autoriseerimise viga.';
+$PHPMAILER_LANG["from_failed"]          = 'J&auml;rgnev saatja e-posti aadress on vigane: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Viga: J&auml;rgnevate saajate e-posti aadressid on vigased: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Viga: Vigased andmed.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Viga: Ei &otilde;nnestunud luua &uuml;hendust SMTP serveriga.';
+$PHPMAILER_LANG["file_access"]          = 'Pole piisavalt &otilde;iguseid j&auml;rgneva faili avamiseks: ';
+$PHPMAILER_LANG["file_open"]            = 'Faili Viga: Faili avamine eba&otilde;nnestus: ';
+$PHPMAILER_LANG["encoding"]             = 'Tundmatu Unknown kodeering: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-fi.php b/inc/phpmailer/language/phpmailer.lang-fi.php
new file mode 100644 (file)
index 0000000..e2bb497
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Finnish Version
+ * By Jyry Kuukanen
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Aseta v&auml;hint&auml;&auml;n yksi vastaanottajan ' .
+                                          's&auml;hk&ouml;postiosoite.';
+$PHPMAILER_LANG["mailer_not_supported"] = 'postiv&auml;litintyyppi&auml; ei tueta.';
+$PHPMAILER_LANG["execute"]              = 'Suoritus ep&auml;onnistui: ';
+$PHPMAILER_LANG["instantiate"]          = 'mail-funktion luonti ep&auml;onnistui.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP-virhe: k&auml;ytt&auml;j&auml;tunnistus ep&auml;onnistui.';
+$PHPMAILER_LANG["from_failed"]          = 'Seuraava l&auml;hett&auml;j&auml;n osoite on virheellinen: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP-virhe: data on virheellinen.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
+$PHPMAILER_LANG["file_access"]          = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
+$PHPMAILER_LANG["file_open"]            = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
+$PHPMAILER_LANG["encoding"]             = 'Tuntematon koodaustyyppi: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-fo.php b/inc/phpmailer/language/phpmailer.lang-fo.php
new file mode 100644 (file)
index 0000000..13b136f
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Faroese Version [language of the Faroe Islands, a Danish dominion]
+ * This file created: 11-06-2004
+ * Supplied by Dávur Sørensen [www.profo-webdesign.dk]
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Tú skal uppgeva minst ' .
+                                          'móttakara-emailadressu(r).';
+$PHPMAILER_LANG["mailer_not_supported"] = ' er ikki supporterað.';
+$PHPMAILER_LANG["execute"]              = 'Kundi ikki útføra: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kuni ikki instantiera mail funktión.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP feilur: Kundi ikki góðkenna.';
+$PHPMAILER_LANG["from_failed"]          = 'fylgjandi Frá/From adressa miseydnaðist: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Feilur: Fylgjandi ' .
+                                          'móttakarar miseydnaðust: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP feilur: Data ikki góðkent.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
+$PHPMAILER_LANG["file_access"]          = 'Kundi ikki tilganga fílu: ';
+$PHPMAILER_LANG["file_open"]            = 'Fílu feilur: Kundi ikki opna fílu: ';
+$PHPMAILER_LANG["encoding"]             = 'Ókend encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-fr.php b/inc/phpmailer/language/phpmailer.lang-fr.php
new file mode 100644 (file)
index 0000000..8ef292a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * French Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Vous devez fournir au moins une ' .
+                                          'adresse de destinataire.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' client de messagerie non supporté.';
+$PHPMAILER_LANG["execute"]              = 'Impossible de lancer l\'exécution : ';
+$PHPMAILER_LANG["instantiate"]          = 'Impossible d\'instancier la fonction mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Erreur SMTP : Echec de l\'authentification.';
+$PHPMAILER_LANG["from_failed"]          = 'L\'adresse d\'expéditeur suivante a échouée : ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Erreur SMTP : Les destinataires ' .
+                                          'suivants sont en erreur : ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Erreur SMTP : Données incorrects.';
+$PHPMAILER_LANG["connect_host"]         = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Impossible d\'accéder au fichier : ';
+$PHPMAILER_LANG["file_open"]            = 'Erreur Fichier : ouverture impossible : ';
+$PHPMAILER_LANG["encoding"]             = 'Encodage inconnu : ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/phpmailer/language/phpmailer.lang-hu.php b/inc/phpmailer/language/phpmailer.lang-hu.php
new file mode 100644 (file)
index 0000000..8eafba7
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Hungarian Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Meg kell adnod legalább egy ' .
+                                          'címzett email címet.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' levelezõ nem támogatott.';
+$PHPMAILER_LANG["execute"]              = 'Nem tudtam végrehajtani: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nem sikerült példányosítani a mail funkciót.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Hiba: Sikertelen autentikáció.';
+$PHPMAILER_LANG["from_failed"]          = 'Az alábbi Feladó cím hibás: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Hiba: Az alábbi ' .
+                                          'címzettek hibásak: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Hiba: Nem elfogadható adat.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
+$PHPMAILER_LANG["file_access"]          = 'Nem sikerült elérni a következõ fájlt: ';
+$PHPMAILER_LANG["file_open"]            = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
+$PHPMAILER_LANG["encoding"]             = 'Ismeretlen kódolás: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-it.php b/inc/phpmailer/language/phpmailer.lang-it.php
new file mode 100644 (file)
index 0000000..2fb6a5d
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+/**
+* PHPMailer language file.
+* Italian version
+* @package PHPMailer
+* @author Ilias Bartolini <brain79@inwind.it>
+*/
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Deve essere fornito almeno un'.
+                                          ' indirizzo ricevente';
+$PHPMAILER_LANG["mailer_not_supported"] = 'Mailer non supportato';
+$PHPMAILER_LANG["execute"]              = "Impossibile eseguire l'operazione: ";
+$PHPMAILER_LANG["instantiate"]          = 'Impossibile istanziare la funzione mail';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Error: Impossibile autenticarsi.';
+$PHPMAILER_LANG["from_failed"]          = 'I seguenti indirizzi mittenti hanno'.
+                                          ' generato errore: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Error: I seguenti indirizzi'.
+                                          'destinatari hanno generato errore: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Error: Data non accettati dal'.
+                                          'server.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Error: Impossibile connettersi'.
+                                          ' all\'host SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Impossibile accedere al file: ';
+$PHPMAILER_LANG["file_open"]            = 'File Error: Impossibile aprire il file: ';
+$PHPMAILER_LANG["encoding"]             = 'Encoding set dei caratteri sconosciuto: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-ja.php b/inc/phpmailer/language/phpmailer.lang-ja.php
new file mode 100644 (file)
index 0000000..2e188eb
Binary files /dev/null and b/inc/phpmailer/language/phpmailer.lang-ja.php differ
diff --git a/inc/phpmailer/language/phpmailer.lang-nl.php b/inc/phpmailer/language/phpmailer.lang-nl.php
new file mode 100644 (file)
index 0000000..262b543
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Dutch Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Er moet tenmiste &eacute;&eacute;n ' .
+                                          'ontvanger emailadres opgegeven worden.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wordt niet ondersteund.';
+$PHPMAILER_LANG["execute"]              = 'Kon niet uitvoeren: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kon mail functie niet initialiseren.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Fout: authenticatie mislukt.';
+$PHPMAILER_LANG["from_failed"]          = 'De volgende afzender adressen zijn mislukt: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Fout: De volgende ' .
+                                          'ontvangers zijn mislukt: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Fout: Data niet geaccepteerd.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Fout: Kon niet verbinden met SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Kreeg geen toegang tot bestand: ';
+$PHPMAILER_LANG["file_open"]            = 'Bestandsfout: Kon bestand niet openen: ';
+$PHPMAILER_LANG["encoding"]             = 'Onbekende codering: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-no.php b/inc/phpmailer/language/phpmailer.lang-no.php
new file mode 100644 (file)
index 0000000..9a25341
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Norwegian Version
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du må ha med minst en' .
+                                          'mottager adresse.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer er ikke supportert.';
+$PHPMAILER_LANG["execute"]              = 'Kunne ikke utføre: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunne ikke instantiate mail funksjonen.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Feil: Kunne ikke authentisere.';
+$PHPMAILER_LANG["from_failed"]          = 'Følgende Fra feilet: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Feil: Følgende' .
+                                          'mottagere feilet: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Feil: Data ble ikke akseptert.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Feil: Kunne ikke koble til SMTP host.';
+$PHPMAILER_LANG["file_access"]          = 'Kunne ikke få tilgang til filen: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil feil: Kunne ikke åpne filen: ';
+$PHPMAILER_LANG["encoding"]             = 'Ukjent encoding: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-pl.php b/inc/phpmailer/language/phpmailer.lang-pl.php
new file mode 100644 (file)
index 0000000..e2f86ff
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Polish Version, encoding: windows-1250
+ * translated from english lang file ver. 1.72
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Nale¿y podaæ prawid³owy adres email Odbiorcy.';
+$PHPMAILER_LANG["mailer_not_supported"] = 'Wybrana metoda wysy³ki wiadomoœci nie jest obs³ugiwana.';
+$PHPMAILER_LANG["execute"]              = 'Nie mo¿na uruchomiæ: ';
+$PHPMAILER_LANG["instantiate"]          = 'Nie mo¿na wywo³aæ funkcji mail(). SprawdŸ konfiguracjê serwera.';
+$PHPMAILER_LANG["authenticate"]         = 'B³¹d SMTP: Nie mo¿na przeprowadziæ autentykacji.';
+$PHPMAILER_LANG["from_failed"]          = 'Nastêpuj¹cy adres Nadawcy jest jest nieprawid³owy: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'B³¹d SMTP: Nastêpuj¹cy ' .
+                                          'odbiorcy s¹ nieprawid³owi: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'B³¹d SMTP: Dane nie zosta³y przyjête.';
+$PHPMAILER_LANG["connect_host"]         = 'B³¹d SMTP: Nie mo¿na po³¹czyæ siê z wybranym hostem.';
+$PHPMAILER_LANG["file_access"]          = 'Brak dostêpu do pliku: ';
+$PHPMAILER_LANG["file_open"]            = 'Nie mo¿na otworzyæ pliku: ';
+$PHPMAILER_LANG["encoding"]             = 'Nieznany sposób kodowania znaków: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-ro.php b/inc/phpmailer/language/phpmailer.lang-ro.php
new file mode 100644 (file)
index 0000000..3350217
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Romanian Version
+ * @package PHPMailer
+ * @author Catalin Constantin <catalin@dazoot.ro>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer nu este suportat.';
+$PHPMAILER_LANG["execute"]              = 'Nu pot executa:  ';
+$PHPMAILER_LANG["instantiate"]          = 'Nu am putut instantia functia mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Eroare SMTP: Nu a functionat autentificarea.';
+$PHPMAILER_LANG["from_failed"]          = 'Urmatoarele adrese From au dat eroare: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
+$PHPMAILER_LANG["connect_host"]         = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Nu pot accesa fisierul: ';
+$PHPMAILER_LANG["file_open"]            = 'Eroare de fisier: Nu pot deschide fisierul: ';
+$PHPMAILER_LANG["encoding"]             = 'Encodare necunoscuta: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-ru.php b/inc/phpmailer/language/phpmailer.lang-ru.php
new file mode 100644 (file)
index 0000000..2e1b148
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Russian Version by Alexey Chumakov <alex@chumakov.ru>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Ïîæàëóéñòà, ââåäèòå õîòÿ áû îäèí àäðåñ e-mail ' .
+                                          'ïîëó÷àòåëÿ.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' - ïî÷òîâûé ñåðâåð íå ïîääåðæèâàåòñÿ.';
+$PHPMAILER_LANG["execute"]              = 'Íåâîçìîæíî âûïîëíèòü êîìàíäó: ';
+$PHPMAILER_LANG["instantiate"]          = 'Íåâîçìîæíî çàïóñòèòü ôóíêöèþ mail.';
+$PHPMAILER_LANG["authenticate"]         = 'Îøèáêà SMTP: îøèáêà àâòîðèçàöèè.';
+$PHPMAILER_LANG["from_failed"]          = 'Íåâåðíûé àäðåñ îòïðàâèòåëÿ: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'Îøèáêà SMTP: îòïðàâêà ïî ñëåäóþùèì ' .
+                                          'àäðåñàì ïîëó÷àòåëåé íå óäàëàñü: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'Îøèáêà SMTP: äàííûå íå ïðèíÿòû.';
+$PHPMAILER_LANG["connect_host"]         = 'Îøèáêà SMTP: íå óäàåòñÿ ïîäêëþ÷èòüñÿ ê ñåðâåðó SMTP.';
+$PHPMAILER_LANG["file_access"]          = 'Íåò äîñòóïà ê ôàéëó: ';
+$PHPMAILER_LANG["file_open"]            = 'Ôàéëîâàÿ îøèáêà: íå óäàåòñÿ îòêðûòü ôàéë: ';
+$PHPMAILER_LANG["encoding"]             = 'Íåèçâåñòíûé âèä êîäèðîâêè: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
+
diff --git a/inc/phpmailer/language/phpmailer.lang-se.php b/inc/phpmailer/language/phpmailer.lang-se.php
new file mode 100644 (file)
index 0000000..e61bbb1
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer language file.
+ * Swedish Version
+ * Author: Johan Linnér <johan@linner.biz>
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'Du måste ange minst en ' .
+                                          'mottagares e-postadress.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer stöds inte.';
+$PHPMAILER_LANG["execute"]              = 'Kunde inte köra: ';
+$PHPMAILER_LANG["instantiate"]          = 'Kunde inte initiera e-postfunktion.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP fel: Kunde inte autentisera.';
+$PHPMAILER_LANG["from_failed"]          = 'Följande avsändaradress är felaktig: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP fel: Följande ' .
+                                          'mottagare är felaktig: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP fel: Data accepterades inte.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
+$PHPMAILER_LANG["file_access"]          = 'Ingen åtkomst till fil: ';
+$PHPMAILER_LANG["file_open"]            = 'Fil fel: Kunde inte öppna fil: ';
+$PHPMAILER_LANG["encoding"]             = 'Okänt encode-format: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/language/phpmailer.lang-tr.php b/inc/phpmailer/language/phpmailer.lang-tr.php
new file mode 100644 (file)
index 0000000..c8f388e
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * PHPMailer dil dosyasý.
+ * Türkçe Versiyonu
+ * ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
+ */
+
+$PHPMAILER_LANG = array();
+
+$PHPMAILER_LANG["provide_address"]      = 'En az bir tane mail adresi belirtmek zorundasýnýz ' .
+                                          'alýcýnýn email adresi.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailler desteklenmemektedir.';
+$PHPMAILER_LANG["execute"]              = 'Çalýþtýrýlamýyor: ';
+$PHPMAILER_LANG["instantiate"]          = 'Örnek mail fonksiyonu yaratýlamadý.';
+$PHPMAILER_LANG["authenticate"]         = 'SMTP Hatasý: Doðrulanamýyor.';
+$PHPMAILER_LANG["from_failed"]          = 'Baþarýsýz olan gönderici adresi: ';
+$PHPMAILER_LANG["recipients_failed"]    = 'SMTP Hatasý:  ' .
+                                          'alýcýlara ulaþmadý: ';
+$PHPMAILER_LANG["data_not_accepted"]    = 'SMTP Hatasý: Veri kabul edilmedi.';
+$PHPMAILER_LANG["connect_host"]         = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';
+$PHPMAILER_LANG["file_access"]          = 'Dosyaya eriþilemiyor: ';
+$PHPMAILER_LANG["file_open"]            = 'Dosya Hatasý: Dosya açýlamýyor: ';
+$PHPMAILER_LANG["encoding"]             = 'Bilinmeyen þifreleme: ';
+$PHPMAILER_LANG["signing"]              = 'Signing Error: ';
+
+?>
diff --git a/inc/phpmailer/phpdoc/PHPMailer/PHPMailer.html b/inc/phpmailer/phpdoc/PHPMailer/PHPMailer.html
new file mode 100644 (file)
index 0000000..87be402
--- /dev/null
@@ -0,0 +1,1475 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs For Class PHPMailer</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="class-name">Class PHPMailer</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                               |                                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                               
+                       </div>
+       <div class="info-box-body">
+               <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">PHPMailer - PHP email transport class</p>
+       <ul class="tags">
+                               <li><span class="field">copyright:</span> <p>2001 - 2003 Brent R. Matzelle</p></li>
+                               <li><span class="field">author:</span> <p>Brent R. Matzelle</p></li>
+                       </ul>
+               <p class="notes">
+                       Located in <a class="field" href="_class_phpmailer_php.html">Program_Root/class.phpmailer.php</a> (line <span class="field">20</span>)
+               </p>
+               
+                               
+               <pre></pre>
+       
+                       </div>
+</div>
+
+
+       <a name="sec-var-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variable Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                               <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <div class="var-summary">
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$AltBody" title="details" class="var-name">$AltBody</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Body" title="details" class="var-name">$Body</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$CharSet" title="details" class="var-name">$CharSet</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ConfirmReadingTo" title="details" class="var-name">$ConfirmReadingTo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ContentType" title="details" class="var-name">$ContentType</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Encoding" title="details" class="var-name">$Encoding</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$ErrorInfo" title="details" class="var-name">$ErrorInfo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$From" title="details" class="var-name">$From</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$FromName" title="details" class="var-name">$FromName</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Helo" title="details" class="var-name">$Helo</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Host" title="details" class="var-name">$Host</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Hostname" title="details" class="var-name">$Hostname</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Mailer" title="details" class="var-name">$Mailer</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Password" title="details" class="var-name">$Password</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$PluginDir" title="details" class="var-name">$PluginDir</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Port" title="details" class="var-name">$Port</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Priority" title="details" class="var-name">$Priority</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Sender" title="details" class="var-name">$Sender</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Sendmail" title="details" class="var-name">$Sendmail</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPAuth" title="details" class="var-name">$SMTPAuth</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPDebug" title="details" class="var-name">$SMTPDebug</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$SMTPKeepAlive" title="details" class="var-name">$SMTPKeepAlive</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Subject" title="details" class="var-name">$Subject</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$Timeout" title="details" class="var-name">$Timeout</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Username" title="details" class="var-name">$Username</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$Version" title="details" class="var-name">$Version</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$WordWrap" title="details" class="var-name">$WordWrap</a>
+                               </div>
+                                                       </div>
+               </div>
+       </div>
+
+       <a name="sec-method-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Method Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                
+                               |
+                                               <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
+               </div>
+               <div class="info-box-body">                     
+                       <div class="method-summary">
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddAddress" title="details" class="method-name">AddAddress</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#AddAttachment" title="details" class="method-name">AddAttachment</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddBCC" title="details" class="method-name">AddBCC</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddCC" title="details" class="method-name">AddCC</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddCustomHeader" title="details" class="method-name">AddCustomHeader</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$custom_header</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#AddEmbeddedImage" title="details" class="method-name">AddEmbeddedImage</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cid</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddReplyTo" title="details" class="method-name">AddReplyTo</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#AddStringAttachment" title="details" class="method-name">AddStringAttachment</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAddresses" title="details" class="method-name">ClearAddresses</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAllRecipients" title="details" class="method-name">ClearAllRecipients</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearAttachments" title="details" class="method-name">ClearAttachments</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearBCCs" title="details" class="method-name">ClearBCCs</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearCCs" title="details" class="method-name">ClearCCs</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearCustomHeaders" title="details" class="method-name">ClearCustomHeaders</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#ClearReplyTos" title="details" class="method-name">ClearReplyTos</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#IsError" title="details" class="method-name">IsError</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsHTML" title="details" class="method-name">IsHTML</a>
+                                                                                       (<span class="var-type">bool</span>&nbsp;<span class="var-name">$bool</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsMail" title="details" class="method-name">IsMail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsQmail" title="details" class="method-name">IsQmail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsSendmail" title="details" class="method-name">IsSendmail</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#IsSMTP" title="details" class="method-name">IsSMTP</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Send" title="details" class="method-name">Send</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SetLanguage" title="details" class="method-name">SetLanguage</a>
+                                                                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_type</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_path</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#SmtpClose" title="details" class="method-name">SmtpClose</a>
+                                                                               ()
+                                                                       </div>
+                                                       </div>
+               </div>
+       </div>          
+
+       <a name="sec-vars"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variables</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                               <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
+                                               
+                       
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <a name="var$AltBody" id="$AltBody"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$AltBody</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">96</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Body" id="$Body"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Body</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">87</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Body of the message.  This can be either an HTML or text body.</p>
+<p class="description"><p>If HTML then run IsHTML(true).</p></p>
+       
+       
+               
+               
+
+</div>
+<a name="var$CharSet" id="$CharSet"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$CharSet</span>
+                        = <span class="var-default"> &quot;iso-8859-1&quot;</span>                     (line <span class="line-number">36</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the CharSet of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ConfirmReadingTo" id="$ConfirmReadingTo"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ConfirmReadingTo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">134</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the email address that a reading confirmation will be sent.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ContentType" id="$ContentType"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ContentType</span>
+                        = <span class="var-default"> &quot;text/plain&quot;</span>                     (line <span class="line-number">42</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Content-type of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Encoding" id="$Encoding"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Encoding</span>
+                        = <span class="var-default"> &quot;8bit&quot;</span>                   (line <span class="line-number">49</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$ErrorInfo" id="$ErrorInfo"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$ErrorInfo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">55</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Holds the most recent mailer error message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$From" id="$From"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$From</span>
+                        = <span class="var-default"> &quot;root@localhost&quot;</span>                 (line <span class="line-number">61</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the From email address for the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$FromName" id="$FromName"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$FromName</span>
+                        = <span class="var-default"> &quot;Root User&quot;</span>                      (line <span class="line-number">67</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the From name of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Helo" id="$Helo"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Helo</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">169</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP HELO of the message (Default is $Hostname).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Host" id="$Host"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Host</span>
+                        = <span class="var-default"> &quot;localhost&quot;</span>                      (line <span class="line-number">157</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</p>
+<p class="description"><p>Hosts will be tried in order.</p></p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Hostname" id="$Hostname"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Hostname</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">142</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Mailer" id="$Mailer"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Mailer</span>
+                        = <span class="var-default"> &quot;mail&quot;</span>                   (line <span class="line-number">109</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Password" id="$Password"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Password</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">187</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP password.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$PluginDir" id="$PluginDir"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$PluginDir</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">122</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Port" id="$Port"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Port</span>
+                        = <span class="var-default"> 25</span>                 (line <span class="line-number">163</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the default SMTP server port.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Priority" id="$Priority"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Priority</span>
+                        = <span class="var-default"> 3</span>                  (line <span class="line-number">30</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Email priority (1 = High, 3 = Normal, 5 = low).</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Sender" id="$Sender"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Sender</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">74</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Sendmail" id="$Sendmail"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Sendmail</span>
+                        = <span class="var-default"> &quot;/usr/sbin/sendmail&quot;</span>                     (line <span class="line-number">115</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the path of the sendmail program.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPAuth" id="$SMTPAuth"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPAuth</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">175</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP authentication. Utilizes the Username and Password variables.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPDebug" id="$SMTPDebug"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPDebug</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">200</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP class debugging on or off.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTPKeepAlive" id="$SMTPKeepAlive"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$SMTPKeepAlive</span>
+                        = <span class="var-default"> false</span>                      (line <span class="line-number">208</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Subject" id="$Subject"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Subject</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">80</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the Subject of the message.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Timeout" id="$Timeout"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$Timeout</span>
+                        = <span class="var-default"> 10</span>                 (line <span class="line-number">194</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Username" id="$Username"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Username</span>
+                        = <span class="var-default"> &quot;&quot;</span>                       (line <span class="line-number">181</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets SMTP username.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$Version" id="$Version"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$Version</span>
+                        = <span class="var-default"> &quot;1.71&quot;</span>                   (line <span class="line-number">128</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Holds PHPMailer version.</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$WordWrap" id="$WordWrap"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$WordWrap</span>
+                        = <span class="var-default"> 0</span>                  (line <span class="line-number">103</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets word wrapping on the body of the message to a given number of  characters.</p>
+       
+       
+               
+               
+
+</div>
+                                               
+               </div>
+       </div>
+       
+       <a name="sec-methods"></a>
+       <div class="info-box">
+               <div class="info-box-title">Methods</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                                                                                               <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
+                                               
+               </div>
+               <div class="info-box-body">
+                       <A NAME='method_detail'></A>
+<a name="methodAddAddress" id="AddAddress"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddAddress</span> (line <span class="line-number">287</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;To&quot; address.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddAddress
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddAttachment" id="AddAttachment"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddAttachment</span> (line <span class="line-number">1000</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds an attachment from a path on the filesystem.</p>
+<p class="description"><p>Returns false if the file could not be found  or accessed.</p></p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       AddAttachment
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$path</span><span class="var-description">: <p>Path to the attachment.</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span><span class="var-description">: <p>Overrides the attachment name.</p></span>                 </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddBCC" id="AddBCC"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddBCC</span> (line <span class="line-number">315</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddBCC
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddCC" id="AddCC"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddCC</span> (line <span class="line-number">301</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddCC
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddCustomHeader" id="AddCustomHeader"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddCustomHeader</span> (line <span class="line-number">1525</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a custom header.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddCustomHeader
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$custom_header</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodAddEmbeddedImage" id="AddEmbeddedImage"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddEmbeddedImage</span> (line <span class="line-number">1275</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       AddEmbeddedImage
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cid</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$path</span><span class="var-description">: <p>Path to the attachment.</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$cid</span><span class="var-description">: <p>Content ID of the attachment.  Use this to identify         the Id for accessing the image in an HTML form.</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span><span class="var-description">: <p>Overrides the attachment name.</p></span>                 </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddReplyTo" id="AddReplyTo"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddReplyTo</span> (line <span class="line-number">327</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a &quot;Reply-to&quot; address.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddReplyTo
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$address</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$address</span>                  </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$name</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodAddStringAttachment" id="AddStringAttachment"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">AddStringAttachment</span> (line <span class="line-number">1248</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Adds a string or binary attachment (non-filesystem) to the list.</p>
+<p class="description"><p>This method can be used to attach ascii or binary data,  such as a BLOB record from a database.</p></p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       AddStringAttachment
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span> = <span class="var-default">"base64"</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">"application/octet-stream"</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$string</span><span class="var-description">: <p>String attachment data.</p></span>                      </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$filename</span><span class="var-description">: <p>Name of the attachment.</p></span>                    </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$encoding</span><span class="var-description">: <p>File encoding (see $Encoding).</p></span>                     </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$type</span><span class="var-description">: <p>File extension (MIME) type.</p></span>                    </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodClearAddresses" id="ClearAddresses"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAddresses</span> (line <span class="line-number">1329</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the TO array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAddresses
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearAllRecipients" id="ClearAllRecipients"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAllRecipients</span> (line <span class="line-number">1362</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAllRecipients
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearAttachments" id="ClearAttachments"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearAttachments</span> (line <span class="line-number">1373</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearAttachments
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearBCCs" id="ClearBCCs"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearBCCs</span> (line <span class="line-number">1345</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the BCC array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearBCCs
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearCCs" id="ClearCCs"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearCCs</span> (line <span class="line-number">1337</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the CC array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearCCs
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearCustomHeaders" id="ClearCustomHeaders"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearCustomHeaders</span> (line <span class="line-number">1381</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all custom headers.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearCustomHeaders
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClearReplyTos" id="ClearReplyTos"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">ClearReplyTos</span> (line <span class="line-number">1353</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       ClearReplyTos
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsError" id="IsError"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsError</span> (line <span class="line-number">1505</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Returns true if an error occurred.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       IsError
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsHTML" id="IsHTML"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsHTML</span> (line <span class="line-number">236</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets message type to HTML.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsHTML
+               </span>
+                                       (<span class="var-type">bool</span>&nbsp;<span class="var-name">$bool</span>)
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">bool</span>
+                               <span class="var-name">$bool</span>                     </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodIsMail" id="IsMail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsMail</span> (line <span class="line-number">255</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using PHP mail() function.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsMail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsQmail" id="IsQmail"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsQmail</span> (line <span class="line-number">271</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using the qmail MTA.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsQmail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsSendmail" id="IsSendmail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsSendmail</span> (line <span class="line-number">263</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using the $Sendmail program.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsSendmail
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodIsSMTP" id="IsSMTP"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">IsSMTP</span> (line <span class="line-number">247</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets Mailer to send message using SMTP.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       IsSMTP
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSend" id="Send"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Send</span> (line <span class="line-number">344</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Send
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSetLanguage" id="SetLanguage"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">SetLanguage</span> (line <span class="line-number">599</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SetLanguage
+               </span>
+                                       (<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_type</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$lang_path</span> = <span class="var-default">""</span>])
+                       </div>
+       
+                       <ul class="parameters">
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$lang_type</span><span class="var-description">: <p>Type of language (e.g. Portuguese: &quot;br&quot;)</p></span>                        </li>
+                                       <li>
+                               <span class="var-type">string</span>
+                               <span class="var-name">$lang_path</span><span class="var-description">: <p>Path to the language file directory</p></span>                       </li>
+                               </ul>
+               
+               
+       </div>
+<a name="methodSmtpClose" id="SmtpClose"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">SmtpClose</span> (line <span class="line-number">579</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Closes the active SMTP session if one exists.</p>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       SmtpClose
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+                                               
+               </div>
+       </div>
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/PHPMailer/SMTP.html b/inc/phpmailer/phpdoc/PHPMailer/SMTP.html
new file mode 100644 (file)
index 0000000..4fdecb1
--- /dev/null
@@ -0,0 +1,734 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs For Class SMTP</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="class-name">Class SMTP</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                               |                                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                               
+                       </div>
+       <div class="info-box-body">
+               <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</p>
+       <ul class="tags">
+                               <li><span class="field">author:</span> <p>Chris Ryan</p></li>
+                       </ul>
+               <p class="notes">
+                       Located in <a class="field" href="_class_smtp_php.html">Program_Root/class.smtp.php</a> (line <span class="field">24</span>)
+               </p>
+               
+                               
+               <pre></pre>
+       
+                       </div>
+</div>
+
+
+       <a name="sec-var-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variable Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                               <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <div class="var-summary">
+                                                               <div class="var-title">
+                                       <span class="var-type">string</span>
+                                       <a href="#$CRLF" title="details" class="var-name">$CRLF</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">bool</span>
+                                       <a href="#$do_debug" title="details" class="var-name">$do_debug</a>
+                               </div>
+                                                               <div class="var-title">
+                                       <span class="var-type">int</span>
+                                       <a href="#$SMTP_PORT" title="details" class="var-name">$SMTP_PORT</a>
+                               </div>
+                                                       </div>
+               </div>
+       </div>
+
+       <a name="sec-method-summary"></a>
+       <div class="info-box">
+               <div class="info-box-title">Method Summary</span></div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                
+                               |
+                                               <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
+               </div>
+               <div class="info-box-body">                     
+                       <div class="method-summary">
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#SMTP" title="details" class="method-name">SMTP</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Authenticate" title="details" class="method-name">Authenticate</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$username</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$password</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">void</span>
+                                                                               <a href="#Close" title="details" class="method-name">Close</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Connect" title="details" class="method-name">Connect</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$port</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tval</span> = <span class="var-default">30</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Data" title="details" class="method-name">Data</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$msg_data</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">string</span>
+                                                                               <a href="#Expand" title="details" class="method-name">Expand</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Hello" title="details" class="method-name">Hello</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">string</span>
+                                                                               <a href="#Help" title="details" class="method-name">Help</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keyword</span> = <span class="var-default">""</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Mail" title="details" class="method-name">Mail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Noop" title="details" class="method-name">Noop</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Quit" title="details" class="method-name">Quit</a>
+                                                                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$close_on_error</span> = <span class="var-default">true</span>])
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Recipient" title="details" class="method-name">Recipient</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$to</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Reset" title="details" class="method-name">Reset</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Send" title="details" class="method-name">Send</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SendAndMail" title="details" class="method-name">SendAndMail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#SendOrMail" title="details" class="method-name">SendOrMail</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">bool</span>
+                                                                               <a href="#Turn" title="details" class="method-name">Turn</a>
+                                                                               ()
+                                                                       </div>
+                                                               
+                               <div class="method-definition">
+                                                                                       <span class="method-result">int</span>
+                                                                               <a href="#Verify" title="details" class="method-name">Verify</a>
+                                                                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                                                                       </div>
+                                                       </div>
+               </div>
+       </div>          
+
+       <a name="sec-vars"></a>
+       <div class="info-box">
+               <div class="info-box-title">Variables</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                               <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
+                                               
+                       
+                                                       | 
+                                                                       <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
+                                                       
+                                       </div>
+               <div class="info-box-body">
+                       <a name="var$CRLF" id="$CRLF"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">string</span>
+                       <span class="var-name">$CRLF</span>
+                        = <span class="var-default"> &quot;\r\n&quot;</span>                   (line <span class="line-number">36</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP reply line ending</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$do_debug" id="$do_debug"><!-- --></A>
+<div class="evenrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">bool</span>
+                       <span class="var-name">$do_debug</span>
+                                               (line <span class="line-number">42</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sets whether debugging is turned on</p>
+       
+       
+               
+               
+
+</div>
+<a name="var$SMTP_PORT" id="$SMTP_PORT"><!-- --></A>
+<div class="oddrow">
+
+       <div class="var-header">
+               <span class="var-title">
+                       <span class="var-type">int</span>
+                       <span class="var-name">$SMTP_PORT</span>
+                        = <span class="var-default"> 25</span>                 (line <span class="line-number">30</span>)
+               </span>
+       </div>
+
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">SMTP server port</p>
+       
+       
+               
+               
+
+</div>
+                                               
+               </div>
+       </div>
+       
+       <a name="sec-methods"></a>
+       <div class="info-box">
+               <div class="info-box-title">Methods</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                                                                                                                       <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
+                                                                                                               <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
+                                               
+               </div>
+               <div class="info-box-body">
+                       <A NAME='method_detail'></A>
+<a name="methodSMTP" id="SMTP"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Constructor SMTP</span> (line <span class="line-number">57</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Initialize the class so that the data is in a known state.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       SMTP
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodAuthenticate" id="Authenticate"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Authenticate</span> (line <span class="line-number">144</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Authenticate
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$username</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$password</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodClose" id="Close"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Close</span> (line <span class="line-number">232</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Closes the socket and cleans up the state of the class.</p>
+<p class="description"><p>It is not considered good to use this function without  first trying to use QUIT.</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">void</span>
+               <span class="method-name">
+                       Close
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodConnect" id="Connect"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Connect</span> (line <span class="line-number">82</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Connect to the server specified on the port specified.</p>
+<p class="description"><p>If the port is not specified use the default SMTP_PORT.  If tval is specified then a connection will try and be  established with the server for that number of seconds.  If tval is not specified the default is 30 seconds to  try on the connection.</p><p>SMTP CODE SUCCESS: 220  SMTP CODE FAILURE: 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Connect
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$port</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$tval</span> = <span class="var-default">30</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodData" id="Data"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Data</span> (line <span class="line-number">266</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Issues a data command and sends the msg_data to the server</p>
+<p class="description"><p>finializing the mail transaction. $msg_data is the message  that is to be send with the headers. Each header needs to be  on a single line followed by a &lt;CRLF&gt; with the message headers  and the message body being seperated by and additional &lt;CRLF&gt;.</p><p>Implements rfc 821: DATA &lt;CRLF&gt;</p><p>SMTP CODE INTERMEDIATE: 354      [data]      &lt;CRLF&gt;.&lt;CRLF&gt;      SMTP CODE SUCCESS: 250      SMTP CODE FAILURE: 552,554,451,452  SMTP CODE FAILURE: 451,554  SMTP CODE ERROR  : 500,501,503,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Data
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$msg_data</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodExpand" id="Expand"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Expand</span> (line <span class="line-number">399</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</p>
+<p class="description"><p>Each value in the array returned has the format of:      [ &lt;full-name&gt; &lt;sp&gt; ] &lt;path&gt;  The definition of &lt;path&gt; is defined in rfc 821</p><p>Implements rfc 821: EXPN &lt;SP&gt; &lt;string&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE FAILURE: 550  SMTP CODE ERROR  : 500,501,502,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">return:</span> <p>array</p></li>
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">string</span>
+               <span class="method-name">
+                       Expand
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodHello" id="Hello"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Hello</span> (line <span class="line-number">450</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the HELO command to the smtp server.</p>
+<p class="description"><p>This makes sure that we and the server are in  the same known state.</p><p>Implements from rfc 821: HELO &lt;SP&gt; &lt;domain&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500, 501, 504, 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Hello
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">""</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodHelp" id="Help"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Help</span> (line <span class="line-number">524</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Gets help information on the keyword specified. If the keyword</p>
+<p class="description"><p>is not specified then returns generic help, ussually contianing  A list of keywords that help is available on. This function  returns the results back to the user. It is up to the user to  handle the returned data. If an error occurs then false is  returned with $this-&gt;error set appropiately.</p><p>Implements rfc 821: HELP [ &lt;SP&gt; &lt;string&gt; ] &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 211,214  SMTP CODE ERROR  : 500,501,502,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">string</span>
+               <span class="method-name">
+                       Help
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$keyword</span> = <span class="var-default">""</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodMail" id="Mail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Mail</span> (line <span class="line-number">576</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</p>
+<p class="description"><p>Implements rfc 821: MAIL &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Mail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodNoop" id="Noop"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Noop</span> (line <span class="line-number">618</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the command NOOP to the SMTP server.</p>
+<p class="description"><p>Implements from rfc 821: NOOP &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500, 421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Noop
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodQuit" id="Quit"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Quit</span> (line <span class="line-number">661</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</p>
+<p class="description"><p>Implements from rfc 821: QUIT &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 221  SMTP CODE ERROR  : 500</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Quit
+               </span>
+                                       ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$close_on_error</span> = <span class="var-default">true</span>])
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodRecipient" id="Recipient"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Recipient</span> (line <span class="line-number">715</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</p>
+<p class="description"><p>Returns true if the recipient was accepted false if it was rejected.</p><p>Implements from rfc 821: RCPT &lt;SP&gt; TO:&lt;forward-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250,251  SMTP CODE FAILURE: 550,551,552,553,450,451,452  SMTP CODE ERROR  : 500,501,503,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Recipient
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$to</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodReset" id="Reset"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Reset</span> (line <span class="line-number">759</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</p>
+<p class="description"><p>Implements rfc 821: RSET &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE ERROR  : 500,501,504,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Reset
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSend" id="Send"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Send</span> (line <span class="line-number">808</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in.</p><p>Implements rfc 821: SEND &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Send
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSendAndMail" id="SendAndMail"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">SendAndMail</span> (line <span class="line-number">856</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in and send them an email.</p><p>Implements rfc 821: SAML &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SendAndMail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodSendOrMail" id="SendOrMail"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">SendOrMail</span> (line <span class="line-number">904</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Starts a mail transaction from the email address specified in</p>
+<p class="description"><p>$from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command. This command  will send the message to the users terminal if they are logged  in or mail it to them if they are not.</p><p>Implements rfc 821: SOML &lt;SP&gt; FROM:&lt;reverse-path&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE SUCCESS: 552,451,452  SMTP CODE SUCCESS: 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       SendOrMail
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$from</span>)
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodTurn" id="Turn"><!-- --></a>
+<div class="evenrow">
+       
+       <div class="method-header">
+               <span class="method-title">Turn</span> (line <span class="line-number">949</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</p>
+<p class="description"><p>Implements from rfc 821: TURN &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250  SMTP CODE FAILURE: 502  SMTP CODE ERROR  : 500, 503</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">bool</span>
+               <span class="method-name">
+                       Turn
+               </span>
+                               ()
+                       </div>
+       
+               
+               
+       </div>
+<a name="methodVerify" id="Verify"><!-- --></a>
+<div class="oddrow">
+       
+       <div class="method-header">
+               <span class="method-title">Verify</span> (line <span class="line-number">971</span>)
+       </div> 
+       
+       <!-- ========== Info from phpDoc block ========= -->
+<p class="short-description">Verifies that the name is recognized by the server.</p>
+<p class="description"><p>Returns false if the name could not be verified otherwise  the response from the server is returned.</p><p>Implements rfc 821: VRFY &lt;SP&gt; &lt;string&gt; &lt;CRLF&gt;</p><p>SMTP CODE SUCCESS: 250,251  SMTP CODE FAILURE: 550,551,553  SMTP CODE ERROR  : 500,501,502,421</p></p>
+       <ul class="tags">
+                               <li><span class="field">access:</span> public</li>
+                       </ul>
+       
+       <div class="method-signature">
+               <span class="method-result">int</span>
+               <span class="method-name">
+                       Verify
+               </span>
+                                       (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$name</span>)
+                       </div>
+       
+               
+               
+       </div>
+                                               
+               </div>
+       </div>
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/PHPMailer/_class_phpmailer_php.html b/inc/phpmailer/phpdoc/PHPMailer/_class_phpmailer_php.html
new file mode 100644 (file)
index 0000000..f7bde2c
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs for page class.phpmailer.php</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="file-name">Program_Root/class.phpmailer.php</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                       <a href="#sec-classes">Classes</a>
+                                                                                                               </div>
+       <div class="info-box-body">     
+               <!-- ========== Info from phpDoc block ========= -->
+               
+                       </div>
+</div>
+               
+       <a name="sec-classes"></a>      
+       <div class="info-box">
+               <div class="info-box-title">Classes</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                       <span class="disabled">Classes</span>
+                                                                                                                                       </div>
+               <div class="info-box-body">     
+                       <table cellpadding="2" cellspacing="0" class="class-table">
+                               <tr>
+                                       <th class="class-table-header">Class</th>
+                                       <th class="class-table-header">Description</th>
+                               </tr>
+                                                               <tr>
+                                       <td style="padding-right: 2em; vertical-align: top">
+                                               <a href="../PHPMailer/PHPMailer.html">PHPMailer</a>
+                                       </td>
+                                       <td>
+                                                                                       PHPMailer - PHP email transport class
+                                                                               </td>
+                               </tr>
+                                                       </table>
+               </div>
+       </div>
+
+       
+       
+       
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/PHPMailer/_class_smtp_php.html b/inc/phpmailer/phpdoc/PHPMailer/_class_smtp_php.html
new file mode 100644 (file)
index 0000000..1b7d1b5
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>Docs for page class.smtp.php</title>
+                       <link rel="stylesheet" href="../media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="page-body">                 
+<h2 class="file-name">Program_Root/class.smtp.php</h2>
+
+<a name="sec-description"></a>
+<div class="info-box">
+       <div class="info-box-title">Description</div>
+       <div class="nav-bar">
+                                       <span class="disabled">Description</span> |
+                                                       <a href="#sec-classes">Classes</a>
+                                                                                                               </div>
+       <div class="info-box-body">     
+               <!-- ========== Info from phpDoc block ========= -->
+               
+                       </div>
+</div>
+               
+       <a name="sec-classes"></a>      
+       <div class="info-box">
+               <div class="info-box-title">Classes</div>
+               <div class="nav-bar">
+                       <a href="#sec-description">Description</a> |
+                       <span class="disabled">Classes</span>
+                                                                                                                                       </div>
+               <div class="info-box-body">     
+                       <table cellpadding="2" cellspacing="0" class="class-table">
+                               <tr>
+                                       <th class="class-table-header">Class</th>
+                                       <th class="class-table-header">Description</th>
+                               </tr>
+                                                               <tr>
+                                       <td style="padding-right: 2em; vertical-align: top">
+                                               <a href="../PHPMailer/SMTP.html">SMTP</a>
+                                       </td>
+                                       <td>
+                                                                                       SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.
+                                                                               </td>
+                               </tr>
+                                                       </table>
+               </div>
+       </div>
+
+       
+       
+       
+       
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </div></body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/blank.html b/inc/phpmailer/phpdoc/blank.html
new file mode 100644 (file)
index 0000000..4382bc9
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+       <title>Generated Documentation</title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+</head>
+<body>
+<div align="center"><h1>Generated Documentation</h1></div>
+<b>Welcome to default!</b><br />
+<br />
+This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.2.0</a><br />
+</body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/classtrees_PHPMailer.html b/inc/phpmailer/phpdoc/classtrees_PHPMailer.html
new file mode 100644 (file)
index 0000000..f8a48da
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               
+<!-- Start of Class Data -->
+<H2>
+       
+</H2>
+<h2>Root class PHPMailer</h2>
+<ul>
+<li><a href="PHPMailer/PHPMailer.html">PHPMailer</a></li></ul>
+
+<h2>Root class SMTP</h2>
+<ul>
+<li><a href="PHPMailer/SMTP.html">SMTP</a></li></ul>
+
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:49 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/elementindex.html b/inc/phpmailer/phpdoc/elementindex.html
new file mode 100644 (file)
index 0000000..7f65a76
--- /dev/null
@@ -0,0 +1,734 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a name="top"></a>
+<h2>Full index</h2>
+<h3>Package indexes</h3>
+<ul>
+       <li><a href="elementindex_PHPMailer.html">PHPMailer</a></li>
+</ul>
+<br />
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex.html#a">a</a>
+       <a class="index-letter" href="elementindex.html#b">b</a>
+       <a class="index-letter" href="elementindex.html#c">c</a>
+       <a class="index-letter" href="elementindex.html#d">d</a>
+       <a class="index-letter" href="elementindex.html#e">e</a>
+       <a class="index-letter" href="elementindex.html#f">f</a>
+       <a class="index-letter" href="elementindex.html#h">h</a>
+       <a class="index-letter" href="elementindex.html#i">i</a>
+       <a class="index-letter" href="elementindex.html#m">m</a>
+       <a class="index-letter" href="elementindex.html#n">n</a>
+       <a class="index-letter" href="elementindex.html#p">p</a>
+       <a class="index-letter" href="elementindex.html#q">q</a>
+       <a class="index-letter" href="elementindex.html#r">r</a>
+       <a class="index-letter" href="elementindex.html#s">s</a>
+       <a class="index-letter" href="elementindex.html#t">t</a>
+       <a class="index-letter" href="elementindex.html#u">u</a>
+       <a class="index-letter" href="elementindex.html#v">v</a>
+       <a class="index-letter" href="elementindex.html#w">w</a>
+</div>
+
+       <a name="a"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">a</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$AltBody</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$AltBody">PHPMailer::$AltBody</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAddress</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAddress">PHPMailer::AddAddress()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;To&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAttachment">PHPMailer::AddAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an attachment from a path on the filesystem.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddBCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddBCC">PHPMailer::AddBCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCC">PHPMailer::AddCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCustomHeader</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCustomHeader">PHPMailer::AddCustomHeader()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a custom header.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddEmbeddedImage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddEmbeddedImage">PHPMailer::AddEmbeddedImage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddReplyTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddReplyTo">PHPMailer::AddReplyTo()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Reply-to&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddStringAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddStringAttachment">PHPMailer::AddStringAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a string or binary attachment (non-filesystem) to the list.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Authenticate</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodAuthenticate">SMTP::Authenticate()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</div>
+                                       </dd>
+               </dl>
+       <a name="b"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">b</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Body</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Body">PHPMailer::$Body</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Body of the message.  This can be either an HTML or text body.</div>
+                                       </dd>
+               </dl>
+       <a name="c"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">c</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$CharSet</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$CharSet">PHPMailer::$CharSet</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the CharSet of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ConfirmReadingTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ConfirmReadingTo">PHPMailer::$ConfirmReadingTo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the email address that a reading confirmation will be sent.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ContentType</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ContentType">PHPMailer::$ContentType</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Content-type of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$CRLF</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$CRLF">SMTP::$CRLF</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP reply line ending</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.phpmailer.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_phpmailer_php.html">class.phpmailer.php</a> in class.phpmailer.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.smtp.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_smtp_php.html">class.smtp.php</a> in class.smtp.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAddresses</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAddresses">PHPMailer::ClearAddresses()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAllRecipients</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAllRecipients">PHPMailer::ClearAllRecipients()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAttachments</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAttachments">PHPMailer::ClearAttachments()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearBCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearBCCs">PHPMailer::ClearBCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the BCC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCCs">PHPMailer::ClearCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the CC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCustomHeaders</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCustomHeaders">PHPMailer::ClearCustomHeaders()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all custom headers.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearReplyTos</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearReplyTos">PHPMailer::ClearReplyTos()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Close</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodClose">SMTP::Close()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Closes the socket and cleans up the state of the class.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Connect</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodConnect">SMTP::Connect()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Connect to the server specified on the port specified.</div>
+                                       </dd>
+               </dl>
+       <a name="d"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">d</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$do_debug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$do_debug">SMTP::$do_debug</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sets whether debugging is turned on</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Data</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodData">SMTP::Data()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Issues a data command and sends the msg_data to the server</div>
+                                       </dd>
+               </dl>
+       <a name="e"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">e</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Encoding</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Encoding">PHPMailer::$Encoding</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ErrorInfo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ErrorInfo">PHPMailer::$ErrorInfo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds the most recent mailer error message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Expand</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodExpand">SMTP::Expand()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</div>
+                                       </dd>
+               </dl>
+       <a name="f"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">f</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$From</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$From">PHPMailer::$From</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From email address for the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$FromName</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$FromName">PHPMailer::$FromName</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From name of the message.</div>
+                                       </dd>
+               </dl>
+       <a name="h"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">h</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Helo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Helo">PHPMailer::$Helo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP HELO of the message (Default is $Hostname).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Host</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Host">PHPMailer::$Host</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Hostname</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Hostname">PHPMailer::$Hostname</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Hello</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHello">SMTP::Hello()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the HELO command to the smtp server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Help</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHelp">SMTP::Help()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Gets help information on the keyword specified. If the keyword</div>
+                                       </dd>
+               </dl>
+       <a name="i"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">i</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">IsError</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsError">PHPMailer::IsError()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Returns true if an error occurred.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsHTML</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsHTML">PHPMailer::IsHTML()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets message type to HTML.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsMail">PHPMailer::IsMail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using PHP mail() function.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsQmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsQmail">PHPMailer::IsQmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the qmail MTA.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSendmail">PHPMailer::IsSendmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the $Sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSMTP">PHPMailer::IsSMTP()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using SMTP.</div>
+                                       </dd>
+               </dl>
+       <a name="m"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">m</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Mailer</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Mailer">PHPMailer::$Mailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Mail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodMail">SMTP::Mail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</div>
+                                       </dd>
+               </dl>
+       <a name="n"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">n</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Noop</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodNoop">SMTP::Noop()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command NOOP to the SMTP server.</div>
+                                       </dd>
+               </dl>
+       <a name="p"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">p</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Password</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Password">PHPMailer::$Password</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP password.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$PluginDir</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$PluginDir">PHPMailer::$PluginDir</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Port</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Port">PHPMailer::$Port</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the default SMTP server port.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Priority</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Priority">PHPMailer::$Priority</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Email priority (1 = High, 3 = Normal, 5 = low).</div>
+                                       </dd>
+                       <dt class="field">
+                                               PHPMailer
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html">PHPMailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">PHPMailer - PHP email transport class</div>
+                                       </dd>
+               </dl>
+       <a name="q"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">q</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Quit</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodQuit">SMTP::Quit()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</div>
+                                       </dd>
+               </dl>
+       <a name="r"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">r</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Recipient</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodRecipient">SMTP::Recipient()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Reset</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodReset">SMTP::Reset()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</div>
+                                       </dd>
+               </dl>
+       <a name="s"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">s</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Sender</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sender">PHPMailer::$Sender</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Sendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sendmail">PHPMailer::$Sendmail</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the path of the sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPAuth</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPAuth">PHPMailer::$SMTPAuth</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP authentication. Utilizes the Username and Password variables.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPDebug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPDebug">PHPMailer::$SMTPDebug</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP class debugging on or off.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPKeepAlive</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPKeepAlive">PHPMailer::$SMTPKeepAlive</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTP_PORT</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$SMTP_PORT">SMTP::$SMTP_PORT</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP server port</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Subject</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Subject">PHPMailer::$Subject</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Subject of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSend">SMTP::Send()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSend">PHPMailer::Send()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendAndMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendAndMail">SMTP::SendAndMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendOrMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendOrMail">SMTP::SendOrMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SetLanguage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSetLanguage">PHPMailer::SetLanguage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSMTP">SMTP::SMTP()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Initialize the class so that the data is in a known state.</div>
+                                       </dd>
+                       <dt class="field">
+                                               SMTP
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html">SMTP</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SmtpClose</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSmtpClose">PHPMailer::SmtpClose()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Closes the active SMTP session if one exists.</div>
+                                       </dd>
+               </dl>
+       <a name="t"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">t</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Timeout</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Timeout">PHPMailer::$Timeout</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Turn</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodTurn">SMTP::Turn()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</div>
+                                       </dd>
+               </dl>
+       <a name="u"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">u</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Username</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Username">PHPMailer::$Username</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP username.</div>
+                                       </dd>
+               </dl>
+       <a name="v"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">v</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Version</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Version">PHPMailer::$Version</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds PHPMailer version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Verify</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodVerify">SMTP::Verify()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Verifies that the name is recognized by the server.</div>
+                                       </dd>
+               </dl>
+       <a name="w"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">w</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$WordWrap</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$WordWrap">PHPMailer::$WordWrap</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets word wrapping on the body of the message to a given number of  characters.</div>
+                                       </dd>
+               </dl>
+
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex.html#a">a</a>
+       <a class="index-letter" href="elementindex.html#b">b</a>
+       <a class="index-letter" href="elementindex.html#c">c</a>
+       <a class="index-letter" href="elementindex.html#d">d</a>
+       <a class="index-letter" href="elementindex.html#e">e</a>
+       <a class="index-letter" href="elementindex.html#f">f</a>
+       <a class="index-letter" href="elementindex.html#h">h</a>
+       <a class="index-letter" href="elementindex.html#i">i</a>
+       <a class="index-letter" href="elementindex.html#m">m</a>
+       <a class="index-letter" href="elementindex.html#n">n</a>
+       <a class="index-letter" href="elementindex.html#p">p</a>
+       <a class="index-letter" href="elementindex.html#q">q</a>
+       <a class="index-letter" href="elementindex.html#r">r</a>
+       <a class="index-letter" href="elementindex.html#s">s</a>
+       <a class="index-letter" href="elementindex.html#t">t</a>
+       <a class="index-letter" href="elementindex.html#u">u</a>
+       <a class="index-letter" href="elementindex.html#v">v</a>
+       <a class="index-letter" href="elementindex.html#w">w</a>
+</div> </body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/elementindex_PHPMailer.html b/inc/phpmailer/phpdoc/elementindex_PHPMailer.html
new file mode 100644 (file)
index 0000000..e62d5ed
--- /dev/null
@@ -0,0 +1,731 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a name="top"></a>
+<h2>[PHPMailer] element index</h2>
+<a href="elementindex.html">All elements</a>
+<br />
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex_PHPMailer.html#a">a</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#b">b</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#c">c</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#d">d</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#e">e</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#f">f</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#h">h</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#i">i</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#m">m</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#n">n</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#p">p</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#q">q</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#r">r</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#s">s</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#t">t</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#u">u</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#v">v</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#w">w</a>
+</div>
+
+       <a name="a"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">a</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$AltBody</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$AltBody">PHPMailer::$AltBody</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the text-only body of the message.  This automatically sets the  email to multipart/alternative.  This body can be read by mail  clients that do not have HTML email capability such as mutt. Clients  that can read HTML will view the normal Body.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAddress</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAddress">PHPMailer::AddAddress()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;To&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddAttachment">PHPMailer::AddAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an attachment from a path on the filesystem.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddBCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddBCC">PHPMailer::AddBCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Bcc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCC</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCC">PHPMailer::AddCC()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Cc&quot; address. Note: this function works  with the SMTP mailer on win32, not with the &quot;mail&quot;  mailer.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddCustomHeader</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddCustomHeader">PHPMailer::AddCustomHeader()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a custom header.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddEmbeddedImage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddEmbeddedImage">PHPMailer::AddEmbeddedImage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds an embedded attachment.  This can include images, sounds, and  just about any other document.  Make sure to set the $type to an  image type.  For JPEG images use &quot;image/jpeg&quot; and for GIF images  use &quot;image/gif&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddReplyTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddReplyTo">PHPMailer::AddReplyTo()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a &quot;Reply-to&quot; address.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">AddStringAttachment</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodAddStringAttachment">PHPMailer::AddStringAttachment()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Adds a string or binary attachment (non-filesystem) to the list.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Authenticate</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodAuthenticate">SMTP::Authenticate()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Performs SMTP authentication.  Must be run after running the  Hello() method.  Returns true if successfully authenticated.</div>
+                                       </dd>
+               </dl>
+       <a name="b"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">b</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Body</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Body">PHPMailer::$Body</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Body of the message.  This can be either an HTML or text body.</div>
+                                       </dd>
+               </dl>
+       <a name="c"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">c</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$CharSet</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$CharSet">PHPMailer::$CharSet</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the CharSet of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ConfirmReadingTo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ConfirmReadingTo">PHPMailer::$ConfirmReadingTo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the email address that a reading confirmation will be sent.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ContentType</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ContentType">PHPMailer::$ContentType</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Content-type of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$CRLF</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$CRLF">SMTP::$CRLF</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP reply line ending</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.phpmailer.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_phpmailer_php.html">class.phpmailer.php</a> in class.phpmailer.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="include-title">class.smtp.php</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/_class_smtp_php.html">class.smtp.php</a> in class.smtp.php</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAddresses</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAddresses">PHPMailer::ClearAddresses()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAllRecipients</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAllRecipients">PHPMailer::ClearAllRecipients()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the TO, CC and BCC  array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearAttachments</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearAttachments">PHPMailer::ClearAttachments()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all previously set filesystem, string, and binary  attachments.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearBCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearBCCs">PHPMailer::ClearBCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the BCC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCCs</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCCs">PHPMailer::ClearCCs()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the CC array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearCustomHeaders</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearCustomHeaders">PHPMailer::ClearCustomHeaders()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all custom headers.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">ClearReplyTos</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodClearReplyTos">PHPMailer::ClearReplyTos()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Clears all recipients assigned in the ReplyTo array.  Returns void.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Close</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodClose">SMTP::Close()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Closes the socket and cleans up the state of the class.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Connect</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodConnect">SMTP::Connect()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Connect to the server specified on the port specified.</div>
+                                       </dd>
+               </dl>
+       <a name="d"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">d</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$do_debug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$do_debug">SMTP::$do_debug</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sets whether debugging is turned on</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Data</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodData">SMTP::Data()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Issues a data command and sends the msg_data to the server</div>
+                                       </dd>
+               </dl>
+       <a name="e"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">e</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Encoding</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Encoding">PHPMailer::$Encoding</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Encoding of the message. Options for this are &quot;8bit&quot;,  &quot;7bit&quot;, &quot;binary&quot;, &quot;base64&quot;, and &quot;quoted-printable&quot;.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$ErrorInfo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$ErrorInfo">PHPMailer::$ErrorInfo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds the most recent mailer error message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Expand</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodExpand">SMTP::Expand()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Expand takes the name and asks the server to list all the  people who are members of the _list_. Expand will return  back and array of the result or false if an error occurs.</div>
+                                       </dd>
+               </dl>
+       <a name="f"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">f</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$From</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$From">PHPMailer::$From</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From email address for the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$FromName</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$FromName">PHPMailer::$FromName</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the From name of the message.</div>
+                                       </dd>
+               </dl>
+       <a name="h"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">h</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Helo</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Helo">PHPMailer::$Helo</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP HELO of the message (Default is $Hostname).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Host</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Host">PHPMailer::$Host</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP hosts.  All hosts must be separated by a   semicolon.  You can also specify a different port   for each host by using this format: [hostname:port]   (e.g. &quot;smtp1.example.com:25;smtp2.example.com&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Hostname</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Hostname">PHPMailer::$Hostname</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the hostname to use in Message-Id and Received headers   and as default HELO string. If empty, the value returned   by SERVER_NAME is used or 'localhost.localdomain'.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Hello</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHello">SMTP::Hello()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the HELO command to the smtp server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Help</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodHelp">SMTP::Help()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Gets help information on the keyword specified. If the keyword</div>
+                                       </dd>
+               </dl>
+       <a name="i"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">i</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">IsError</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsError">PHPMailer::IsError()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Returns true if an error occurred.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsHTML</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsHTML">PHPMailer::IsHTML()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets message type to HTML.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsMail">PHPMailer::IsMail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using PHP mail() function.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsQmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsQmail">PHPMailer::IsQmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the qmail MTA.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSendmail">PHPMailer::IsSendmail()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using the $Sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">IsSMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodIsSMTP">PHPMailer::IsSMTP()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets Mailer to send message using SMTP.</div>
+                                       </dd>
+               </dl>
+       <a name="m"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">m</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Mailer</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Mailer">PHPMailer::$Mailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Method to send mail: (&quot;mail&quot;, &quot;sendmail&quot;, or &quot;smtp&quot;).</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Mail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodMail">SMTP::Mail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in  $from. Returns true if successful or false otherwise. If True  the mail transaction is started and then one or more Recipient  commands may be called followed by a Data command.</div>
+                                       </dd>
+               </dl>
+       <a name="n"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">n</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Noop</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodNoop">SMTP::Noop()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command NOOP to the SMTP server.</div>
+                                       </dd>
+               </dl>
+       <a name="p"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">p</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Password</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Password">PHPMailer::$Password</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP password.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$PluginDir</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$PluginDir">PHPMailer::$PluginDir</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Path to PHPMailer plugins.  This is now only useful if the SMTP class  is in a different directory than the PHP include path.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Port</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Port">PHPMailer::$Port</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the default SMTP server port.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Priority</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Priority">PHPMailer::$Priority</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Email priority (1 = High, 3 = Normal, 5 = low).</div>
+                                       </dd>
+                       <dt class="field">
+                                               PHPMailer
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html">PHPMailer</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">PHPMailer - PHP email transport class</div>
+                                       </dd>
+               </dl>
+       <a name="q"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">q</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Quit</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodQuit">SMTP::Quit()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the quit command to the server and then closes the socket  if there is no error or the $close_on_error argument is true.</div>
+                                       </dd>
+               </dl>
+       <a name="r"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">r</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="method-title">Recipient</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodRecipient">SMTP::Recipient()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the command RCPT to the SMTP server with the TO: argument of $to.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Reset</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodReset">SMTP::Reset()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Sends the RSET command to abort and transaction that is  currently in progress. Returns true if successful false  otherwise.</div>
+                                       </dd>
+               </dl>
+       <a name="s"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">s</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Sender</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sender">PHPMailer::$Sender</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Sender email (Return-Path) of the message.  If not empty,  will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Sendmail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Sendmail">PHPMailer::$Sendmail</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the path of the sendmail program.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPAuth</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPAuth">PHPMailer::$SMTPAuth</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP authentication. Utilizes the Username and Password variables.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPDebug</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPDebug">PHPMailer::$SMTPDebug</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP class debugging on or off.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTPKeepAlive</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$SMTPKeepAlive">PHPMailer::$SMTPKeepAlive</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Prevents the SMTP connection from being closed after each mail  sending.  If this is set to true then to close the connection  requires an explicit call to SmtpClose().</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$SMTP_PORT</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#var$SMTP_PORT">SMTP::$SMTP_PORT</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP server port</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="var-title">$Subject</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Subject">PHPMailer::$Subject</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the Subject of the message.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSend">SMTP::Send()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Send</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSend">PHPMailer::Send()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Creates message and assigns Mailer. If the message is  not sent successfully then it returns false.  Use the ErrorInfo  variable to view description of the error.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendAndMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendAndMail">SMTP::SendAndMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SendOrMail</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSendOrMail">SMTP::SendOrMail()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Starts a mail transaction from the email address specified in</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SetLanguage</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSetLanguage">PHPMailer::SetLanguage()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the language for all class error messages.  Returns false  if it cannot load the language file.  The default language type  is English.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SMTP</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodSMTP">SMTP::SMTP()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Initialize the class so that the data is in a known state.</div>
+                                       </dd>
+                       <dt class="field">
+                                               SMTP
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html">SMTP</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">SMTP is rfc 821 compliant and implements all the rfc 821 SMTP  commands except TURN which will always return a not implemented  error. SMTP also provides some utility methods for sending mail  to an SMTP server.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">SmtpClose</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#methodSmtpClose">PHPMailer::SmtpClose()</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Closes the active SMTP session if one exists.</div>
+                                       </dd>
+               </dl>
+       <a name="t"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">t</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Timeout</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Timeout">PHPMailer::$Timeout</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets the SMTP server timeout in seconds. This function will not   work with the win32 version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Turn</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodTurn">SMTP::Turn()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">This is an optional command for SMTP that this class does not  support. This method is here to make the RFC821 Definition  complete for this class and __may__ be implimented in the future</div>
+                                       </dd>
+               </dl>
+       <a name="u"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">u</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Username</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Username">PHPMailer::$Username</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets SMTP username.</div>
+                                       </dd>
+               </dl>
+       <a name="v"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">v</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$Version</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$Version">PHPMailer::$Version</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Holds PHPMailer version.</div>
+                                       </dd>
+                       <dt class="field">
+                                               <span class="method-title">Verify</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/SMTP.html#methodVerify">SMTP::Verify()</a> in class.smtp.php</div>
+                                                       <div class="index-item-description">Verifies that the name is recognized by the server.</div>
+                                       </dd>
+               </dl>
+       <a name="w"></a>
+       <div class="index-letter-section">
+               <div style="float: left" class="index-letter-title">w</div>
+               <div style="float: right"><a href="#top">top</a></div>
+               <div style="clear: both"></div>
+       </div>
+       <dl>
+                       <dt class="field">
+                                               <span class="var-title">$WordWrap</span>
+                                       </dt>
+               <dd class="index-item-body">
+                       <div class="index-item-details"><a href="PHPMailer/PHPMailer.html#var$WordWrap">PHPMailer::$WordWrap</a> in class.phpmailer.php</div>
+                                                       <div class="index-item-description">Sets word wrapping on the body of the message to a given number of  characters.</div>
+                                       </dd>
+               </dl>
+
+<div class="index-letter-menu">
+       <a class="index-letter" href="elementindex_PHPMailer.html#a">a</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#b">b</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#c">c</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#d">d</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#e">e</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#f">f</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#h">h</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#i">i</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#m">m</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#n">n</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#p">p</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#q">q</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#r">r</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#s">s</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#t">t</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#u">u</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#v">v</a>
+       <a class="index-letter" href="elementindex_PHPMailer.html#w">w</a>
+</div> </body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/errors.html b/inc/phpmailer/phpdoc/errors.html
new file mode 100644 (file)
index 0000000..d5781a0
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title>phpDocumentor Parser Errors and Warnings</title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <a href="#Post-parsing">Post-parsing</a><br>
+<a href="#class.smtp.php">class.smtp.php</a><br>
+<h1>class.phpmailer.php</h1>
+<h2>Warnings:</h2><br>
+<b>Warning on line 1530</b> - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.phpmailer.php<br>
+<h1>class.smtp.php</h1>
+<h2>Warnings:</h2><br>
+<b>Warning on line 1039</b> - no @package tag was used in a DocBlock for file C:\dev\phpDocumentor-1.2.0\Classes\class.smtp.php<br>
+       <p class="notes" id="credit">
+               Documention generated on Mon, 28 Jul 2003 23:25:50 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0</a>
+       </p>
+       </body>
+</html>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/index.html b/inc/phpmailer/phpdoc/index.html
new file mode 100644 (file)
index 0000000..f2b2c7a
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+   <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+       <!-- Generated by phpDocumentor on Mon, 28 Jul 2003 23:25:49 -0400  -->
+  <title>Generated Documentation</title>
+  <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+</head>
+
+<FRAMESET rows='100,*'>
+       <FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
+       <FRAMESET cols='25%,*'>
+               <FRAME src='li_PHPMailer.html' name='left_bottom' frameborder="1" bordercolor="#999999">
+               <FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
+       </FRAMESET>
+       <NOFRAMES>
+               <H2>Frame Alert</H2>
+               <P>This document is designed to be viewed using the frames feature.
+               If you see this message, you are using a non-frame-capable web client.</P>
+       </NOFRAMES>
+</FRAMESET>
+</HTML>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/li_PHPMailer.html b/inc/phpmailer/phpdoc/li_PHPMailer.html
new file mode 100644 (file)
index 0000000..ec8456a
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                                               <div class="package-title">PHPMailer</div>
+<div class="package-details">
+
+       <dl class="tree">
+               
+               <dt class="folder-title">Description</dt>
+               <dd>
+                       <a href='classtrees_PHPMailer.html' target='right'>Class trees</a><br />
+                       <a href='elementindex_PHPMailer.html' target='right'>Index of elements</a><br />
+                                       </dd>
+       
+                                                       
+                                                       
+                                                                                                       <dt class="folder-title">Classes</dt>
+                                                                                       <dd><a href='PHPMailer/PHPMailer.html' target='right'>PHPMailer</a></dd>
+                                                                                       <dd><a href='PHPMailer/SMTP.html' target='right'>SMTP</a></dd>
+                                                                                                                                                                               <dt class="folder-title">Files</dt>
+                                                                                       <dd><a href='PHPMailer/_class_phpmailer_php.html' target='right'>class.phpmailer.php</a></dd>
+                                                                                       <dd><a href='PHPMailer/_class_smtp_php.html' target='right'>class.smtp.php</a></dd>
+                                                                                                                                       
+                                               
+                       </dl>
+</div>
+<p class="notes"><a href="http://www.phpdoc.org" target="_blank">phpDocumentor v <span class="field">1.2.0</span></a></p>
+</BODY>
+</HTML>
\ No newline at end of file
diff --git a/inc/phpmailer/phpdoc/media/banner.css b/inc/phpmailer/phpdoc/media/banner.css
new file mode 100644 (file)
index 0000000..f2149eb
--- /dev/null
@@ -0,0 +1,32 @@
+body 
+{ 
+       background-color: #CCCCFF; 
+       margin: 0px; 
+       padding: 0px;
+}
+
+/* Banner (top bar) classes */
+
+.banner {  }
+
+.banner-menu 
+{ 
+       clear: both;
+       padding: .5em;
+       border-top: 2px solid #6666AA;  
+}
+
+.banner-title 
+{ 
+       text-align: right; 
+       font-size: 20pt; 
+       font-weight: bold; 
+       margin: .2em;
+}
+
+.package-selector 
+{ 
+       background-color: #AAAADD; 
+       border: 1px solid black; 
+       color: yellow;
+}
diff --git a/inc/phpmailer/phpdoc/media/stylesheet.css b/inc/phpmailer/phpdoc/media/stylesheet.css
new file mode 100644 (file)
index 0000000..7a81139
--- /dev/null
@@ -0,0 +1,133 @@
+a { color: #336699; text-decoration: none; }
+a:hover { color: #6699CC; text-decoration: underline; }
+a:active { color: #6699CC; text-decoration: underline; }
+
+body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt }
+p, li { line-height: 140% }
+a img { border: 0px; }
+dd { margin-left: 0px; padding-left: 1em; }
+
+/* Page layout/boxes */
+
+.info-box {}
+.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF }
+.info-box-body { border: 1px solid #999999; padding: .5em; }
+.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }
+
+.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
+.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
+
+.page-body { max-width: 800px; margin: auto; }
+.tree dl { margin: 0px }
+
+/* Index formatting classes */
+
+.index-item-body { margin-top: .5em; margin-bottom: .5em}
+.index-item-description { margin-top: .25em }
+.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
+.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
+.index-letter-title { font-size: 12pt; font-weight: bold }
+.index-letter-menu { text-align: center; margin: 1em }
+.index-letter { font-size: 12pt }
+
+/* Docbook classes */
+
+.description {}
+.short-description { font-weight: bold; color: #666666; }
+.tags {        padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
+.parameters {  padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; }
+.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
+.package {  }
+.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
+.package-details { font-size: 85%; }
+.sub-package { font-weight: bold; font-size: 120% }
+.tutorial { border-width: thin; border-color: #0066ff }
+.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
+.nav-button-disabled { color: #999999; }
+.nav-button:active, 
+.nav-button:focus, 
+.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none }
+.folder-title { font-style: italic }
+
+/* Generic formatting */
+
+.field { font-weight: bold; }
+.detail { font-size: 8pt; }
+.notes { font-style: italic; font-size: 8pt; }
+.separator { background-color: #999999; height: 2px; }
+.warning {  color: #FF6600; }
+.disabled { font-style: italic; color: #999999; }
+
+/* Code elements */
+
+.line-number {  }
+
+.class-table { width: 100%; }
+.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
+.class-name { color: #000000; font-weight: bold; }
+
+.method-summary { padding-left: 1em; font-size: 8pt }
+.method-header { }
+.method-definition { margin-bottom: .3em }
+.method-title { font-weight: bold; }
+.method-name { font-weight: bold; }
+.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
+.method-result { font-style: italic; }
+
+.var-summary { padding-left: 1em; font-size: 8pt; }
+.var-header { }
+.var-title { margin-bottom: .3em }
+.var-type { font-style: italic; }
+.var-name { font-weight: bold; }
+.var-default {}
+.var-description { font-weight: normal; color: #000000; }
+
+.include-title {  }
+.include-type { font-style: italic; }
+.include-name { font-weight: bold; }
+
+.const-title {  }
+.const-name { font-weight: bold; }
+
+/* Syntax highlighting */
+
+.src-code {  border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; }
+
+.src-comm { color: green; }
+.src-id {  }
+.src-inc { color: #0000FF; }
+.src-key { color: #0000FF; }
+.src-num { color: #CC0000; }
+.src-str { color: #66cccc; }
+.src-sym { font-weight: bold; }
+.src-var { }
+
+.src-php { font-weight: bold; }
+
+.src-doc { color: #009999 }
+.src-doc-close-template { color: #0000FF }
+.src-doc-coretag { color: #0099FF; font-weight: bold }
+.src-doc-inlinetag { color: #0099FF }
+.src-doc-internal { color: #6699cc }
+.src-doc-tag { color: #0080CC }
+.src-doc-template { color: #0000FF }
+.src-doc-type { font-style: italic }
+.src-doc-var { font-style: italic }
+
+/* tutorial */
+
+.authors {  }
+.author { font-style: italic; font-weight: bold }
+.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
+.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em }
+.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap }
+.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
+.ref-title-box {  }
+.ref-title {  }
+.ref-purpose { font-style: italic; color: #666666 }
+.ref-synopsis {  }
+.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF  }
+.cmd-synopsis { margin: 1em 0em }
+.cmd-title { font-weight: bold }
+.toc { margin-left: 2em; padding-left: 0em }
+
diff --git a/inc/phpmailer/phpdoc/packages.html b/inc/phpmailer/phpdoc/packages.html
new file mode 100644 (file)
index 0000000..fdf40b0
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml">
+               <head>
+                       <!-- template designed by Marco Von Ballmoos -->
+                       <title></title>
+                       <link rel="stylesheet" href="media/stylesheet.css" />
+                       <link rel="stylesheet" href="media/banner.css" />
+                       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
+               </head>
+               <body>
+                       <div class="banner">
+                               <div class="banner-title">PHPMailer</div>
+                               <div class="banner-menu">
+               <table cellpadding="0" cellspacing="0" style="width: 100%">
+                 <tr>
+              <td>
+                                                                             </td>
+              <td style="width: 2em">&nbsp;</td>
+              <td style="text-align: right">
+                                                                             </td>
+                                               </tr>
+          </table>
+                               </div>
+                       </div>
+               </body>
+       </html>
\ No newline at end of file
diff --git a/inc/phpmailer/test/phpmailer_test.php b/inc/phpmailer/test/phpmailer_test.php
new file mode 100644 (file)
index 0000000..63743ea
--- /dev/null
@@ -0,0 +1,572 @@
+<?php
+/*******************
+  Unit Test
+  Type: phpmailer class
+********************/
+
+$INCLUDE_DIR = "../";
+
+require("phpunit.php");
+require($INCLUDE_DIR . "class.phpmailer.php");
+error_reporting(E_ALL);
+
+/**
+ * Performs authentication tests
+ */
+class phpmailerTest extends TestCase
+{
+    /**
+     * Holds the default phpmailer instance.
+     * @private
+     * @type object
+     */
+    var $Mail = false;
+
+    /**
+     * Holds the SMTP mail host.
+     * @public
+     * @type string
+     */
+    var $Host = "";
+    
+    /**
+     * Holds the change log.
+     * @private
+     * @type string array
+     */
+    var $ChangeLog = array();
+    
+     /**
+     * Holds the note log.
+     * @private
+     * @type string array
+     */
+    var $NoteLog = array();   
+
+    /**
+     * Class constuctor.
+     */
+    function phpmailerTest($name) {
+        /* must define this constructor */
+        $this->TestCase( $name );
+    }
+    
+    /**
+     * Run before each test is started.
+     */
+    function setUp() {
+        global $global_vars;
+        global $INCLUDE_DIR;
+
+        $this->Mail = new PHPMailer();
+
+        $this->Mail->Priority = 3;
+        $this->Mail->Encoding = "8bit";
+        $this->Mail->CharSet = "iso-8859-1";
+        $this->Mail->From = "unit_test@phpmailer.sf.net";
+        $this->Mail->FromName = "Unit Tester";
+        $this->Mail->Sender = "";
+        $this->Mail->Subject = "Unit Test";
+        $this->Mail->Body = "";
+        $this->Mail->AltBody = "";
+        $this->Mail->WordWrap = 0;
+        $this->Mail->Host = $global_vars["mail_host"];
+        $this->Mail->Port = 25;
+        $this->Mail->Helo = "localhost.localdomain";
+        $this->Mail->SMTPAuth = false;
+        $this->Mail->Username = "";
+        $this->Mail->Password = "";
+        $this->Mail->PluginDir = $INCLUDE_DIR;
+               $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");
+        $this->Mail->Sender = "unit_test@phpmailer.sf.net";
+
+        if(strlen($this->Mail->Host) > 0)
+            $this->Mail->Mailer = "smtp";
+        else
+        {
+            $this->Mail->Mailer = "mail";
+            $this->Sender = "unit_test@phpmailer.sf.net";
+        }
+        
+        global $global_vars;
+        $this->SetAddress($global_vars["mail_to"], "Test User");
+        if(strlen($global_vars["mail_cc"]) > 0)
+            $this->SetAddress($global_vars["mail_cc"], "Carbon User", "cc");
+    }     
+
+    /**
+     * Run after each test is completed.
+     */
+    function tearDown() {
+        // Clean global variables
+        $this->Mail = NULL;
+        $this->ChangeLog = array();
+        $this->NoteLog = array();
+    }
+
+
+    /**
+     * Build the body of the message in the appropriate format.
+     * @private
+     * @returns void
+     */
+    function BuildBody() {
+        $this->CheckChanges();
+        
+        // Determine line endings for message        
+        if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)
+        {
+            $eol = "<br/>";
+            $bullet = "<li>";
+            $bullet_start = "<ul>";
+            $bullet_end = "</ul>";
+        }
+        else
+        {
+            $eol = "\n";
+            $bullet = " - ";
+            $bullet_start = "";
+            $bullet_end = "";
+        }
+        
+        $ReportBody = "";
+        
+        $ReportBody .= "---------------------" . $eol;
+        $ReportBody .= "Unit Test Information" . $eol;
+        $ReportBody .= "---------------------" . $eol;
+        $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
+        $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
+        
+        if(strlen($this->Mail->Host) > 0)
+            $ReportBody .= "Host: " . $this->Mail->Host . $eol;
+        
+        // If attachments then create an attachment list
+        if(count($this->Mail->attachment) > 0)
+        {
+            $ReportBody .= "Attachments:" . $eol;
+            $ReportBody .= $bullet_start;
+            for($i = 0; $i < count($this->Mail->attachment); $i++)
+            {
+                $ReportBody .= $bullet . "Name: " . $this->Mail->attachment[$i][1] . ", ";
+                $ReportBody .= "Encoding: " . $this->Mail->attachment[$i][3] . ", ";
+                $ReportBody .= "Type: " . $this->Mail->attachment[$i][4] . $eol;
+            }
+            $ReportBody .= $bullet_end . $eol;
+        }
+        
+        // If there are changes then list them
+        if(count($this->ChangeLog) > 0)
+        {
+            $ReportBody .= "Changes" . $eol;
+            $ReportBody .= "-------" . $eol;
+
+            $ReportBody .= $bullet_start;
+            for($i = 0; $i < count($this->ChangeLog); $i++)
+            {
+                $ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" . 
+                               $this->ChangeLog[$i][1] . "]" . $eol;
+            }
+            $ReportBody .= $bullet_end . $eol . $eol;
+        }
+        
+        // If there are notes then list them
+        if(count($this->NoteLog) > 0)
+        {
+            $ReportBody .= "Notes" . $eol;
+            $ReportBody .= "-----" . $eol;
+
+            $ReportBody .= $bullet_start;
+            for($i = 0; $i < count($this->NoteLog); $i++)
+            {
+                $ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
+            }
+            $ReportBody .= $bullet_end;
+        }
+        
+        // Re-attach the original body
+        $this->Mail->Body .= $eol . $eol . $ReportBody;
+    }
+    
+    /**
+     * Check which default settings have been changed for the report.
+     * @private
+     * @returns void
+     */
+    function CheckChanges() {
+        if($this->Mail->Priority != 3)
+            $this->AddChange("Priority", $this->Mail->Priority);
+        if($this->Mail->Encoding != "8bit")
+            $this->AddChange("Encoding", $this->Mail->Encoding);
+        if($this->Mail->CharSet != "iso-8859-1")
+            $this->AddChange("CharSet", $this->Mail->CharSet);
+        if($this->Mail->Sender != '')
+            $this->AddChange("Sender", $this->Mail->Sender);
+        if($this->Mail->WordWrap != 0)
+            $this->AddChange("WordWrap", $this->Mail->WordWrap);
+        if($this->Mail->Mailer != "mail")
+            $this->AddChange("Mailer", $this->Mail->Mailer);
+        if($this->Mail->Port != 25)
+            $this->AddChange("Port", $this->Mail->Port);
+        if($this->Mail->Helo != "localhost.localdomain")
+            $this->AddChange("Helo", $this->Mail->Helo);
+        if($this->Mail->SMTPAuth)
+            $this->AddChange("SMTPAuth", "true");
+    }
+    
+    /**
+     * Adds a change entry.
+     * @private
+     * @returns void
+     */
+    function AddChange($sName, $sNewValue) {
+        $cur = count($this->ChangeLog);
+        $this->ChangeLog[$cur][0] = $sName;
+        $this->ChangeLog[$cur][1] = $sNewValue;
+    }
+    
+    /**
+     * Adds a simple note to the message.
+     * @public
+     * @returns void
+     */
+    function AddNote($sValue) {
+        $this->NoteLog[] = $sValue;
+    }
+
+    /**
+     * Adds all of the addresses
+     * @public
+     * @returns void
+     */
+    function SetAddress($sAddress, $sName = "", $sType = "to") {
+        switch($sType)
+        {
+            case "to":
+                $this->Mail->AddAddress($sAddress, $sName);
+                break;
+            case "cc":
+                $this->Mail->AddCC($sAddress, $sName);
+                break;
+            case "bcc":
+                $this->Mail->AddBCC($sAddress, $sName);
+                break;
+        }
+    }
+
+    /////////////////////////////////////////////////
+    // UNIT TESTS
+    /////////////////////////////////////////////////
+
+    /**
+     * Try a plain message.
+     */
+    function test_WordWrap() {
+
+        $this->Mail->WordWrap = 40;
+        $my_body = "Here is the main body of this message.  It should " .
+                   "be quite a few lines.  It should be wrapped at the " .
+                   "40 characters.  Make sure that it is.";
+        $nBodyLen = strlen($my_body);
+        $my_body .= "\n\nThis is the above body length: " . $nBodyLen;
+
+        $this->Mail->Body = $my_body;
+        $this->Mail->Subject .= ": Wordwrap";
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Try a plain message.
+     */
+    function test_Low_Priority() {
+    
+        $this->Mail->Priority = 5;
+        $this->Mail->Body = "Here is the main body.  There should be " .
+                            "a reply to address in this message.";
+        $this->Mail->Subject .= ": Low Priority";
+        $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Simple plain file attachment test.
+     */
+    function test_Multiple_Plain_FileAttachment() {
+
+        $this->Mail->Body = "Here is the text body";
+        $this->Mail->Subject .= ": Plain + Multiple FileAttachments";
+
+        if(!$this->Mail->AddAttachment("test.png"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Simple plain string attachment test.
+     */
+    function test_Plain_StringAttachment() {
+
+        $this->Mail->Body = "Here is the text body";
+        $this->Mail->Subject .= ": Plain + StringAttachment";
+        
+        $sAttachment = "These characters are the content of the " .
+                       "string attachment.\nThis might be taken from a ".
+                       "database or some other such thing. ";
+        
+        $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Plain quoted-printable message.
+     */
+    function test_Quoted_Printable() {
+
+        $this->Mail->Body = "Here is the main body";
+        $this->Mail->Subject .= ": Plain + Quoted-printable";
+        $this->Mail->Encoding = "quoted-printable";
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Try a plain message.
+     */
+    function test_Html() {
+    
+        $this->Mail->IsHTML(true);
+        $this->Mail->Subject .= ": HTML only";
+        
+        $this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
+                            "Go to <a href=\"http://phpmailer.sourceforge.net/\">" .
+                            "http://phpmailer.sourceforge.net/</a> for new versions of " .
+                            "phpmailer.  <p/> Thank you!";
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Simple HTML and attachment test
+     */
+    function test_HTML_Attachment() {
+
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+        $this->Mail->Subject .= ": HTML + Attachment";
+        $this->Mail->IsHTML(true);
+        
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * An embedded attachment test.
+     */
+    function test_Embedded_Image() {
+
+        $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
+                     "Here is an image!</a>";
+        $this->Mail->Subject .= ": Embedded Image";
+        $this->Mail->IsHTML(true);
+        
+        if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
+                                          "base64", "image/png"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * An embedded attachment test.
+     */
+    function test_Multi_Embedded_Image() {
+
+        $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
+                     "Here is an image!</a>";
+        $this->Mail->Subject .= ": Embedded Image + Attachment";
+        $this->Mail->IsHTML(true);
+        
+        if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
+                                          "base64", "image/png"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+        
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Simple multipart/alternative test.
+     */
+    function test_AltBody() {
+
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+        $this->Mail->AltBody = "Here is the text body of this message.  " .
+                   "It should be quite a few lines.  It should be wrapped at the " .
+                   "40 characters.  Make sure that it is.";
+        $this->Mail->WordWrap = 40;
+        $this->AddNote("This is a mulipart alternative email");
+        $this->Mail->Subject .= ": AltBody + Word Wrap";
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    /**
+     * Simple HTML and attachment test
+     */
+    function test_AltBody_Attachment() {
+
+        $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
+        $this->Mail->AltBody = "This is the text part of the email.";
+        $this->Mail->Subject .= ": AltBody + Attachment";
+        $this->Mail->IsHTML(true);
+        
+        if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
+        {
+            $this->assert(false, $this->Mail->ErrorInfo);
+            return;
+        }
+
+        $this->BuildBody();
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+
+        $fp = fopen("message.txt", "w");
+        fwrite($fp, $this->Mail->CreateHeader() . $this->Mail->CreateBody());
+        fclose($fp);
+    }    
+
+    function test_MultipleSend() {
+        $this->Mail->Body = "Sending two messages without keepalive";
+        $this->BuildBody();
+        $subject = $this->Mail->Subject;
+
+        $this->Mail->Subject = $subject . ": SMTP 1";
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+        
+        $this->Mail->Subject = $subject . ": SMTP 2";
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+
+    function test_SmtpKeepAlive() {
+        $this->Mail->Body = "This was done using the SMTP keep-alive.";
+        $this->BuildBody();
+        $subject = $this->Mail->Subject;
+
+        $this->Mail->SMTPKeepAlive = true;
+        $this->Mail->Subject = $subject . ": SMTP keep-alive 1";
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+        
+        $this->Mail->Subject = $subject . ": SMTP keep-alive 2";
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+        $this->Mail->SmtpClose();
+    }
+    
+    /**
+     * Tests this denial of service attack: 
+     *    http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
+     */
+    function test_DenialOfServiceAttack() {
+        $this->Mail->Body = "This should no longer cause a denial of service.";
+        $this->BuildBody();
+       
+        $this->Mail->Subject = str_repeat("A", 998);
+        $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
+    }
+    
+    function test_Error() {
+        $this->Mail->Subject .= ": This should be sent"; 
+        $this->BuildBody();
+        $this->Mail->ClearAllRecipients(); // no addresses should cause an error
+        $this->assert($this->Mail->IsError() == false, "Error found");
+        $this->assert($this->Mail->Send() == false, "Send succeeded");
+        $this->assert($this->Mail->IsError(), "No error found");
+        $this->assertEquals('You must provide at least one ' .
+                            'recipient email address.', $this->Mail->ErrorInfo);
+        $this->Mail->AddAddress(get("mail_to"));
+        $this->assert($this->Mail->Send(), "Send failed");
+    }
+}  
+/**
+ * Create and run test instance.
+ */
+if(isset($HTTP_GET_VARS))
+    $global_vars = $HTTP_GET_VARS;
+else
+    $global_vars = $_REQUEST;
+
+if(isset($global_vars["submitted"]))
+{
+    echo "Test results:<br>";
+    $suite = new TestSuite( "phpmailerTest" );
+    
+    $testRunner = new TestRunner;
+    $testRunner->run($suite);
+    echo "<hr noshade/>";
+}
+
+function get($sName) {
+    global $global_vars;
+    if(isset($global_vars[$sName]))
+        return $global_vars[$sName];
+    else
+        return "";
+}
+
+?>
+
+<html>
+<body>
+<h3>phpmailer Unit Test</h3>
+By entering a SMTP hostname it will automatically perform tests with SMTP.
+
+<form name="phpmailer_unit" action="phpmailer_test.php" method="get">
+<input type="hidden" name="submitted" value="1"/>
+To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>
+<br/>
+Cc Address: <input type="text" size="50" name="mail_cc" value="<?php echo get("mail_cc"); ?>"/>
+<br/>
+SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>
+<p/>
+<input type="submit" value="Run Test"/>
+
+</form>
+</body>
+</html>
diff --git a/inc/phpmailer/test/phpunit.php b/inc/phpmailer/test/phpunit.php
new file mode 100644 (file)
index 0000000..3344769
--- /dev/null
@@ -0,0 +1,376 @@
+<?php
+//
+// PHP framework for testing, based on the design of "JUnit".
+//
+// Written by Fred Yankowski <fred@ontosys.com>
+//            OntoSys, Inc  <http://www.OntoSys.com>
+//
+// $Id: phpunit.php,v 1.1 2002/03/30 19:32:17 bmatzelle Exp $
+
+// Copyright (c) 2000 Fred Yankowski
+
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies
+// of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+//
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |
+               E_CORE_ERROR | E_CORE_WARNING);
+
+/*
+interface Test {
+  function run(&$aTestResult);
+  function countTestCases();
+}
+*/
+
+function trace($msg) {
+  return;
+  print($msg);
+  flush();
+}
+
+
+class Exception {
+    /* Emulate a Java exception, sort of... */
+  var $message;
+  function Exception($message) {
+    $this->message = $message;
+  }
+  function getMessage() {
+    return $this->message;
+  }
+}
+
+class Assert {
+  function assert($boolean, $message=0) {
+    if (! $boolean)
+      $this->fail($message);
+  }
+
+  function assertEquals($expected, $actual, $message=0) {
+    if ($expected != $actual) {
+      $this->failNotEquals($expected, $actual, "expected", $message);
+    }
+  }
+
+  function assertRegexp($regexp, $actual, $message=false) {
+    if (! preg_match($regexp, $actual)) {
+      $this->failNotEquals($regexp, $actual, "pattern", $message);
+    }
+  }
+
+  function failNotEquals($expected, $actual, $expected_label, $message=0) {
+    // Private function for reporting failure to match.
+    $str = $message ? ($message . ' ') : "";
+    $str .= "($expected_label/actual)<br>";
+    $htmlExpected = htmlspecialchars($expected);
+    $htmlActual = htmlspecialchars($actual);
+    $str .= sprintf("<pre>%s\n--------\n%s</pre>",
+                   $htmlExpected, $htmlActual);
+    $this->fail($str);
+  }
+}
+
+class TestCase extends Assert /* implements Test */ {
+  /* Defines context for running tests.  Specific context -- such as
+     instance variables, global variables, global state -- is defined
+     by creating a subclass that specializes the setUp() and
+     tearDown() methods.  A specific test is defined by a subclass
+     that specializes the runTest() method. */
+  var $fName;
+  var $fResult;
+  var $fExceptions = array();
+
+  function TestCase($name) {
+    $this->fName = $name;
+  }
+
+  function run($testResult=0) {
+    /* Run this single test, by calling the run() method of the
+       TestResult object which will in turn call the runBare() method
+       of this object.  That complication allows the TestResult object
+       to do various kinds of progress reporting as it invokes each
+       test.  Create/obtain a TestResult object if none was passed in.
+       Note that if a TestResult object was passed in, it must be by
+       reference. */
+    if (! $testResult)
+      $testResult = $this->_createResult();
+    $this->fResult = $testResult;
+    $testResult->run(&$this);
+    $this->fResult = 0;
+    return $testResult;
+  }
+
+  function countTestCases() {
+    return 1;
+  }
+
+  function runTest() {
+    $name = $this->name();
+    // Since isset($this->$name) is false, no way to run defensive checks
+    $this->$name();
+  }
+
+  function setUp() /* expect override */ {
+    //print("TestCase::setUp()<br>\n");
+  }
+
+  function tearDown() /* possible override */ {
+    //print("TestCase::tearDown()<br>\n");
+  }
+
+  ////////////////////////////////////////////////////////////////
+
+
+  function _createResult() /* protected */ {
+    /* override this to use specialized subclass of TestResult */
+    return new TestResult;
+  }
+
+  function fail($message=0) {
+    //printf("TestCase::fail(%s)<br>\n", ($message) ? $message : "");
+    /* JUnit throws AssertionFailedError here.  We just record the
+       failure and carry on */
+    $this->fExceptions[] = new Exception(&$message);
+  }
+
+  function error($message) {
+    /* report error that requires correction in the test script
+       itself, or (heaven forbid) in this testing infrastructure */
+    printf('<b>ERROR: ' . $message . '</b><br>');
+    $this->fResult->stop();
+  }
+
+  function failed() {
+    return count($this->fExceptions);
+  }
+
+  function getExceptions() {
+    return $this->fExceptions;
+  }
+
+  function name() {
+    return $this->fName;
+  }
+
+  function runBare() {
+    $this->setup();
+    $this->runTest();
+    $this->tearDown();
+  }
+}
+
+
+class TestSuite /* implements Test */ {
+  /* Compose a set of Tests (instances of TestCase or TestSuite), and
+     run them all. */
+  var $fTests = array();
+
+  function TestSuite($classname=false) {
+    if ($classname) {
+      // Find all methods of the given class whose name starts with
+      // "test" and add them to the test suite.  We are just _barely_
+      // able to do this with PHP's limited introspection...  Note
+      // that PHP seems to store method names in lower case, and we
+      // have to avoid the constructor function for the TestCase class
+      // superclass.  This will fail when $classname starts with
+      // "Test" since that will have a constructor method that will
+      // get matched below and then treated (incorrectly) as a test
+      // method.  So don't name any TestCase subclasses as "Test..."!
+      if (floor(phpversion()) >= 4) {
+       // PHP4 introspection, submitted by Dylan Kuhn
+       $names = get_class_methods($classname);
+       while (list($key, $method) = each($names)) {
+         if (preg_match('/^test/', $method) && $method != "testcase") {  
+           $this->addTest(new $classname($method));
+         }
+       }
+      }
+      else {
+       $dummy = new $classname("dummy");
+       $names = (array) $dummy;
+       while (list($key, $value) = each($names)) {
+         $type = gettype($value);
+         if ($type == "user function" && preg_match('/^test/', $key)
+         && $key != "testcase") {  
+           $this->addTest(new $classname($key));
+         }
+       }
+      }
+    }
+  }
+
+  function addTest($test) {
+    /* Add TestCase or TestSuite to this TestSuite */
+    $this->fTests[] = $test;
+  }
+
+  function run(&$testResult) {
+    /* Run all TestCases and TestSuites comprising this TestSuite,
+       accumulating results in the given TestResult object. */
+    reset($this->fTests);
+    while (list($na, $test) = each($this->fTests)) {
+      if ($testResult->shouldStop())
+       break;
+      $test->run(&$testResult);
+    }
+  }
+
+  function countTestCases() {
+    /* Number of TestCases comprising this TestSuite (including those
+       in any constituent TestSuites) */
+    $count = 0;
+    reset($fTests);
+    while (list($na, $test_case) = each($this->fTests)) {
+      $count += $test_case->countTestCases();
+    }
+    return $count;
+  }
+}
+
+
+class TestFailure {
+  /* Record failure of a single TestCase, associating it with the
+     exception(s) that occurred */
+  var $fFailedTestName;
+  var $fExceptions;
+
+  function TestFailure(&$test, &$exceptions) {
+    $this->fFailedTestName = $test->name();
+    $this->fExceptions = $exceptions;
+  }
+
+  function getExceptions() {
+      return $this->fExceptions;
+  }
+  function getTestName() {
+    return $this->fFailedTestName;
+  }
+}
+
+
+class TestResult {
+  /* Collect the results of running a set of TestCases. */
+  var $fFailures = array();
+  var $fRunTests = 0;
+  var $fStop = false;
+
+  function TestResult() { }
+
+  function _endTest($test) /* protected */ {
+      /* specialize this for end-of-test action, such as progress
+        reports  */
+  }
+
+  function getFailures() {
+    return $this->fFailures;
+  }
+
+  function run($test) {
+    /* Run a single TestCase in the context of this TestResult */
+    $this->_startTest($test);
+    $this->fRunTests++;
+
+    $test->runBare();
+
+    /* this is where JUnit would catch AssertionFailedError */
+    $exceptions = $test->getExceptions();
+    if ($exceptions)
+      $this->fFailures[] = new TestFailure(&$test, &$exceptions);
+    $this->_endTest($test);
+  }
+
+  function countTests() {
+    return $this->fRunTests;
+  }
+
+  function shouldStop() {
+    return $this->fStop;
+  }
+
+  function _startTest($test) /* protected */ {
+      /* specialize this for start-of-test actions */
+  }
+
+  function stop() {
+    /* set indication that the test sequence should halt */
+    $fStop = true;
+  }
+
+  function countFailures() {
+    return count($this->fFailures);
+  }
+}
+
+
+class TextTestResult extends TestResult {
+  /* Specialize TestResult to produce text/html report */
+  function TextTestResult() {
+    $this->TestResult();  // call superclass constructor
+  }
+  
+  function report() {
+    /* report result of test run */
+    $nRun = $this->countTests();
+    $nFailures = $this->countFailures();
+    printf("<p>%s test%s run<br>", $nRun, ($nRun == 1) ? "" : 's');
+    printf("%s failure%s.<br>\n", $nFailures, ($nFailures == 1) ? "" : 's');
+    if ($nFailures == 0)
+      return;
+
+    print("<ol>\n");
+    $failures = $this->getFailures();
+    while (list($i, $failure) = each($failures)) {
+      $failedTestName = $failure->getTestName();
+      printf("<li>%s\n", $failedTestName);
+
+      $exceptions = $failure->getExceptions();
+      print("<ul>");
+      while (list($na, $exception) = each($exceptions))
+       printf("<li>%s\n", $exception->getMessage());
+      print("</ul>");
+    }
+    print("</ol>\n");
+  }
+
+  function _startTest($test) {
+    printf("%s ", $test->name());
+    flush();
+  }
+
+  function _endTest($test) {
+    $outcome = $test->failed()
+       ? "<font color=\"red\">FAIL</font>"
+       : "<font color=\"green\">ok</font>";
+    printf("$outcome<br>\n");
+    flush();
+  }
+}
+
+
+class TestRunner {
+  /* Run a suite of tests and report results. */
+  function run($suite) {
+    $result = new TextTestResult;
+    $suite->run($result);
+    $result->report();
+  }
+}
+
+?>
diff --git a/inc/phpmailer/test/test.png b/inc/phpmailer/test/test.png
new file mode 100644 (file)
index 0000000..02de5a7
Binary files /dev/null and b/inc/phpmailer/test/test.png differ
diff --git a/inc/pool-update.php b/inc/pool-update.php
new file mode 100644 (file)
index 0000000..6f1fc8f
--- /dev/null
@@ -0,0 +1,485 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/08/2003 *
+ * ===============                              Last change: 07/01/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : pool-update.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends queued mails from the pool                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sendet freigegebene Mails aus den Pool           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Don't run on daily reset
+if (defined('__DAILY_RESET')) {
+       // Skip here
+       return false;
+} // END - if
+
+// Test html extensions once
+$HTML_EXT = EXT_IS_ACTIVE("html_mail", true);
+
+// Check for freed mail orders to send out
+if ($HTML_EXT) {
+       //                                0     1        2      3       4          5            6      7        8          9       10
+       $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, html_msg FROM "._MYSQL_PREFIX."_pool WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+} else {
+       //                                0     1        2      3       4          5            6      7        8          9    10
+       $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, id FROM "._MYSQL_PREFIX."_pool WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+}
+
+// Reset variables
+$cnt = 0; $cnt2 = 0; $LAST_SENT_ID = 0; $cnt_back = array("0"); $points_BACK = array("0");
+if (SQL_NUMROWS($result_main) > 0)
+{
+       while ($DATA = SQL_FETCHROW($result_main))
+       {
+               // Check fetched data for HTML
+               $HTML = $DATA[10]; if ($HTML == $DATA[0]) $HTML = "N";
+
+               // Compile URL and subject line
+               $DATA[7] = COMPILE_CODE($DATA[7]);
+
+               // Set mail order as "active". That means it will be sent out
+               $result_active = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='ACTIVE' WHERE id=%s AND data_type='NEW' LIMIT 1",
+                array($DATA[0]), __FILE__, __LINE__);
+               if (SQL_AFFECTEDROWS() == 1)
+               {
+                       // "Explode" all receivers into an array
+                       if (ereg(";", $DATA[4]))
+                       {
+                               // There's more than one receiver in the list...
+                               $RECEIVERS = explode(";", $DATA[4]);
+                       }
+                        elseif (!empty($DATA[4]))
+                       {
+                               // Only one user left
+                               $RECEIVERS = array($DATA[4]);
+                       }
+                        else
+                       {
+                               // No users left
+                               $RECEIVERS = array("0");
+                       }
+                       $dummy = $RECEIVERS;
+
+                       // Now, if we are good little boys and girls Santa left us some user-ids.
+                       // We can now send mails to them...
+                       foreach ($RECEIVERS as $key => $uid)
+                       {
+                               // Lookup user ID
+                               $result_user = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                array(bigintval($uid)), __FILE__, __LINE__);
+
+                               // Is his data available?
+                               //* DEBUG: */ echo "*L:".__LINE__."/".SQL_NUMROWS($result_user)."*<br />";
+                               if (SQL_NUMROWS($result_user) == 1)
+                               {
+                                       // The final receiver does exists so we can continue...
+                                       list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
+
+                                       // Free memory
+                                       SQL_FREERESULT($result_user);
+
+                                       // Do we have a stats entry?
+                                       $result_stats = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+                                        array($DATA[0], $DATA[1], $DATA[6]), __FILE__, __LINE__);
+
+                                       // If there's no stats entry add it!
+                                       //* DEBUG: */ echo "!L:".__LINE__."/".SQL_NUMROWS($result_stats)."!<br />";
+                                       if (SQL_NUMROWS($result_stats) == 0)
+                                       {
+                                               // No entry was found, so we add him!
+                                               $result_stats = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_stats (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
+                                                array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[9]), bigintval($DATA[5]), $DATA[2], $DATA[7], $DATA[8], bigintval($DATA[6])), __FILE__, __LINE__);
+
+                                               // Receive it's ID for the links table
+                                               $result_stats = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_stats WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+                                                array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[6])), __FILE__, __LINE__);
+                                       }
+
+                                       //* DEBUG: */ echo "!L:".__LINE__."/".SQL_NUMROWS($result_stats)."!<br />";
+                                       if (SQL_NUMROWS($result_stats) == 1)
+                                       {
+                                               // We got one!
+                                               list($stats_id) = SQL_FETCHROW($result_stats);
+                                               SQL_FREERESULT($result_stats);
+
+                                               // Mark this user as "spammed" ;-) And place a line for him...
+                                               //* DEBUG: */ echo "?L:".__LINE__."/".$dummy."/".$key."/".$uid."(".$DATA[1].")/".$DATA[0]."/".$stats_id."?<br />";
+                                               switch (REMOVE_RECEIVER($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
+                                               {
+                                               case "done":
+                                                       // Prepare the mail
+                                                       $DATA[11] = bigintval($stats_id);
+                                                       $DATA[12] = $sname;
+                                                       $DATA[13] = $fname;
+                                                       $DATA[14] = TRANSLATE_GENDER($gender);
+
+                                                       // Replace text variables
+                                                       foreach ($REPLACER as $key => $value) {
+                                                               if (isset($DATA[$key])) $DATA[3] = str_replace($value, $DATA[$key], $DATA[3]);
+                                                       } // END - if
+
+                                                       // Prepare content
+                                                       $content = array(
+                                                               'id'         => $DATA[11],
+                                                               'url'        => $DATA[7],
+                                                               'sender_uid' => $DATA[1],
+                                                               'category'   => GET_CATEGORY($DATA[9]),
+                                                               'time'       => CREATE_FANCY_TIME(GET_PAY_POINTS($DATA[5], "time")),
+                                                               'points'     => TRANSLATE_COMMA(GET_PAY_POINTS($DATA[5], "payment")),
+                                                               'text'       => $DATA[3]
+                                                       );
+
+                                                       // Load message template
+                                                       $msg = LOAD_EMAIL_TEMPLATE("normal-mail", $content, bigintval($uid));
+
+                                                       // Send mail away
+                                                       SEND_EMAIL($email, $DATA[2], $msg, $HTML);
+
+                                                       // Count sent mails...
+                                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
+                                                        array(bigintval($DATA[1])), __FILE__, __LINE__);
+
+                                                       if (GET_EXT_VERSION("user") >= "0.1.4") {
+                                                               // Update mails received for receiver
+                                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
+                                                               array(bigintval($uid)), __FILE__, __LINE__);
+                                                       } // END - if
+
+                                                       // Update mediadata if version is 0.0.4 or higher
+                                                       if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
+                                                               // Update entry (or add missing)
+                                                               //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                                               MEDIA_UPDATE_ENTRY(array("total_send", "normal_send"), "add", 1);
+                                                       } // END - if
+
+                                                       // And count up the mail
+                                                       $cnt++;
+                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$cnt."*<br />";
+                                                       break;
+
+                                               case "already":
+                                                       // Entry already found, but we still count one up!
+                                                       $cnt++;
+                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$cnt."<br />";
+                                                       break;
+                                               }
+                                       }
+
+                                       // Do we have reached the maximum to send mails? || ($_CONFIG['max_send'] >= $cnt)
+                                       //* DEBUG: */ echo "*L:".__LINE__."/".$cnt.">=".$DATA[8]."/".$_CONFIG['max_send'].">=".$cnt."/".$LAST_SENT_ID."!=".$DATA[0]."*<br />";
+                                       if ((($cnt >= $DATA[8])) && ($LAST_SENT_ID != $DATA[0])) {
+                                               // Prepare content
+                                               $content = array(
+                                                       'sender_uid' => $DATA[1],
+                                                       'category'   => GET_CATEGORY($DATA[9]),
+                                                       'text'       => $DATA[3],
+                                                       'url'        => $DATA[7],
+                                                       'expiration' => CREATE_FANCY_TIME(GET_PAY_POINTS($DATA[5], "time"))
+                                               );
+
+                                               // Yes we do, so we notify admin and sender about fully sent mail!
+                                               SEND_ADMIN_NOTIFICATION(ADMIN_SUBJ_SEND_DONE, "done-admin", $content, $uid);
+
+                                               // Get sender's data
+                                               $result_sender = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                                array(bigintval($DATA[1])), __FILE__, __LINE__);
+                                               if (SQL_NUMROWS($result_sender) == 1) {
+                                                       // Load data and prepare mail
+                                                       list($sname, $fname, $email) = SQL_FETCHROW($result_sender);
+                                                       SQL_FREERESULT($result_sender);
+
+                                                       // Load email template
+                                                       $msg = LOAD_EMAIL_TEMPLATE("done-member", $content, $DATA[1]);
+
+                                                       // Send it also waway
+                                                       SEND_EMAIL($email, MEMBER_SUBJ_SEND_DONE, $msg);
+                                               }
+
+                                               // Set status to SEND because we completely send it away
+                                               $result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+                                                array(bigintval($DATA[0])), __FILE__, __LINE__);
+
+                                               // Update send-completed-time
+                                               $result_user = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
+                                                array(bigintval($DATA[0])), __FILE__, __LINE__);
+
+                                               $LAST_SENT_ID = $DATA[0]; $cnt = 0;
+                                               $cnt2 += $cnt;
+
+                                               // Update mediadata if version is 0.0.4 or higher
+                                               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+                                               {
+                                                       // Update entry (or add missing)
+                                                       //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                                       MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), "add", 1);
+                                               }
+
+                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$P."<br />";
+                                               break;
+                                       }
+                                       // Do we have send maximum mails?
+                                        elseif (($cnt >= $_CONFIG['max_send']) || ($cnt2 >= $_CONFIG['max_send']))
+                                       {
+                                               // There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
+                                               $ADD = "";
+                                               if ($cnt <= $DATA[8]) $ADD = ", target_send=target_send-".$cnt;
+                                               $result_queue = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='NEW', receivers='%s'".$ADD." WHERE id=%s LIMIT 1",
+                                                array(implode(";", $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
+
+                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__."*<br />";
+                                               break;
+                                       }
+                               }
+                                else
+                               {
+                                       // User does not exists so we have add the sender's points back to sender's account
+                                       if (($RECEIVERS[0] == "0") || (empty($RECEIVERS[0])))
+                                       {
+                                               // List was empty
+                                               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='SEND' WHERE id=%s LIMIT 1",
+                                                array(bigintval($DATA[0])), __FILE__, __LINE__);
+                                       }
+                                        else
+                                       {
+                                               if ($uid > 0)
+                                               {
+                                                       // User does not exists, pay points back
+                                                       $points = GET_PAY_POINTS($DATA[5]);
+                                                       ADD_POINTS_REFSYSTEM($DATA[1], $points, false, "0", false, "direct");
+
+                                                       // Add points together and remove user
+                                                       $points_BACK[$DATA[1]] += $points;
+                                               }
+                                               $cnt_back[$DATA[1]]++;
+                                       }
+                                       // Remove entry from list
+                                       unset($dummy[$key]);
+
+                                       // Update receivers
+                                       $result_queue = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET receivers='%s' WHERE id=%s LIMIT 1",
+                                        array(implode(";", $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
+                               }
+                       }
+               }
+       }
+       if ((sizeof($points_BACK) > 0) && (!empty($points_BACK[0]))) {
+               foreach ($points_BACK as $uid => $PB) {
+                       // Add points only when we have points left to add and a valid user ID
+                       if (($PB > 0) && ($uid > 0)) {
+                               // Prepare content
+                               $content = array(
+                                       'points' => TRANSLATE_COMMA($DATA[10])
+                               );
+
+                               // We have to pay back some points to the sender (we add them directly :-P)
+                               $result = SQL_QUERY_ESC("SELECT email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                                       array(bigintval($uid)), __FILE__, __LINE__);
+                               $DATA[10] = $PB; $DATA[11] = $cnt_back[$uid];
+                               if (SQL_NUMROWS($result) == 1) {
+                                       list($email) = SQL_FETCHROW($result);
+                                       SQL_FREERESULT($result);
+
+                                       // User account does exists, so we can safely pay back!
+                                       $msg = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
+
+                                       // Send mail out to member
+                                       SEND_EMAIL($email, MEMBER_BACK_JACKPOT." (".$uid.")", $msg);
+                               } else {
+                                       // Add to jackpot
+                                       ADD_JACKPOT($PB);
+
+                                       // Send mail out to admin
+                                       SEND_ADMIN_NOTIFICATION(ADMIN_BACK_JACKPOT." (".$uid.")", "back-admin", $content, "admin");
+                               }
+                       }
+               }
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result_main);
+
+// Only send bonus mail when bonus extension is active and maximum send-mails is not reached
+if ((EXT_IS_ACTIVE("bonus") && ($cnt < $_CONFIG['max_send'])))
+{
+       // Do we need to send out bonus mails?
+       if ($HTML_EXT) {
+               //                                 0     1       2        3        4      5       6          7       8      9         10         11
+               $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, html_msg FROM "._MYSQL_PREFIX."_bonus WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+       } else {
+               //                                 0     1       2        3        4      5       6          7       8      9         10
+               $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send FROM "._MYSQL_PREFIX."_bonus WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+       }
+
+       if (SQL_NUMROWS($result_bonus) > 0) {
+               // Send these mails away...
+               $cnt2 = "";
+               while ($DATA = SQL_FETCHARRAY($result_bonus)) {
+                       // Compile URL
+                       $DATA['url'] = COMPILE_CODE($DATA['url']);
+
+                       // Message is active in queue
+                       $result_queue = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='QUEUE' WHERE id=%s LIMIT 1",
+                        array(bigintval($DATA['id'])), __FILE__, __LINE__);
+
+                       // "Explode" all receivers into an array
+                       if (ereg(";", $DATA['receivers'])) {
+                               // There's more than one receiver in the list...
+                               $RECEIVERS = explode(";", $DATA['receivers']);
+                       } elseif (!empty($DATA['points'])) {
+                               // Only one user left
+                               $RECEIVERS = array($DATA['receivers']);
+                       } else {
+                               // No users left
+                               $RECEIVERS = array("0");
+                       }
+                       $dummy = $RECEIVERS;
+
+                       // Now, if we are good little boys and girls Santa left us some user-ids.
+                       // We can now send mails to them...
+                       foreach ($RECEIVERS as $key => $uid) {
+                               // Load personal data
+                               //* DEBUG: */ echo "*L:".__LINE__."/".$uid."*<br />";
+                               $result_user = SQL_QUERY_ESC("SELECT surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
+                                array(bigintval($uid)), __FILE__, __LINE__);
+
+                               // Is his data available?
+                               if (SQL_NUMROWS($result_user) == 1)
+                               {
+                                       // The final receiver does exists so we can continue...
+                                       list($sname, $fname, $email) = SQL_FETCHROW($result_user);
+                                       //* DEBUG: */ echo "OK!/L:".__LINE__."<br />";
+
+                                       // Mark this user as "spammed" ;-) And place a line for him...
+                                       if (REMOVE_RECEIVER($dummy, $key, $uid, $DATA['id'], $DATA['id'], true) == "done")
+                                       {
+                                               // Replace text variables
+                                               foreach ($REPLACER as $key => $value) {
+                                                       if (isset($DATA[$key])) $DATA['text'] = str_replace($value, $DATA[$key], $DATA['text']);
+                                               } // END - foreach
+
+                                               // Prepare content
+                                               $content = array(
+                                                       'id'       => $DATA['id'],
+                                                       'url'      => $DATA['url'],
+                                                       'time'     => CREATE_FANCY_TIME($DATA['time']),
+                                                       'points'   => TRANSLATE_COMMA($DATA['points']),
+                                                       'category' => GET_CATEGORY($DATA['cat_id']),
+                                                       'text'     => $DATA['text']
+                                               );
+
+                                               // Prepare the mail
+                                               $msg = LOAD_EMAIL_TEMPLATE("bonus-mail", $content, $uid);
+
+                                               // Send mail away
+                                               if (isset($DATA['html_msg'])) {
+                                                       // Send HTML?
+                                                       SEND_EMAIL($email, $DATA['subject'], $msg, $DATA['html_msg']);
+                                               } else {
+                                                       // No HTML mail!
+                                                       SEND_EMAIL($email, $DATA['subject'], $msg);
+                                               }
+
+                                               // Count one up and remove entry from dummy array
+                                               $cnt++; unset($dummy[$key]);
+
+                                               if (GET_EXT_VERSION("user") >= "0.1.4")
+                                               {
+                                                       // Update mails received for receiver
+                                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
+                                                        array(bigintval($uid)), __FILE__, __LINE__);
+                                               }
+
+                                               // Do we have send maximum mails?
+                                               if (($cnt >= $_CONFIG['max_send']) || (SELECTION_COUNT($dummy) == 0))
+                                               {
+                                                       // Yes, we have
+                                                       //* DEBUG: */ echo "*EXIT/L:".__LINE__."<br />";
+                                                       break;
+                                               }
+                                       }
+                               }
+
+                               // Free some memory
+                               SQL_FREERESULT($result_user);
+                       }
+
+                       // Update mediadata if version is 0.0.4 or higher
+                       if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+                       {
+                               // Update entry (or add missing
+                               $P = $cnt;
+                               if (!empty($cnt2) && empty($cnt)) $P = $cnt2;
+                               //* DEBUG: */ echo "+MEDIA/L:".__LINE__."/".$P."+<br />";
+                               MEDIA_UPDATE_ENTRY(array("total_send", "bonus_send"), "add", $P);
+                       }
+
+                       // Close sending system
+                       //* DEBUG: */ echo "-L:".__LINE__."/".SELECTION_COUNT($dummy)."-<br />";
+                       if (SELECTION_COUNT($dummy) == 0)
+                       {
+                               // Queue reached!
+                               $result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+                                array(bigintval($DATA['id'])), __FILE__, __LINE__);
+                               //* DEBUG: */ echo "*L:".__LINE__."*<br />";
+
+                               // Update mediadata if version is 0.0.4 or higher
+                               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+                               {
+                                       // Update entry (or add missing)
+                                       //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
+                                       MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders"), "add", 1);
+                               }
+                       }
+                        elseif ($cnt >= $_CONFIG['max_send'])
+                       {
+                               // Update bonus pool
+                               $result_done = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_bonus SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1",
+                                array(SELECTION_COUNT($dummy), implode(";", $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
+                               //* DEBUG: */ echo "*L:".__LINE__."<PRE>";
+                               //* DEBUG: */ print_r($dummy);
+                               //* DEBUG: */ echo "</PRE>\n!!!<br />";
+                               break;
+                       }
+               }
+       }
+
+       // Free memory
+       SQL_FREERESULT($result_bonus);
+}
+
+// Remove message (IMPORTANT!)
+unset($msg);
+
+//
+?>
diff --git a/inc/profile-updte.php b/inc/profile-updte.php
new file mode 100644 (file)
index 0000000..1e29d2e
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 02/29/2004 *
+ * ===============                              Last change: 04/12/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : profile-updte.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Sends out notifications to keep profiles updated *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sendet Erinnerngen aus, damit die Profile        *
+ *                     von den Mitgliedern aktuell gehalten werden      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+if (($_CONFIG['send_prof_update'] == "Y") && ($_CONFIG['profile_update'] > 0) && ($_CONFIG['resend_profile_update'])) {
+       // Load personal data              0      1     2      3        4          5         6
+       $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, last_update, joined
+FROM
+       "._MYSQL_PREFIX."_user_data
+WHERE
+       (last_update < (UNIX_TIMESTAMP() - %s) AND last_update != 0 AND last_profile_sent < (UNIX_TIMESTAMP() - %s))
+OR
+       (last_update=0 AND last_profile_sent=0 AND joined < (UNIX_TIMESTAMP() - %s))
+ORDER BY userid", array($_CONFIG['profile_update'], $_CONFIG['resend_profile_update'], $_CONFIG['profile_update']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) > 0)
+       {
+               // We need to send-out notifications...
+               while ($DATA = SQL_FETCHROW($result))
+               {
+                       $DATA[6] = MAKE_DATETIME($DATA[6], "0");
+                       if (round($DATA[5]) == "0")
+                       {
+                               // Has never changed his accont
+                               $DATA[5] = PROFILE_NEVER_CHANGED;
+                       }
+                        else
+                       {
+                               // Has changed his account
+                               $DATA[5] = MAKE_DATETIME($DATA[5], "0");
+                       }
+
+                       // Load email template and send mail away
+                       $msg = LOAD_EMAIL_TEMPLATE("profile-updte", "", bigintval($DATA[0]));
+                       SEND_EMAIL($DATA[1], PROFILE_OUTDATED, $msg);
+
+                       // Update profile data
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_profile_sent=UNIX_TIMESTAMP(), notified='Y' WHERE userid=%s LIMIT 1",
+                        array(bigintval($DATA[0])), __FILE__, __LINE__);
+               }
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+}
+//
+?>
diff --git a/inc/rdf.class.php b/inc/rdf.class.php
new file mode 100644 (file)
index 0000000..d42bdbf
--- /dev/null
@@ -0,0 +1,1382 @@
+<?php
+/* $Id: rdf.class.php,v 1.40 2003/07/06 20:33:58 sts Exp $ */
+
+//
+// +----------------------------------------------------------------------+
+// | rss Parser                                                           |
+// | Copyright (c) 2001 Stefan Saasen                                     |
+// +----------------------------------------------------------------------+
+// | The contents of this file are subject to the Mozilla Public License  |
+// | Version 1.1 (the "License"); you may not use this file except in     |
+// | compliance with the License. You may obtain a copy of the License at |
+// | http://www.mozilla.org/MPL/                                          |
+// |                                                                      |
+// | Software distributed under the License is distributed on an "AS IS"  |
+// | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See  |
+// | the License for the specific language governing rights and           |
+// | limitations under the License.                                       |
+// +----------------------------------------------------------------------+
+// |                                                                      |
+// | Maintainer and initial developer:                                    |
+// | Stefan Saasen <s@fase4.com>                                          |
+// |                                                                      |
+// | Proxy and authentication methods added by:                           |
+// | Marco Kraus <marco.kraus@siemens.com>                                |
+// |                                                                      |
+// | Decoding of data by htmlentities or utf8_decode added by:            |
+// | Roland Haeder <webmaster@mxchange.org>                               |
+// |                                                                      |
+// +----------------------------------------------------------------------+
+// | Ref:                                                                 |
+// |   @link http://www.fase4.com/rdf/                   Latest release   |
+// +----------------------------------------------------------------------+
+
+/**
+* Class RSS Parser
+*
+* This class offers methods to parse RSS Files
+*
+* @link      http://www.fase4.com/rdf/ Latest release of this class
+* @package   rss
+* @copyright Copyright (c) 2001 fase4.com. All rights reserved.
+* @author    Stefan Saasen <s@fase4.com>
+* @version   1.7 ($Date: 2003/07/06 20:33:58 $) $Revision: 1.40 $
+* @access    public
+*/
+
+class fase4_rdf {
+
+    /**
+    * Word-wrapping mode for description, set it to 0 do disable this feature! Ommits _use_nl2br!
+    *
+    * @access private
+    * @var    integer
+    */
+    var $_word_wrap = 0;
+
+    /**
+    * Wether to recode \n -> <br /> or not in description
+    *
+    * @access private
+    * @var    boolean
+    */
+    var $_use_nl2br = true;
+
+    /**
+    * Sets the decoding mode of the read data (UTF8 scrambles some german umlauts here!)
+    *
+    * "htmlentities" - Use the function htmlentities()
+    * "utf8_decode"  - Use the function ut8_decode() when you have UTF8 encoded text
+    *
+    * @access private
+    * @var    string
+    */
+    var $_decoding_mode = "utf8_decode";
+
+    /**
+    * If $_link_target is set a target='xxx' attribute in each <a /> and <form /> html tag will be added
+    *
+    * Possible values are "_blank", "_content", "_parent", "_self", "_top"
+    *
+    * @access private
+    * @var    string
+    */
+    var $_link_target = "_blank";
+
+    /**
+    * vars for proxy settings - Prox Host
+    *
+    * @access private
+    * @var      string
+    */
+    var $_phost = "";
+
+    /**
+    * vars for proxy settings - Prox Port
+    *
+    * @access private
+    * @var      string
+    */
+    var $_pport = "";
+
+    /**
+    * vars for proxy settings - Prox Username
+    *
+    * @access private
+    * @var      string
+    */
+    var $_pname = "";
+
+    /**
+    * vars for proxy settings - Prox Password
+    *
+    * @access private
+    * @var      string
+    */
+    var $_ppasswd = "";
+
+    /**
+    * just a flag for checking if proxy-support should be enabled
+    * set default to false (will be enabled if set_proxy is called)
+    *
+    * @access   private
+    * @see      set_proxy()
+    * @var      bool
+    */
+    var $_use_proxy = false;
+
+    /**
+    * just a flag for checking if proxy-support with authentication
+    * should be enabled
+    * set default to false (will be enabled if set_proxy is called)
+    *
+    * @access   private
+    * @see      set_proxy()
+    * @var      boolean
+    */
+    var $_use_proxy_auth = false;
+
+    /**
+    * The time the Files will be cached (in seconds).
+    *
+    * @access private
+    * @var    int
+    */
+    var $_refresh = 60;   // int
+
+    /**
+    * The Name of the cached File.
+    *
+    * @access private
+    * @var    string
+    */
+    var $_cached_file = "";   // String
+
+    /**
+    * Indicates whether the cached or the remote file was used.
+    *
+    * @access private
+    * @var    boolean
+    */
+    var $_use_cached_file = true;
+
+    /**
+    * (fast|normal) depends on _use_dynamic_display(). _use_dynamic_display( TRUE ) -> 'normal', otherwise 'fast'
+    *
+    * @access private
+    * @var    string
+    */
+    var $_cache_type = "fast";
+
+    /**
+    * The Name of the Remote File.
+    *
+    * @access private
+    * @var    string
+    */
+    var $_remote_file = "";
+
+    /**
+    * Path to the Cache Directory.
+    *
+    * @access private
+    * @var    string
+    */
+    var $_cache_dir = "cache/";  // String
+
+    /**
+    * Indicates whether the Creating of the Cache Directory needs to be done or not.
+    *
+    * @access private
+    * @var    boolean
+    */
+    var $_cache_dir_ok = false;
+
+    /**
+    * Type of the file to be parsed (RSS or RDF).
+    *
+    * The Type depends on the root node
+    *
+    * @access private
+    * @var    string
+    */
+    var $_type = "rss"; // string (rss or rdf)
+
+    /**
+    * Array of Display Settings.
+    *
+    * Specific Parameters can be set to hidden. These are:
+    * image, channel and textinput. If set to "hidden" those elements won't be displayed.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_display_opt = array(
+               'build' => "",
+               'image' => "",
+               'channel' => "",
+               'textinput' => "",
+               'cache_update' => "",
+               'sitelink' => "",
+               'refid' => "",
+               'reflink' => "",
+    );
+
+    /**
+    * Defines the width attribute in the table that holds the rdf/rss representation
+    *
+    * @access private
+    * @var    int
+    * @see    see_table_width()
+    */
+    var $_table_width = "100%";
+
+    /**
+    * Indicates whether or not to use dynamic Display Settings
+    *
+    * @access private
+    * @var    array
+    */
+    var $_use_dynamic_display = false;
+
+    /**
+    * <item> count
+    *
+    * @access private
+    * @var    int
+    */
+    var $_item_count = 0;
+
+    /**
+    * No of max <item>s
+    *
+    * @access private
+    * @var    boolean
+    */
+    var $_max_count = false;
+
+    /**
+    * Array containing the content of <channel />
+    *
+    * @access private
+    * @var    array
+    */
+    var $_array_channel = array();
+
+    /**
+    * Array containing the content of each <item />
+    *
+    * @access private
+    * @var    array
+    */
+    var $_array_item = array();
+
+    /**
+    * Array containing the content of <textinput />
+    *
+    * @access private
+    * @var    array
+    */
+    var $_array_textinput = array();
+
+    /**
+    * Array containing the content of <image />
+    *
+    * @access private
+    * @var    array
+    */
+    var $_array_image = array();
+
+    /**
+    * Array containing the Channel content. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_citem = array();
+
+    /**
+    * Array containing the Channel Parser Depth. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_cdepth = array();
+
+    /**
+    * Array containing the Channel tags. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_ctags = array( "x" );
+
+    /**
+    * Array containing the Channel content. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_item = array();   // Array
+
+    /**
+    * Array containing the Channel Parser Depth. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_depth = array();  // Array
+
+    /**
+    * Array containing the tags. Just For internal XML Parser Purposes.
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tags = array( "x" );  // Array
+
+    /**
+    * Garbage collection: probability in percent
+    *
+    * @var      integer     0 => never
+    * @access   public
+    */
+    var $gc_probability = 1;
+
+    /**
+    * HTML Output
+    *
+    * @var      string
+    * @access   private
+    */
+    var $_output = "";
+
+    /**
+    * @var  string
+    */
+    var $_parse_mode = "";
+
+    // Output variable
+    var $out = "";
+
+    // Salt for hashing
+    var $salt = "";
+
+    /**
+    * Constructor of our Class
+    *
+    * This Method checks if the Cache Directory can be found. Otherwise it tries to creat the Cache Directory at the specified Path.
+    * Additionally the Refresh Time is set to a default Value of 1200s (20 min).
+       *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+       * @see           _refresh
+    */
+    function fase4_rdf()
+    {
+        // default Value, to be overwritten in set_refresh()
+        $this->_refresh = (time() - 1200);
+        $this->_clear_cItems();
+        $this->_clear_Items();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+    * @return    string Displays RDF Content ( using _display() )
+       * @see           _remote_file, cache()
+    */
+    function parse_RDF( $rdf )
+    {
+        unset($this->_array_item);
+        $this->_remote_file = $rdf;
+        $this->out .= "<!-- http://www.fase4.com/rdf/ -->";
+        $this->out .= "<table width=\"".$this->_table_width."\">";
+        $this->out .= $this->cache();
+        $this->out .= "</table>";
+        $this->_output = "";
+        $this->_item_count = 0;
+        return true;
+    }
+
+    /**
+    * This Method is called when all parsing is finished to use the garbage collection
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+    * @return    string Displays RDF Content ( using _display() )
+       * @see           _remote_file, cache()
+    */
+    function finish($return = false)
+    {
+               if (!$return) {
+                       echo $this->out;
+               } else {
+                       return $this->out;
+               }
+        flush();
+        $this->_garbage_collection();
+    }
+
+    /**
+    * With this method you can decide whether to use the normal cache and dynamic display Options or to use a static cache.
+    *
+    * In the first case the rdf/rss File will be stored locally, in the second case the html output of the specified source will be stored.
+    * In this case you can not modify the display settings.
+    * processing time: ( 1.4792) --> remote file
+    * processing time: ( 0.0313) --> using 'normal cache' with display Modification turned on.
+    * processing time: ( 0.0019) --> using 'fast cache'
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+    * @return    string Displays RDF Content ( using _display() )
+       * @see           _remote_file, cache()
+    */
+    function use_dynamic_display( $bool )
+    {
+        $this->_use_dynamic_display = $bool;
+        return true;
+    }
+
+    /**
+    * This Method avtually parses the XML data.
+    *
+    * @access    private
+    * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $data    RDF File XML Data
+    * @see       _clear_Items()
+    */
+    function _parse_xRDF( $data )
+    {
+        $this->_clear_Items();
+        $xml_parser = xml_parser_create();
+        xml_set_object($xml_parser,$this);
+        xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
+        xml_set_element_handler($xml_parser, "_startElement", "_endElement");
+        xml_set_character_data_handler($xml_parser, "_parseData");
+        if (!xml_parse($xml_parser, trim($data))) {
+                $this->_throw_exception(sprintf("XML error: %s at line %d",
+                xml_error_string(xml_get_error_code($xml_parser)),
+                xml_get_current_line_number($xml_parser))."<br /><br />Exception in function parse_RDF().");
+            }
+        xml_parser_free($xml_parser);
+    }
+
+
+    /**
+    * This Methods allows you to set the Refresh Time
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     int $seconds time files will be cached (in seconds).
+       * @return        boolean
+       * @see           _refresh
+    */
+    function set_refresh( $seconds )
+    {
+        $this->_refresh = (time() - $seconds);
+        return true;
+    }
+
+    function set_salt( $saltPara )
+    {
+        $this->salt = $saltPara;
+        return true;
+    }
+
+    /**
+    * This Methods allows you to set the No. of <item>s to display
+    *
+    * @access    public
+    * @param     int $int No of max <item>s
+       * @author    Stefan Saasen <s@fase4.com>
+       * @return        boolean
+       * @see           _max_count, _endElement()
+    */
+    function set_max_item( $int )
+    {
+        $this->_max_count = $int;
+        return true;
+    }
+
+    /**
+    * This Methods allows you to set the Cache Directory
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $dir Path to Directory.
+       * @return        boolean
+       * @see           _cache_dir
+    */
+    function set_CacheDir( $dir )
+    {
+        if(substr($dir, -1) != "/") {
+            $dir = $dir."/";
+        }
+        $this->_cache_dir = $dir;
+    }
+
+    /**
+    * This Method displays Error Messages and terminates the Execution of the Script
+    *
+    * @access    private
+    * @param     string $msg Message to display on failure
+       * @author    Stefan Saasen <s@fase4.com>
+    */
+    function _throw_exception( $msg )
+    {
+        $this->out .= "<div style=\"font-family: verdana, helvetica, arial, sans-serif;font-size:11px; color: #6699cc;margin-top:10px;margin-bottom:10px;\" align=\"center\">fase4 RDF Error: ".$msg."</div>";
+        return true;
+    }
+
+    /**
+    * This Method clears the Array containig the Items.
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @see       _item
+    */
+    function _clear_Items( ) {
+        $this->_item = array(
+            'title'=>"",
+            'link'=>"",
+            'description'=>"",
+            'url'=>"",
+            'language'=>"",
+            'pubDate'=>"",
+            'lastBuildDate'=>"",
+            'width'=>"",
+            'height'=>""
+        );
+    }
+    /**
+    * This Method clears the Array containig the Channel Items.
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @see       _item
+    */
+    function _clear_cItems( ) {
+        $this->_citem = array(
+            'title'=>"",
+            'link'=>"",
+            'description'=>"",
+            'url'=>"",
+            'language'=>"",
+            'copyright'=>"",
+            'managingEditor'=>"",
+            'webMaster'=>"",
+            'pubDate'=>"",
+            'lastBuildDate'=>"",
+            'category'=>"",
+            'generator'=>"",
+            'docs'=>"",
+            'cloud'=>"",
+            'ttl'=>"",
+            'image'=>"",
+            'textinput'=>"",
+            'skipHours'=>"",
+            'skipDays' =>"",
+            'sitelink'=>"",
+            'refid'=>"",
+            'reflink'=>"",
+        );
+    }
+
+    /**
+    * XML Parser Start Element Handler
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     mixed  $parser a reference to the XML parser calling the handler.
+    * @param     string $name contains the name of the element for which this handler is called.
+    * @param     string $attrs contains an associative array with the element's attributes (if any).
+       * @see           _get_ChannelData(), _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags
+    */
+    function _startElement($parser, $name, $attrs) {
+        // We have to determine, which type of xml data we have to parse
+        if($name == "rss") {
+            $this->_type = "rss";
+        } elseif($name == "rdf:RDF" OR $name == "rdf") {
+            $this->_type = "rdf";
+        }
+
+
+        if ( $name == "channel" AND $this->_type != "rdf" ) {
+            $this->_parse_mode = "channel";
+        } elseif ( ($name=="item")
+                    ||($name=="image")
+                    ||($name=="textinput")
+                    ||(($name=="channel") && ($this->_type != "rss")) ) {
+            if($this->_parse_mode=="channel") {
+                $this->_get_ChannelData( $parser );
+            }
+            $this->_parse_mode = "all";
+        }
+
+        if( !isset( $this->_depth[$this->get_parser_id($parser)] ) ) {
+            $this->_depth[$this->get_parser_id($parser)] = 0;
+        }
+        $this->_depth[$this->get_parser_id($parser)]++;
+        array_push($this->_tags, $name);
+
+        if( !isset( $this->_cdepth[$this->get_parser_id($parser)] ) ) {
+            $this->_cdepth[$this->get_parser_id($parser)] = 0;
+        }
+        $this->_cdepth[$this->get_parser_id($parser)]++;
+        array_push($this->_ctags, $name);
+    }   // END _startElement()
+
+    /**
+    * Retrives the Channel Data in <rss> File
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     mixed  $parser a reference to the XML parser calling the handler.
+       * @see           _output, _display_opt, _citem
+    */
+    function _get_ChannelData( $parser )
+    {
+                $this->_citem["link"] = trim($this->_citem["link"]);
+                        if (($this->_display_opt["sitelink"] == $this->_citem["link"]) && (!empty($this->_display_opt["reflink"])) && (!empty($this->_display_opt["refid"])))
+                {
+                    $this->_citem["link"] .= $this->_display_opt["reflink"].$this->_display_opt["refid"];
+                }
+
+                if( empty($this->_display_opt["channel"]) OR
+                    $this->_display_opt["channel"] != "hidden") {
+                $this->_output .= "<tr><td>\n";
+                $this->_output .= "<table border=\"0\" width=\"100%\" class=\"fase4_rdf_meta\" cellspacing=\"5\" cellpadding=\"2\">\n";
+                $this->_output .= "<tr><td class=\"fase4_rdf_main_title\"><div class=\"fase4_rdf_main_title\">".htmlspecialchars($this->_citem["title"])."</div></td></tr>\n";
+                $this->_output .= "<tr><td class=\"fase4_rdf\">".strip_tags($this->_citem["description"], "<a>, <img>")."</td></tr>\n";
+                $this->_output .= "<tr><td>&nbsp;</td></tr>\n";
+                $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
+                if(isset($this->_display_opt["build"]) && $this->_display_opt["build"] != "hidden") {
+                    if($this->_citem["lastBuildDate"]){$this->_output .= "build: ". $this->_citem["lastBuildDate"]."<br />";}
+                }
+                if(isset($this->_display_opt["cache_update"]) && $this->_display_opt["cache_update"] != "hidden" && ( $_update = $this->get_cache_update_time()) ) {
+                $this->_output .= "cache update: ".$_update."<br />\n";
+                }
+                $this->_output .= "<a href=\"".$this->_citem["link"]."\" ";
+                if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                $this->_output .= ">".$this->_cut_string($this->_citem["link"])."</a>";
+                $this->_output .= "</td></tr>\n";
+                $this->_output .= "<tr><td><hr noshade width=\"100%\" size=\"1\"></td></tr>\n";
+                $this->_output .= "</table></td></tr>";
+                }
+                    $this->_array_channel = array(  "title"=>$this->_citem["title"],
+                                                    "link"=>$this->_citem["link"],
+                                                    "description"=>$this->_citem["description"],
+                                                    "lastBuildDate"=>$this->_citem["lastBuildDate"]);
+    }
+
+    /**
+    * XML Parser End Element Handler
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     mixed  $parser a reference to the XML parser calling the handler.
+    * @param     string $name contains the name of the element for which this handler is called.
+       * @see           _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags, _item, _output, _display_opt
+    */
+    function _endElement($parser, $name) {
+        array_pop($this->_tags);
+        $this->_depth[$this->get_parser_id($parser)]--;
+        array_pop($this->_ctags);
+        $this->_cdepth[$this->get_parser_id($parser)]--;
+        $this->_item["link"] = trim($this->_item["link"]);
+          if ((!empty($this->_display_opt["refid"])) && (!empty($this->_item["link"])))
+          {
+            if (!ereg("refid=", $this->_item["link"])) $this->_item["link"] .= "?refid=" . $this->_display_opt["refid"];
+          }
+        switch ($name) {
+            case "item":
+                if(empty($this->_max_count) OR $this->_item_count < $this->_max_count) {
+                    if($this->_item["title"] != $this->_item["description"]
+                                            AND $this->_item["description"]) {
+
+                        // word-wrapping added by Roland Haeder <webmaster@mxchange.org>
+                          if (($this->_word_wrap > 0) && (strlen($this->_item["description"]) > $this->_word_wrap))
+                        {
+                            // Switch off _use_nl2br
+                            $this->_use_nl2br = false;
+                            // First remove all \n
+                            $this->_item["description"] = str_replace('\n', ' ', $this->_item["description"]);
+                            // Wrap with <br />\n
+                            $this->_item["description"] = wordwrap($this->_item["description"], $this->_word_wrap, "*<br>\n");
+                        }
+                         elseif (($this->_word_wrap == 0) && (!$this->_use_nl2br))
+                        {
+                            // Strip tags out instead when word-wrap is disabled
+                            $this->_item["description"] = strip_tags($this->_item["description"], "<a>, <img>");
+                        }
+
+                        // nl2br added by Roland Haeder <webmaster@mxchange.org>
+                        if ($this->_use_nl2br) $this->_item["description"] = nl2br($this->_item["description"]);
+
+                        $this->_output .= "<tr><td class=\"fase4_rdf_title\"><div class=\"fase4_rdf_title\"><a class=\"fase4_rdf_title\" href=\"".$this->_item["link"]."\" ";
+                        if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                        $this->_output .= ">".strip_tags($this->_item["title"], "<a>, <img>")."</a> (".$this->_item["pubDate"].")</div></td></tr>\n";
+                                       $this->_output .= "<tr><td class=\"fase4_rdf\">".$this->_item["description"]."</td></tr>\n";
+                        // we just display the <hr> if there is a description
+                        $this->_output .= "<tr><td><hr noshade=\"noshade\" size=\"1\" /></td></tr>\n";
+                    } else {
+                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
+                        $this->_output .= "<a href=\"".$this->_item["link"]."\" ";
+                        if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                        $this->_output .= ">".$this->_item["title"]."</a></td></tr>\n";
+                    }
+                        $this->_array_item[] = array(   "title"=>$this->_item["title"],
+                                                        "link"=>$this->_item["link"],
+                                                        "description"=>$this->_item["description"]);
+                        ++$this->_item_count;
+                }
+                    $this->_clear_Items();
+            break;
+            case "image":
+                if(isset($this->_display_opt["image"]) && ($this->_display_opt["image"] != "hidden") && $this->_item["url"]) {
+                    $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
+                    $this->_output .= "<a href=\"".$this->_item["link"]."\" ";
+                    if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                    $this->_output .= "><img src=\"".$this->_item["url"]."\"";
+                if(isset($this->_item["width"]) && isset($this->_item["height"])) {
+                    $this->_output .= " width=\"".$this->_item["width"]."\" height=\"".$this->_item["height"]."\"";
+                }
+                $this->_output .= " alt=\"".$this->_item["title"]."\" border=\"0\" /></a></td></tr>\n";
+
+                    $this->_array_image[] = array(  "url"=>$this->_item["url"],
+                                                    "link"=>$this->_item["link"],
+                                                    "width"=>$this->_item["width"],
+                                                    "height"=>$this->_item["height"]);
+                    $this->_clear_Items();
+                } elseif( isset($this->_display_opt["image"] ) && ($this->_display_opt["image"] == "hidden") ) {
+                    $this->_clear_Items();
+                }
+
+            break;
+            case "channel":
+                if(isset($this->_display_opt["channel"]) AND $this->_display_opt["channel"] != "hidden" AND $this->_item["title"] != '') {
+                    $this->_output .= "<tr><td>\n";
+                    $this->_output .= '<table border="0" width="100%" class="fase4_rdf_meta" cellspacing="5" cellpadding="2">'."\n";
+                    $this->_output .= "<tr><td class=\"fase4_rdf\"><div class=\"fase4_rdf_title\">".htmlspecialchars($this->_item["title"])."</div></td></tr>\n";
+                    $this->_output .= "<tr><td class=\"fase4_rdf\">".strip_tags($this->_item["description"], "<a>, <img>")."</td></tr>\n";
+                    $this->_output .= "<tr><td>&nbsp;</td></tr>\n";
+                    $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
+                if($this->_display_opt["build"] != "hidden") {
+                    if($this->_item["lastBuildDate"]){$this->_output .= "build: ". $this->_item["lastBuildDate"]."<br />";}
+                }
+                if($this->_display_opt["cache_update"] != "hidden" && ( $_update = $this->get_cache_update_time()) ) {
+                    $this->_output .= "cache update: ".$_update."<br />\n";
+                }
+                $this->_output .= "<a href=\"".$this->_item["link"]."\" ";
+                if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                $this->_output .= ">".$this->_cut_string($this->_item["link"])."</a>\n";
+                $this->_output .= "</td></tr>\n";
+                $this->_output .= "</table></td></tr>\n";
+                }
+                    $this->_array_channel = array(  "title"=>$this->_item["title"],
+                                                    "link"=>$this->_item["link"],
+                                                    "description"=>$this->_item["description"],
+                                                    "lastBuildDate"=>$this->_item["lastBuildDate"]);
+                    $this->_clear_Items();
+                    $this->_clear_cItems();
+            break;
+                       case "textinput":
+                if(isset($this->_display_opt["textinput"]) && ($this->_display_opt["textinput"] != "hidden") && $this->_item["name"] && $this->_item["link"]) {
+                    $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
+                               $this->_output .= "<form action=\"".$this->_item["link"]."\" ";
+                    if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                    $this->_output .= "method=\"get\">\n";
+                    $this->_output .= "<div class=\"fase4_rdf_title\">".$this->_item["title"]."</div>";
+                    $this->_output .= strip_tags($this->_item["description"], "<a>, <img>")."<br><br>\n";
+                    $this->_output .= "<input class=\"fase4_rdf_input\" type=\"text\" name=\"".$this->_item["name"]."\">&nbsp;\n";
+                    $this->_output .= "<input class=\"fase4_rdf_input\" type=\"submit\" value=\"go\">";
+                    $this->_output .= "</form>\n";
+                    $this->_output .= "</td></tr>\n";
+                    $this->_array_textinput = array(    "title"=>$this->_item["title"],
+                                                        "name"=>$this->_item["name"],
+                                                        "link"=>$this->_item["link"],
+                                                        "description"=>$this->_item["description"]);
+                    $this->_clear_Items();
+                } elseif( isset($this->_display_opt["textinput"]) && ($this->_display_opt["textinput"] == "hidden") ) {
+                    $this->_clear_Items();
+                }
+
+                       break;
+        }
+    }
+
+    /**
+    * This Method returns the data from the <channel /> paragraph.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array
+       * @see           _array_channel
+    */
+    function get_array_channel( )
+    {
+        return $this->_array_channel;
+    }
+
+    /**
+    * This Method returns the data from each <item /> paragraph.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array
+       * @see           _array_item
+    */
+    function get_array_item( )
+    {
+        return $this->_array_item;
+    }
+
+    /**
+    * This Method returns the data from <textinput />.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array
+       * @see           _array_textinput
+    */
+    function get_array_textinput( )
+    {
+        return $this->_array_textinput;
+    }
+
+       /**
+       * Getter for parser id from resource
+       *
+       * @access private
+       * @author       Roland Haeder <webmaster@mxchange.org>
+       * @return       int
+       */
+       function get_parser_id ($parser) {
+               // Default is zero
+               $id = 0;
+
+               // Is it a resource?
+               if (is_resource($parser)) {
+                       // Cast the resource into id
+                       $id = (int) $parser;
+               } // END - if
+
+               // Return the id
+               return $id;
+       }
+
+    /**
+    * This Method returns the data from <image />.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array
+       * @see           _array_image
+    */
+    function get_array_image( )
+    {
+        return $this->_array_image;
+    }
+
+    /**
+    * XML Parser Data Handler
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     mixed  $parser a reference to the XML parser calling the handler.
+    * @param     string $text contains the character data as a string.
+       * @see           _parse_mode, _item, _tags, _depth, _citem, _ctags, _cdepth
+    */
+    function _parseData($parser, $text)
+    {
+        // Deocing mode added by Roland Haeder <webmaster@mxchange.org>
+        switch ($this->_decoding_mode)
+        {
+        case "utf8_decode":
+            $text = utf8_decode($text);
+            break;
+
+        case "htmlentities":
+            $text = htmlentities($text);
+            break;
+        }
+
+        $clean = preg_replace("/\s/", "", $text);
+        if ($clean) {
+            $text = preg_replace("/^\s+/", "", $text)."\n";
+                if($this->_parse_mode == "all") {
+                        if ( isset($this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]]) &&
+                            $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] ) {
+                           $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] .= $text;
+                        } else {
+                           $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] = $text;
+                        }
+                } elseif (isset($this->_parse_mode) && $this->_parse_mode == "channel") {
+                        if ( isset($this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]]) ) {
+                           $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] .= $text;
+                        } else {
+                           $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] = $text;
+                        }
+                }
+        }
+    }
+
+    /**
+    * This Method allows you to choose if specific Parameters are displayed or not. These are:
+    * image, channel, textinput, build and cache_update. If set to "hidden" those elements won't be displayed.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     array  $options
+       * @see           _display_opt
+    */
+    function set_Options( $options = "" )
+    {
+        if(is_array( $options )) {
+            $this->_display_opt = $options;
+            return true;
+        } else {
+            unset($this->_display_opt);
+            return false;
+        }
+    }
+
+    /**
+    * This Method allows you to define the width of the table that holds the representation of the rdf/rss file.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     int  $width  attribute width in tag <table>
+       * @see           _table_width
+    */
+    function set_table_width( $width = 400 )
+    {
+        $this->_table_width = $width;
+        return true;
+    }
+
+    /**
+    * This Method returns an assocative Array with available Options.
+    *
+    * The Keys are the Name of the Options to be set.
+    * The Values are  short Description of available Options.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array  $options
+       * @see           _display_opt
+    */
+    function get_Options()
+    {
+        $options = array(   "image"=>"If 'image' is set to \"hidden\" no image provided by the RDF Publisher will be displayed.",
+                            "channel"=>"If 'channel' is set to \"hidden\" the Channel Meta Data (i.e the Title and the short description regarding the RDF Publisher will not be displayed",
+                            "textinput"=>"If set to \"hidden\" no Input Form will be displayed",
+                            "build"=>"If set to \"hidden\" the Build Date (if provided) of the RDF File will not be displayed",
+                            "cache_update"=>"If set to \"hidden\" the Update Date/Time of the cached Rdf File will not be displayed");
+        return $options;
+    }
+
+    /**
+    * This Method returns the Content of the RDF File in one string. The String actually holds the whole XML Document.
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+    * @return    string XML Presentation of parsed RDF File
+       * @see           _cached_file, _remote_file, _cache_dir, _refresh, _update_cache()
+    */
+    function cache()
+    {
+        // checks if the cache directory already exists
+        // if not, the cache directory will be created
+        if(!$this->_cache_dir_ok) {
+            $this->_create_cache_dir();
+        }
+        if($this->_use_dynamic_display == true) {
+            $this->_cached_file = md5("dynamic".$this->salt.$this->_remote_file);
+            $this->_cache_type = "normal";
+        } else {
+            $this->_cached_file = md5($this->salt.$this->_remote_file);
+            $this->_cache_type = "fast";
+        }
+
+        $_cache_f = $this->_cache_dir.$this->_cached_file;
+
+        if ( (!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == 0)) {
+        // We have to parse the remote file
+        $this->_use_cached_file = false;
+            // --> we want to provide proper Information for Use in
+            // get_cache_update_time()
+            clearstatcache();
+            if($this->_use_dynamic_display == true) {
+                $_rdf = @implode(" ", $this->_rdf_data()); // -> proxy
+                if(!$_rdf) {
+                    $this->_throw_exception( $this->_remote_file." is not available" );
+                }
+                $this->_parse_xRDF( $_rdf );
+                $this->_update_cache( $_rdf );
+                $data = $this->_output;
+            } else {
+                $_rdf = @implode(" ", $this->_rdf_data()); // -> proxy
+                if(!$_rdf) {
+                    $this->_throw_exception( $this->_remote_file." is not available" );
+                }
+                $this->_parse_xRDF( $_rdf );
+                $this->_update_cache( $this->_output );
+                $data = $this->_output;
+            }
+        } else {
+        // we can use the cached file
+        $this->_use_cached_file = true;
+            if($this->_use_dynamic_display == true) {
+                $this->_parse_xRDF( implode(" ", file($_cache_f)) );
+                $data = $this->_output;
+            } else {
+                $data = @implode(" ", file($_cache_f));
+            }
+        }
+        return trim($data);
+    }   // END cache()
+
+    /**
+    * This Methods creates the Cache Directory if the specified Directory does not exist.
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $dir Path to Directory.
+       * @return        boolean
+       * @see           _cache_dir, _cache_dir_ok
+    */
+    function _create_cache_dir()
+    {
+        $path = "";
+        if(!@is_dir($this->_cache_dir)) {
+            $arr = explode("/", $this->_cache_dir);
+            $c = count($arr);
+            if($arr[0]=="") {
+                $path = "/";
+            }
+            for($i = 0;$i<$c;$i++)
+            {
+                if($arr[$i]!="") {
+                    $path .= $arr[$i]."/";
+                    if(!@is_dir($path)) {
+                       if(!@mkdir($path, 0777)) {
+                            $this->_throw_exception("failed to create directory:<b>".$this->_cache_dir."</b>.<br /><br />Exception on Line: ".__LINE__);
+                        return false;
+                        }
+                    }
+                }
+            }
+            $this->_cache_dir_ok = true;
+            return true;
+        } else {
+            $this->_cache_dir_ok = true;
+            return true;
+        }
+    }   // END _create_cache_dir()
+
+    /**
+    * This Method updates the cached RDF Files and synchronises them with their remote Counterparts.
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+       * @see           _cache_dir, _cached_file, _throw_exception()
+    */
+    function _update_cache( $content = "" )
+    {
+             $_local = @fopen( $this->_cache_dir.$this->_cached_file, 'w' );
+             if(!$_local) {
+                $this->_throw_exception( "Cannot open ".$this->_cached_file."<br /><br />Exception at Line: ".__LINE__ );
+                return false;
+             }
+             if (fwrite( $_local, $content) === false) {
+                       $this->_throw_exception( "Cannot write to ".$this->_cached_file."<br /<br />Exeception at Line: ".__LINE__);
+                       return false;
+                  }
+             fclose( $_local );
+                  @chmod( $this->_cache_dir.$this->_cached_file, 0666);
+             return true;
+    }   // END _update_cache()
+
+    /**
+    * This Method returns the Date/Time of last Cache Update of the actually parsed RDF File.
+       *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+       * @return        string Date/Time of last Update
+       * @see           _cache_dir, _cached_file
+    */
+    function get_cache_update_time()
+    {
+            return (file_exists($this->_cache_dir.$this->_cached_file))?date("d.m.Y H:i:s", filemtime($this->_cache_dir.$this->_cached_file)):"Cachemiss";
+    }   // END get_cache_update_time()
+
+    /**
+    * This Method returns the Type of Cache that was used ('normal' or 'fast')
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @param     string $rdf    RDF File (Location)
+    * @return    string Displays RDF Content ( using _display() )
+       * @see           _remote_file, cache()
+    */
+    function get_CacheType()
+    {
+        return $this->_cache_type;
+    }
+
+    /**
+    * Returns true if cached file was used, otherwise false
+    *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+    * @return    array  $options
+       * @see           _use_cached_file
+    */
+    function is_cachedFile()
+    {
+        return $this->_use_cached_file;
+    }
+
+    /**
+    * This Method deletes all the cached Files.
+    *
+    * Please keep in mind to use this method just as a 'manual garbage collection'
+    * You should cache the rss/rdf files locally to avoid unnecessary traffic.
+    * (Both for your visitors and the Publisher)
+       *
+    * @access    public
+       * @author    Stefan Saasen <s@fase4.com>
+       * @see           _cache_dir
+    */
+    function clear_cache()
+    {
+        $dir = dir($this->_cache_dir);
+        while($file=$dir->read()) {
+            // Exclude directories
+            if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && substr($file, -4, 4) != ".log")  {
+                if(!@unlink($dir->path.$file)) {
+                    $this->_throw_exception("Unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__ );
+                    return false;
+                } // END - if
+            } // END - if
+        } // END - while
+        $dir->close();
+        return true;
+    }   // END clear_cache()
+
+    /**
+    * Cuts the String $string after $str_len and adds "... "
+    *
+    * @access   private
+    * @param    string  $string String to be shortened
+    * @param    int     $str_len length of the returned String (overall length including "... ")
+    * @return   string  Cut String
+    */
+    function _cut_string( $string, $str_len = "30" )
+    {
+        if(strlen(trim($string))>$str_len) {
+            $string = substr( trim($string) , 0, $str_len - 4);
+            $string .= " ...";
+        }
+        return $string;
+    }   // END _cut_string()
+
+    /**
+    * this Method implements simple Garbage Collection
+    *
+    * @access    private
+       * @author    Stefan Saasen <s@fase4.com>
+       * @see           _cache_dir, gc_probability, gc_maxlifetime
+    */
+    function _garbage_collection()
+    {
+        srand((double) microtime() * 1000000);
+        if (rand(1, 100) <= $this->gc_probability) {
+            $dir = dir($this->_cache_dir);
+            while($file=$dir->read()) {
+                if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && substr($file, -4, 4) != ".log" && filemtime($dir->path.$file) <= time() - $this->_refresh )  {
+                    @unlink($dir->path.$file);
+                } // END - if
+        }
+        $dir->close();
+        }   // END if
+    }
+
+    /* ==== Proxy/Auth methods ==== */
+
+   /**
+    * this method sets a proxy server
+    *
+    * @access    public
+    * @param     string $phost Proxy Host
+    * @param     string $pport Prox Port
+    * @author    Marco Kraus <marco.kraus@siemens.com>
+    */
+    function set_proxy($phost, $pport)
+    {
+     $this->_use_proxy = true;
+
+     if ($phost != '')
+        $this->_phost = $phost;
+
+     if ($pport != '')
+        $this->_pport = $pport;
+    }
+
+    /**
+    * this method sets a proxy server authentification
+    *
+    * @access    public
+    * @param     string $pname Username
+    * @param     string $ppaswd Password
+    * @author    Marco Kraus <marco.kraus@siemens.com>
+    */
+    function set_proxy_auth( $pname, $ppasswd )
+    {
+     $this->_use_proxy_auth = true;
+
+     if ($pname != '')
+        $this->_pname = $pname;
+
+     if ($ppasswd != '')
+        $this->_ppasswd = $ppasswd;
+    }
+
+
+   /**
+    * gets _remote_file into an array
+    *
+    * needed, cause if you use a proxy, you have to open
+    * a raw-tcp-socket to get the data
+    *
+    * @access    private
+    * @author    Marco Kraus <Marco.Kraus@siemens.com>
+    * @return array
+    * @see _use_proxy, cache()
+    */
+    function _rdf_data()
+    {
+      if ( $this->_use_proxy == true )
+      {
+       // we need a raw socket here to connect to proxy
+       $fp = fsockopen($this->_phost,$this->_pport);
+
+       if (!$fp) {
+           $this->_throw_exception( $this->_remote_file." is not available with proxy" );
+       } else {
+        if ( $this->_use_proxy_auth == true ) {
+             fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n");
+           } else {
+             fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\nProxy-Authorization: Basic ".base64_encode("$this->_pname:$this->_ppasswd") ."\r\n\r\n");
+           }
+        }
+
+
+       for ( $i = 0; !feof ($fp) ; $i++)
+       {
+          $usable_data[$i] = "";
+          $usable_data[$i] = fgets($fp,4096);
+
+        // PARSE HEADER ---- first line has to be <?xml, second rdf or rss, and third is blank
+
+        // strstr did not fit (ask Rasmus why), so we compare each character
+            if ( ($usable_data[$i][0] == "<" ) &&
+               ($usable_data[$i][1] == "?" ) &&
+               ($usable_data[$i][2] == "x" ) &&
+               ($usable_data[$i][3] == "m" ) &&
+               ($usable_data[$i][4] == "l" ) ) {
+                    $usable_data[0] = $usable_data[$i]; // save current field
+                      $i = 1; // just reset array to start
+              }
+
+        // there seems to be proxystuff after the <?xml....we delete this
+            if ( (
+               ($usable_data[$i][0] == "<" ) &&
+               ($usable_data[$i][1] == "r" ) &&
+               ($usable_data[$i][2] == "d" ) &&
+               ($usable_data[$i][3] == "f" ) &&
+               ($usable_data[$i][4] == ":" )
+               )
+               ||
+               (
+               ($usable_data[$i][0] == "<" ) &&
+               ($usable_data[$i][1] == "r" ) &&
+               ($usable_data[$i][2] == "s" ) &&
+               ($usable_data[$i][3] == "s" )
+               )
+            ) {
+
+                $usable_data[1] = $usable_data[$i]; // save current field
+                $usable_data[2] = "\n";
+                $i = 2; // just reset array to start
+          }
+       }
+
+       fclose($fp);
+       return $usable_data;
+     } else {
+               if (substr($this->_remote_file, 0, 7) != "http://") {
+                       $this->_throw_exception( "Cannot find http:// in ".$this->_remote_file."!" );
+                       return "";
+               } else {
+                       // Extract host information
+                       $host = substr($this->_remote_file, 7);
+                       // Extract the GET part
+                       $get = "/";
+                       if (strpos($host, "/") > 0) {
+                               $get = substr($host, strpos($host, "/"));
+                               $host = substr($host, 0, strpos($host, "/"));
+                       }
+                       // Extract port
+                       $port = "80";
+                       if (strpos($host, ":") > 0) {
+                               $port = substr($host, (strpos($host, ":") + 1));
+                               $host = substr($host, 0, (strpos($host, ":") - 1));
+                       }
+
+                       // Start connection to server
+                       $fp = fsockopen($host, $port);
+                       if (!$fp) {
+                   $this->_throw_exception( $this->_remote_file." is maybe not available." );
+                         return "";
+                       }
+                       // Repare request line
+                       $request = sprintf("GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n", $get, $host);
+                       // Send request out
+                       fputs($fp, $request);
+                       $reply = ""; $isContent = false; $dummy = "";
+                       // Read reply
+                       $i=0;
+                       while ( !feof($fp) ) {
+                               $read = trim(fgets($fp, 4096));
+                               if (substr($read, 0, 5) == "<?xml" || $isContent) {
+                                       // Add content
+                                       $reply[] = $read;
+                                       $isContent = true;
+                               } else {
+                                       // Put in dummy
+                                       $dummy[] = $read;
+                               }
+                               $i++;
+                       }
+                       if ((count($dummy) > 0) && (count($reply) == 0) && (!$isContent)) {
+                               // Transfer content from dummy
+                               $reply = $content;
+                       }
+                       fclose($fp);
+                       //die(htmlentities($reply));
+                       return $reply;
+               }
+     }
+   }    // END _rdf_data()
+}   // END class
+?>
diff --git a/inc/reset/.htaccess b/inc/reset/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/reset/reset_ b/inc/reset/reset_
new file mode 100644 (file)
index 0000000..fa3bff0
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/27/2004 *
+ * ===============                              Last change: 12/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_                                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Things to be done on daily reset                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif (!EXT_IS_ACTIVE("")) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+//
+?>
diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php
new file mode 100644 (file)
index 0000000..ddad449
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/22/2005 *
+ * ===============                              Last change: 10/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_beg.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Reset begging points                             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Erbettelten Punkte zuruecksetzen                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
+
+// Reset accounts
+$result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=0.00000 WHERE beg_points > 0",
+ __FILE__, __LINE__);
+
+//
+?>
diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php
new file mode 100644 (file)
index 0000000..d0a57bf
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/22/2005 *
+ * ===============                              Last change: 10/22/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_bonus.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Reset bonus points                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Bonus-Punkte zuruecksetzen                       *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+// Reset accounts
+$result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0",
+ __FILE__, __LINE__);
+
+//
+?>
diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php
new file mode 100644 (file)
index 0000000..c763c0e
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 04/20/2004 *
+ * ===============                              Last change: 01/07/2006 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_daily.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Things to do on daily reset                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Update user profiles
+if (GET_EXT_VERSION("order") >= "0.1.1") {
+       // Latest version
+       $result_daily = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET receive_mails=max_mails, mail_orders=0 WHERE receive_mails != max_mails", __FILE__, __LINE__);
+} else {
+       // Obsolete version
+       $result_daily = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET receive_mails=max_mails WHERE receive_mails != max_mails", __FILE__, __LINE__);
+}
+
+// Transfer points from locked_points to points
+$result_daily = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE ref_payout=0 AND status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result_daily) > 0)
+{
+       // Start checking accounts which are on 0 confirmed-to-go mails
+       while (list($uid) = SQL_FETCHROW($result_daily))
+       {
+               $result_points = SQL_QUERY_ESC("SELECT ref_depth, locked_points FROM "._MYSQL_PREFIX."_user_points
+WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth",
+                array(bigintval($uid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result_points) > 0)
+               {
+                       // Ok transfer points
+                       while (list($dep, $locked) = SQL_FETCHROW($result_points))
+                       {
+                               $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s, locked_points=0.00000
+WHERE userid=%s AND ref_depth=%d LIMIT 1",
+                                array($locked, bigintval($uid), $dep), __FILE__, __LINE__);
+
+                               // Update mediadata as well
+                               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
+                               {
+                                       // Update database
+                                       MEDIA_UPDATE_ENTRY(array("total_points"), "add", $locked);
+                               }
+                       }
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_points);
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result_daily);
+
+// Save config value for later references
+$_CONFIG['last_update'] = time();
+
+// Update database
+UPDATE_CONFIG("last_update", time());
+
+//
+?>
diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php
new file mode 100644 (file)
index 0000000..9688395
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/27/2004 *
+ * ===============                              Last change: 12/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_engine.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Things for the engine on daily reset             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("engine")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "engine");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+//
+?>
diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php
new file mode 100644 (file)
index 0000000..5d59985
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/10/2005 *
+ * ===============                              Last change: 12/10/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_holiday.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Things to be done on daily reset                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday");
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || ((!defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
+
+// Check for holidays we need to enable and send email to user
+$result_main = SQL_QUERY("SELECT userid, holiday_activated FROM "._MYSQL_PREFIX."_user_data
+WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND holiday_active='N'
+ORDER BY holiday_activated", __FILE__, __LINE__);
+if (SQL_NUMROWS($result_main) > 0) {
+       // We have found at least one useraccount so let's check it...
+       while(list($uid, $activated) = SQL_FETCHROW($result_main)) {
+               // Check if his holiday can be activated
+               $result_holiday = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM "._MYSQL_PREFIX."_user_holidays
+WHERE userid=%s AND holiday_start <= UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1",
+ array(bigintval($uid)), __FILE__, __LINE__);
+               if (SQL_NUMROWS($result_holiday) == 1)
+               {
+                       // Okay, this user can be send away to holiday...
+                       list($start, $end) = SQL_FETCHROW($result_holiday);
+
+                       // Prepare all data for the template
+                       $content = array(
+                               'activated' => MAKE_DATETIME($activated, "1"),
+                               'start'     => MAKE_DATETIME($start    , "1"),
+                               'end'       => MAKE_DATETIME($end      , "1")
+                       );
+
+                       // Send email to user
+                       $msg = LOAD_EMAIL_TEMPLATE("member_holiday_activated", $content, $uid);
+                       SEND_EMAIL($uid, HOLIDAY_MEMBER_ACTIVATED, $msg);
+
+                       // Update account
+                       $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET holiday_active='Y'
+WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
+               }
+
+               // Free memory
+               SQL_FREERESULT($result_holiday);
+       }
+}
+
+// Free memory
+SQL_FREERESULT($result_main);
+
+// Stop currently activated holidays
+HOLIDAY_STOP_HOLIDAYS();
+
+//
+?>
diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php
new file mode 100644 (file)
index 0000000..9c9f0a1
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : reset_surfbar.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Things to be done on daily reset                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Dinge, die beim taeglichen Reset erledigt werden *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (defined('__DAILY_RESET'))) return;
+
+// Reset surfbar counter
+UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter`"), array(0, $_CONFIG['surfbar_daily_counter']));
+$_CONFIG['surfbar_yester_counter'] = $_CONFIG['surfbar_daily_counter'];
+$_CONFIG['surfbar_daily_counter'] = 0;
+
+//
+?>
diff --git a/inc/security.php b/inc/security.php
new file mode 100644 (file)
index 0000000..ecbad40
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/05/2003 *
+ * ===============                              Last change: 11/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : security.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : Access denied!                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Zugriff verweigert!                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+/*
+print "<pre>";
+debug_print_backtrace();
+die("</pre>");
+*/
+echo "<HTML>
+<HEAD>
+<TITLE>Protected file ".basename($_SERVER['PHP_SELF'])." - ACCESS DENIED!</TITLE>
+</HEAD>
+<BODY bgcolor=\"#880000\" text=\"#FFFFFF\">
+<DIV align=\"center\">
+<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
+<TR>
+  <TD align=\"center\"><U><STRONG><BIG><BIG>A&nbsp;C&nbsp;C&nbsp;E&nbsp;S&nbsp;S&nbsp;&nbsp;&nbsp;D&nbsp;E&nbsp;N&nbsp;I&nbsp;E&nbsp;D&nbsp;!</BIG></BIG></STRONG></U></TD>
+</TR>
+<TR><TD height=\"10\"></TD></TR>
+<TR>
+  <TD align=\"center\">
+    You have tried to open a protected file! Your access has been logged in the server's logfile with your IP number:
+  </TD>
+</TR>
+<TR><TD height=\"10\"></TD></TR>
+<TR>
+  <TD align=\"center\">
+    <STRONG>".GET_REMOTE_ADDR()."</STRONG>
+  </TD>
+</TR>
+</TABLE>
+</DIV>
+</BODY>
+</HTML>\n";
+exit();
+//
+?>
diff --git a/inc/session.php b/inc/session.php
new file mode 100644 (file)
index 0000000..d3fee58
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/16/2004 *
+ * ===============                              Last change: 11/23/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : session.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Session management                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Sitzungs-Management                              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check if view.php nor click.php was called
+// If not set variables to default
+if (empty($CLICK)) $CLICK = 0;
+if (empty($VIEW))  $VIEW  = 0;
+
+// Skip updating of cookies when viewing a banner
+if (($VIEW == 1) && ($_SERVER['PHP_SELF'])) return;
+
+// Set session save path if set
+if (!empty($_CONFIG['session_save_path'])) {
+       // Please make sure this valid!
+       @session_save_path($_CONFIG['session_save_path']);
+} // END - if
+
+// Start the session
+@session_start();
+global $PHPSESSID;
+$PHPSESSID = @session_id();
+
+// Load extensions here
+require_once(PATH."inc/load_extensions.php");
+
+// Load language system
+require_once(PATH."inc/language.php");
+
+// Check if refid is set
+if ((!empty($_GET['user'])) && ($CLICK == 1) && (basename($_SERVER['PHP_SELF']) == "click.php")) {
+       // The variable user comes from the click-counter script click.php and we only accept this here
+       $GLOBALS['refid'] = bigintval($_GET['user']);
+} elseif (!empty($_POST['refid'])) {
+       // Get referral id from variable refid (so I hope this makes my script more compatible to other scripts)
+       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_POST['refid']));
+} elseif (!empty($_GET['refid'])) {
+       // Get referral id from variable refid (so I hope this makes my script more compatible to other scripts)
+       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['refid']));
+} elseif (!empty($_GET['ref'])) {
+       // Set refid=ref (the referral link uses such variable)
+       $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
+} elseif (isSessionVariableSet('refid')) {
+       // Set session refid als global
+       $GLOBALS['refid'] = bigintval(get_session('refid'));
+} elseif (GET_EXT_VERSION("sql_patches") != "") {
+       // Set default refid as refid in URL
+       $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']);
+} else {
+       // No default ID when sql_patches is not installed
+       $GLOBALS['refid'] = 0;
+}
+
+// Set cookie when default refid > 0
+if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && ($_CONFIG['def_refid'] > 0))) {
+       // Set cookie
+       set_session('refid', $GLOBALS['refid']);
+} // END - if
+
+// Transfer userid from session and validate it
+if (isset($_SESSION['userid'])) {
+       // Get it secured from session
+       $GLOBALS['userid'] = bigintval($_SESSION['userid']);
+
+       // Is it valid?
+       if (!IS_MEMBER()) {
+               // Then destroy the user id
+               destroy_user_session();
+
+               // Kill userid
+               $GLOBALS['userid'] = 0;
+       } // END - if
+} // END - if
+
+// Test session if index.php or modules.php is loaded
+if ((basename($_SERVER['PHP_SELF']) == "index.php") || (basename($_SERVER['PHP_SELF']) == "modules.php") || (isBooleanConstantAndTrue('mxchange_installing'))) {
+       if (count($_SESSION) > 0) {
+               // Session variables accepted!
+               define('__COOKIES', true);
+       } else {
+               // Cookies rejected!
+               define('__COOKIES', false);
+       }
+} // END - if
+
+//* DEBUG: */ print("<pre>".print_r($_SESSION, true)."</pre>");
+
+//
+?>
diff --git a/inc/sql_error.php b/inc/sql_error.php
new file mode 100644 (file)
index 0000000..c6597e5
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/25/2003 *
+ * ===============                              Last change: 10/15/2003 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : sql_error.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Outputs sql errors                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gibt MySQL-Fehler aus                            *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+//
+?>
diff --git a/inc/stats_bonus.php b/inc/stats_bonus.php
new file mode 100644 (file)
index 0000000..2ad4a0c
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 03/18/2005 *
+ * ===============                              Last change: 03/18/2005 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : stats_bonus.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Check for 100% clickrate order                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Nach Mailbestaetigungen mit 100% Klickrate s.    *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY'))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Check for 100% klickrate mails
+$result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url
+FROM "._MYSQL_PREFIX."_user_stats
+WHERE max_rec=clicks AND clicks>0 AND bonus_stats='N'
+ORDER BY userid", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result_bonus) > 0) {
+       // Remember stats bonus in constant
+       define('__STATS_BONUS', TRANSLATE_COMMA($_CONFIG['bonus_stats']));
+
+       // We found some mail orders...
+       while(list($id, $uid, $subj, $stamp, $clicks, $url) = SQL_FETCHROW($result_bonus)) {
+               // Add points
+               $result_points = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1",
+                array($_CONFIG['bonus_stats'], bigintval($uid)), __FILE__, __LINE__);
+
+               // Prepare array
+               $content = array(
+                       'subject'   => $subj,
+                       'timestamp' => MAKE_DATETIME($stamp, "2"),
+                       'clicks'    => $clicks,
+                       'url'       => $url
+               );
+
+               // Load email template and send email
+               $msg = LOAD_EMAIL_TEMPLATE("member_stats_bonus", $content, bigintval($uid));
+               SEND_EMAIL($uid, BONUS_MEMBER_STATS_SUBJECT, $msg);
+
+               // Update database
+               $result_update =  SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET bonus_stats='Y' WHERE id=%s LIMIT 1",
+                array(bigintval($id)), __FILE__, __LINE__);
+       }
+
+       // Handle bonus points
+       BONUS_POINTS_HANDLER($_CONFIG['bonus_stats']);
+}
+
+// Free memory
+SQL_FREERESULT($result_bonus);
+
+//
+?>
diff --git a/inc/stylesheet.php b/inc/stylesheet.php
new file mode 100644 (file)
index 0000000..10341b9
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 08/29/2003 *
+ * ===============                              Last change: 12/03/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : stylesheet.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Stylesheets are stored here                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Style-Sheets werden hier abgelegt                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Default styles
+$STYLES = array(
+               "general.css",
+);
+
+// Add stylesheet for installation
+if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
+
+// When no CSS output-mode is set, set it to file-output
+if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE";
+
+// Output CSS files or content or link to css.php ?
+if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) {
+       // Load CSS files
+       if (is_array($EXT_CSS_FILES)) {
+               // Load extension's CSS files
+               foreach ($EXT_CSS_FILES as $value) $STYLES[] = $value;
+       }
+
+       // Create missing configuration file
+       if (!function_exists('GET_CURR_THEME')) {
+               // Dummy for e.g. down database links
+               function GET_CURR_THEME () {
+                       return "default";
+               }
+       } // END - if
+
+       // Output inclusion lines
+       foreach ($STYLES as $value) {
+               // Only include found CSS files (to reduce 404 requests)
+               $BASE = sprintf("%stheme/%s/css/", PATH, GET_CURR_THEME());
+               $file = $BASE.$value;
+
+               // Do include only existing files and whose are not empty
+               if ((FILE_READABLE($file)) && (filesize($file) > 0)) {
+                       switch ($_CONFIG['css_php']) {
+                               case "DIRECT":
+                                       OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/theme/".GET_CURR_THEME()."/".$value."\" />");
+                                       break;
+
+                               case "FILE":
+                                       $load = implode("", file($file));
+                                       OUTPUT_HTML($load);
+                                       break;
+                       }
+               }
+       }
+} else {
+       // Now we load all CSS files from css.php!
+       OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/css.php", false);
+       if (isBooleanConstantAndTrue('mxchange_installing')) {
+               // Default theme first
+               $NEW_THEME = "default";
+               if (!empty($_GET['theme'])) $NEW_THEME = SQL_ESCAPE($_GET['theme']);
+               if (!empty($_POST['theme'])) $NEW_THEME = SQL_ESCAPE($_POST['theme']);
+               OUTPUT_HTML("?theme=".$NEW_THEME."&amp;installing=1", false);
+       }
+       OUTPUT_HTML("\" />");
+}
+
+//
+?>
diff --git a/inc/theme-manager.php b/inc/theme-manager.php
new file mode 100644 (file)
index 0000000..ab5cb1d
--- /dev/null
@@ -0,0 +1,288 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/03/2004 *
+ * ===============                              Last change: 12/13/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : theme-manager.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Theme manager                                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Themen-Manager                                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Always make sure the session management is initialized first
+require_once(PATH."inc/session.php");
+
+// Get current theme name
+function GET_CURR_THEME() {
+       global $INC_POOL, $_CONFIG, $CSS, $cacheArray;
+
+       // The default theme is 'default'... ;-)
+       $ret = "default";
+
+       // Load default theme if not empty from configuration
+       if (!empty($_CONFIG['default_theme'])) $ret = $_CONFIG['default_theme'];
+
+       if (!isSessionVariableSet('mxchange_theme')) {
+               // Set default theme
+               set_session("mxchange_theme", $ret);
+       } elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION("sql_patches") >= "0.1.4")) {
+               //die("<pre>".print_r($cacheArray['themes'], true)."</pre>");
+               // Get theme from cookie
+               $ret = get_session('mxchange_theme');
+
+               // Is it valid?
+               if (THEME_GET_ID($ret) == 0) {
+                       // Fix it to default
+                       $ret = "default";
+               } // END - if
+       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+               // Prepare FQFN for checking
+               $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));
+
+               // Installation mode active
+               if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
+                       // Set cookie from URL data
+                       set_session("mxchange_theme", $_GET['theme']);
+               } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
+                       // Set cookie from posted data
+                       set_session("mxchange_theme", $_POST['theme']);
+               }
+
+               // Set return value
+               $ret = get_session('mxchange_theme');
+       } else {
+               // Invalid design, reset cookie
+               set_session("mxchange_theme", $ret);
+       }
+
+       // Add (maybe) found theme.php file to inclusion list
+       $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret));
+
+       // Try to load the requested include file
+       if (FILE_READABLE($theme)) $INC_POOL[] = $theme;
+
+       // Return theme value
+       return $ret;
+}
+
+function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
+       // Construction URL
+       $FORM = URL."/modules.php?module=".$mod;
+       if (!empty($act)) $FORM .= "&amp;action=".$act;
+       if (!empty($wht))   $FORM .= "&amp;what=".$wht;
+       define('__FORM_VALUE', $FORM);
+
+       // Initialize array
+       $THEMES = array(
+               'theme_unix'   => array(), // Unix name from filesystem
+               'theme_name'   => array()  // Title
+       );
+
+       // Load all themes
+       while(list($theme) = SQL_FETCHROW($result)) {
+               // Load it's theme.php file
+               $INC = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($theme));
+               if (FILE_READABLE($INC)) {
+                       // And save all data in array
+                       require($INC);
+                       $THEMES['theme_unix'][] = $theme;
+                       $THEMES['theme_name'][] = $THEME_NAME;
+               } // END - if
+       } // END - while
+
+       // Sort whole array by title
+       array_pk_sort($THEMES, array("theme_name"));
+
+       // Construct selection form for the box template
+       $OUT = "";
+       foreach ($THEMES['theme_unix'] as $key => $theme) {
+               $OUT .= "  <OPTION value=\"".$theme."\"";
+               if ($theme == GET_CURR_THEME()) $OUT .= " selected=\"selected\"";
+               $OUT .= ">".$THEMES['theme_name'][$key]."</OPTION>\n";
+       } // END - foreach
+
+       // Return generated selection
+       define('__THEME_SELECTION_OPTIONS', $OUT);
+       $OUT = LOAD_TEMPLATE("theme_select_form", true);
+       return $OUT;
+}
+
+// Get version from name
+function THEME_GET_VERSION ($name) {
+       global $cacheArray, $_CONFIG;
+
+       // Default version "number"
+       $cver = "-.-";
+
+       // Is the cache entry there?
+       if (isset($cacheArray['themes']['theme_ver'][$name])) {
+               // Get the version from cache
+               $cver = $cacheArray['themes']['theme_ver'][$name];
+
+               // Count up
+               $_CONFIG['cache_hits']++;
+       } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
+               // Load version from database
+               $result = SQL_QUERY_ESC("SELECT theme_ver FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1",
+                       array($name), __FILE__, __LINE__);
+
+               // Entry found?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch data
+                       list($cver) = SQL_FETCHROW($result);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+
+       // Return version
+       return $cver;
+}
+
+// Get id from theme
+function THEME_GET_ID ($name) {
+       global $cacheArray, $_CONFIG;
+
+       // Default id
+       $id = 0;
+
+       // Is the cache entry there?
+       if (isset($cacheArray['themes']['id'][$name])) {
+               // Get the version from cache
+               $id = $cacheArray['themes']['id'][$name];
+
+               // Count up
+               $_CONFIG['cache_hits']++;
+       } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
+               // Check if current theme is already imported or not
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1",
+                       array($name), __FILE__, __LINE__);
+
+               // Entry found?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Fetch data
+                       list($id) = SQL_FETCHROW($result);
+               } // END - if
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+
+       // Return id
+       return $id;
+}
+
+// Checks wether a theme is found in db
+function THEME_CHECK_EXIST ($name) {
+       // Get theme and is it not nul?
+       return (THEME_GET_ID($name) > 0);
+}
+
+// Checks if a theme is active
+function THEME_IS_ACTIVE ($name) {
+       global $cacheArray, $_CONFIG;
+
+       // Default is nothing active
+       $active = false;
+
+       // Is the cache entry there?
+       if (isset($cacheArray['themes']['theme_active'][$name])) {
+               // Get the version from cache
+               $active = ($cacheArray['themes']['theme_active'][$name] == "Y");
+
+               // Count up
+               $_CONFIG['cache_hits']++;
+       } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
+               // Check if current theme is already imported or not
+               $result = SQL_QUERY_ESC("SELECT theme_active FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
+                       array($name), __FILE__, __LINE__);
+
+               // Is the theme active and installed?
+               $active = (SQL_NUMROWS($result) == 1);
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+
+       // Return result
+       return $active;
+}
+
+// Gets current human-readable theme name
+function GET_CURR_THEME_NAME () {
+       global $cacheArray, $_CONFIG;
+
+       // Get the Uni* name
+       $name = GET_CURR_THEME();
+
+       // Is the cache entry there?
+       if (isset($cacheArray['themes']['theme_name'][$name])) {
+               // Get the version from cache
+               $name = $cacheArray['themes']['theme_name'][$name];
+
+               // Count up
+               $_CONFIG['cache_hits']++;
+       } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
+               // Check if current theme is already imported or not
+               $result = SQL_QUERY_ESC("SELECT theme_name FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' AND theme_name='Y' LIMIT 1",
+                       array($name), __FILE__, __LINE__);
+
+               // Is the theme active and installed?
+               $name = (SQL_NUMROWS($result) == 1);
+
+               // Free result
+               SQL_FREERESULT($result);
+       }
+
+       // Return name
+       return $name;
+}
+
+// Initialize variables
+$currTheme = GET_CURR_THEME();
+
+// Check if new theme is selcted
+if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $currTheme)) {
+       // Set new theme for guests
+       $newTheme = $_POST['new_theme'];
+
+       // Change to new theme
+       set_session("mxchange_theme", $newTheme);
+
+       // Remove current from array and set new
+       $theme = sprintf("%stheme/%s/theme.php", PATH, $currTheme);
+       unset($INC_POOL[array_search($theme, $INC_POOL)]);
+       $INC_POOL[] = sprintf("%stheme/%s/theme.php", PATH, $newTheme);
+} // END - if
+
+//
+?>
diff --git a/inc/weekly/.htaccess b/inc/weekly/.htaccess
new file mode 100644 (file)
index 0000000..14249c5
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
\ No newline at end of file
diff --git a/inc/weekly/weekly_ b/inc/weekly/weekly_
new file mode 100644 (file)
index 0000000..8e3bc85
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : weekly_                                          *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+//
+?>
diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php
new file mode 100644 (file)
index 0000000..2a9a0be
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/08/2008 *
+ * ===============                              Last change: 09/08/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : weekly_surfbar.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description :                                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  :                                                  *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) {
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
+       return;
+}
+
+// Do not execute when script is in CSS mode or no daily reset
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+
+// Reset the surfbar counter
+UPDATE_CONFIG("surfbar_weekly_counter", "0");
+$_CONFIG['surfbar_weekly_counter'] = 0;
+
+//
+?>